NIK30 Posted July 30, 2016 Share Posted July 30, 2016 Hi, Please have a look at sample on this link http://babylonjs-playground.com/#1QKRUF#157 I would like to get scrolling working if canvas goes beyond view port. If I zoom in, whole screen is occupied with canvas. I would like to use my mouse or touch to move along canvas, Could anyone please help me to achieve the same? Thanks, Nikhil Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 31, 2016 Share Posted July 31, 2016 http://babylonjs-playground.com/#28LCTD#1 This demo has LOTS of code that was borrowed from DK's drag and drop playground demo. Essentially, instead of using the normal getGroundPosition func, I converted it to getCanvMeshPosition. After a bit more tweaking, we have successful dragging upon a canvas2D. YAY! But, the action being taken with each drag... is a camera.target move, not a canvas2D location move. The drags are sliding-around the camera, not the blue rectangle. Seems to work. I included a sensitivity setting, just cuzzz I'm a nice guy. This should do what you want, no matter the zoom level. Are you planning to fill the blue rectangle with a map/land-texture? Is this for a "map view" of a game? Coooool. By the way, welcome... good to have you with us. I hope this helps your issue. If not, just say so, we'll try something else. Party on! Quote Link to comment Share on other sites More sharing options...
NIK30 Posted August 1, 2016 Author Share Posted August 1, 2016 Thanks Wingnut.. Yes blue rectangle is going to be a map. I am trying to use babylonjs in an enterprise app ? 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.