Artyom Trityak Posted May 3, 2016 Share Posted May 3, 2016 Hi, I am trying to create something line world map which is a globe so edges are connected (ex from most left side you go to most right side). This has has been split into small sprites each of them is individually interactable i.e clicks, hovers so i can not use TilingSprite because each small sprite should be interactive individually. So the question is - is there any way to connect edges of the map so when used will do right panning, user will feel like infinity globe map. Currently when user use panning i am changing container.x and container.y. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 3, 2016 Share Posted May 3, 2016 Better to change container.pivot.x than container.x if you want camera-like behaviour. For now you have to move your sprites to achieve that effect. When v4.1 will be more stable, you'll be able to use Cameras to achieve it: http://pixijs.github.io/examples/index.html?s=camera&f=mirror.js&title=%5Bv4.1%5D+2+bunnies+2+cameras&v=dev-4.1.0 Quote Link to comment Share on other sites More sharing options...
Artyom Trityak Posted May 3, 2016 Author Share Posted May 3, 2016 What is benefit pivot.x over .x ? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 3, 2016 Share Posted May 3, 2016 1 hour ago, Artyom Trityak said: What is benefit pivot.x over .x ? It applies after scale and rotation. Imagine that you want local coords(x1,y1) be pinned to screen (x2,y2). Then position must be (x2,y2) and pivot must be (x1, y1) regardless of scale/rotation of container. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 3, 2016 Share Posted May 3, 2016 I dont know whats wrong there. Pivot works on my demos just fine, and I know how it works internally. Quote Link to comment Share on other sites More sharing options...
Artyom Trityak Posted May 3, 2016 Author Share Posted May 3, 2016 Thanks, it works for me but i don't see any difference pivot vs x/y . it's only about zoom recalculation. Is there any internal performance difference? Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted May 4, 2016 Share Posted May 4, 2016 It'll be much easier to rotate a camera by using pivot instead, but it may not be any different if you don't need rotation. You can see how pivot is used for camera in LesserPanda here. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 4, 2016 Share Posted May 4, 2016 @Artyom Trityak No performance difference, its only about ideology. Though in v4.1 there will be difference, because projection and worldTransform are separated there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.