Viewport control - Drag with mouse

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

clouting
Posts: 17
Joined: 18 May 2011, 13:57

Viewport control - Drag with mouse

Postby clouting » 18 May 2011, 14:04

Hi,

I am trying to implement a draggable map to scroll the background of my virtual world (the user can click and drag the map around to move it within the view port).

I see there are a couple of methods related to this (panView, centerViewOnCoords) but they don't seem to work for what I need to do.

Is there a way I can simply tell the view port to offset by a certain number of pixels? Or is there something I am missing?

Thanks in advance.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 23 May 2011, 08:06

The panView method does what you are looking for: just pass the number of pixels in the horizontal and vertical directions, and it pans the map.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 28 guests