How to fix the map

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

Moderators: Lapo, Bax

Post Reply
jackygu
Posts: 34
Joined: 13 Jun 2008, 17:35

How to fix the map

Post by jackygu »

Hi,
I want to fix the map in the window, that means if the avatar approch the side, the map will not scroll.
How can we do?

Tks.
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

You can do this only if the overall map size in pixels is less than the viewport size. We may add a method in the final release to inhibit the scrolling.
Paolo Bax
The SmartFoxServer Team
pt_dev
Posts: 37
Joined: 15 Sep 2008, 16:15

Post by pt_dev »

Hi bax,
We may add a method in the final release to inhibit the scrolling.
Does this method come out yet? if so, how can we use?

I can't seem to find any information on this issue.

- pt_dev
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

No sorry, currently there's no way to inhibit scrolling.
The options you have are:
1. make the map smaller than the viewport;
2. in the xml configuration file set the <ScrollSensorSize> parameter to 100 and do something like this on the map (also, make the avatar appear in the center of the map):

Image
Paolo Bax
The SmartFoxServer Team
Dorru
Posts: 45
Joined: 16 Dec 2008, 13:45

Post by Dorru »

bax wrote:No sorry, currently there's no way to inhibit scrolling.
The options you have are:
1. make the map smaller than the viewport;
2. in the xml configuration file set the <ScrollSensorSize> parameter to 100 and do something like this on the map (also, make the avatar appear in the center of the map):

Image


Must be a way to not have to make the avatar appear in the center and still have the viewport like in the picture? Think of a map with the background of a single room, would you want the avatar to appear in the center of the room instead from a door?
Dorru
Posts: 45
Joined: 16 Dec 2008, 13:45

Post by Dorru »

Is it possible or do you have to use centerViewOnTile?

If thats the case, how should the code look like and where would you place it?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Yes, using the centerViewOnTile method is the right way to do what you need. Check the API documentation on its usage. You will have to call it right after the creation of the user's avatar.
Paolo Bax
The SmartFoxServer Team
Post Reply