Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

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

2 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sleczek.mateusz

[GLOBAL: userInfoPane.html]
sleczek.mateusz
  • 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]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,286 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
      end
      self.fill.x = fillX
   end; listen("enterFrame", parallaxBack )



[TOPIC: post.html]
#3

XeduR @Spyric

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

  • 293 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.




[topic_controls]
[/topic_controls]