Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

Scrolling problem
Started by sleczek.mateusz Oct 23 2018 02:02 PM

2 replies to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Observer

  • 3 posts
  • Corona SDK

Any 1 can help me solve problem with scrolling, a black space showing up time by time on left side. watch a video.      


[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Corona Geek

  • 7,515 posts
  • Corona SDK

looks like you're moving textures and swapping their positions?


Use more textures.  Depending on the width of the texture, you need at least 3.


Alternately, just use a single texture and do this:

   -- ==
   --      parallaxBack
   -- ==
   display.setDefault( "textureWrapX", "repeat" )

   local parallaxBack = display.newRect( display.contentWidth, display.contentHeight)
   parallaxBack.x = display.contentCenterX
   parallaxBack.y = display.contentCenterY
   parallaxBack.fill = { type="image", filename="back.jpg" }
   display.setDefault( "textureWrapX", "clampToEdge" )
   local lastT = system.getTimer()
   function parallaxBack.enterFrame( self )
      local curT = system.getTimer()
      local dt = curT - lastT
      lastT = curT
      local dx = dt * 0.00005
      local fillX = self.fill.x
      fillX = fillX + dx
      if( fillX < -1 ) then 
         fillX = fillX + 2
      self.fill.x = fillX
   end; listen("enterFrame", parallaxBack )

[TOPIC: post.html]

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 619 posts
  • Corona SDK

Yeah, the reason as to why this is happening is due to you using too few images or moving them from left to right too soon. You are seeing that black area because apparently you run out of images to show on the left as they are (probably) all stacked to the right of the screen.