ShotgunJed Posted August 2, 2017 Share Posted August 2, 2017 I'm trying to make a camera and I made it work by using this code: // Setup stage.pivot.x = user.position.x; stage.pivot.y = user.position.y; stage.position.x = renderer.width/2; stage.position.y = renderer.height/2; // Moving stage.x += 5; // Change 5 to -5 when moving other direction stage.y += 5; Thing is, if I console.log the stage, and move the stage across my screen, the position 0,0 is nowhere to be found logically. i.e: I should expect 0,0 to be at the top left corner (when aligning the top left corner of the Container with the top-left corner of the browser) but it isn't. Its often somewhere random in the middle. By doing this: console.log('x:', scene.transform.localTransform.tx); console.log('y:', scene.transform.localTransform.ty); And moving my scene's top-left corner with the top-left corner of my browser, I get 0,0 which makes sense. So now I've been trying to put some sort of limit on these two localTransform variables but it isn't working. Is there a way to edit these? Quote Link to comment Share on other sites More sharing options...
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.