Gerente Posted March 21, 2018 Share Posted March 21, 2018 Hi, im working on the camera of my game, its a 2d game and I need to center the camera to the character, enemies, etc.. to different objects in or out of the screen. Anyone could advice me about this, any good practice, technique, mistakes, etc.. I'm just moving the camera toward the object and stopping it when the distance is lower than the camera speed but I have some artifact on the way when I play it on mobile vs pc. Seems that devicePixelRatio have something to do with this. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 21, 2018 Share Posted March 21, 2018 use "renderer.screen.width" for CSS-based coords, not "renderer.view.width" Also find the posts about "pivot + position" camera technique Quote Link to comment Share on other sites More sharing options...
paperjack Posted March 23, 2018 Share Posted March 23, 2018 I use this https://github.com/davidfig/viewport Quote Link to comment Share on other sites More sharing options...
Gerente Posted March 24, 2018 Author Share Posted March 24, 2018 17 hours ago, paperjack said: I use this https://github.com/davidfig/viewport great, that is what I needed! thanks! 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.