Shyt3000 Posted November 16, 2017 Share Posted November 16, 2017 Hi, I want to create a big world. I load a few tylemaps. All cards I initialize with layer.scrollFactorX = 0; layer.scrollFactorY = 0; layer.position.set(m.startX, m.startY); When I move my camera to the tilemap from the left (game.camera.x >= layer.x) i want to stick the map to the camera (layer.x = 0;) and move its contents, but when I do - layer.scrollFactorY = 1; the card "jumps" to the distance the camera passed before it ( video in attach), haw can i fix that? And how i can scroll map to left side? (if i will move camera from right side) Без названия.mov Link to comment Share on other sites More sharing options...
samme Posted November 17, 2017 Share Posted November 17, 2017 10 hours ago, Shyt3000 said: the card "jumps" to the distance the camera passed before it ( video in attach), haw can i fix that? It has to jump because the scroll position has to be accurate during each frame. You should tween scrollFactorY from 0 to 1 for a gradual change. Link to comment Share on other sites More sharing options...
Shyt3000 Posted November 17, 2017 Author Share Posted November 17, 2017 Thanks for the answer but my problem is not in the smoothness of the jump. I need, that would be when the camera went to the border tilemap - the map began to spin from zero X position. Now she starts from the position where I installed the map. Tryed this: layer.scrollX = 0; But it don't have any effect =( Any ideas haw i can scroll tilemap? Link to comment Share on other sites More sharing options...
Recommended Posts