neonwarge04 Posted December 10, 2015 Share Posted December 10, 2015 How can I handle sprite coordinates when the container it belongs to scaled? I am trying to resize my game app base on the size of the screen but the scaling seems to disrupt my toons grid location. This is only occurs when I resize (scale) the game to fit the device screen.What I am trying to do is that I have two containers, MainContainer and SubContainer. MainContainer is what I use generally for common view for example placing some UI parts. The SubContainer is what I use to pan the world around. I have been successful using this setup but it breaks when I scale the screen to fit into the device. For instance I am scaling the MainContainer.Is there a solution for this? How am I suppose to handle this? What I have been thinking is to get how much pixels do the screen scaled to and account for it and apply the difference to every sprite but I am not sure about this.Thanks for your help! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 10, 2015 Share Posted December 10, 2015 I dont understand whats wrong in your case. If you want sprite coordinates on screen, look at getBounds(). If you want to find all sprites in particular point of screen, use renderer.plugins.interaction.processInteractive, look into https://github.com/pixijs/pixi.js/blob/master/src/interaction/InteractionManager.js#L265 as an example. 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.