Page 1 of 1

Map shifting

Posted: 05 Mar 2013, 06:10
by Madhav
Hi...

I am having trouble using openspace created maps,, my stage and maps created using openspace editor both are 765x478...
So the map should should fit to stage as openspace component is placed at (0,0) of stage. But the map is shifted for some x & y!!!

First I thought the problem may be scrolling and I stopped map scrolling by using openSpace.mapScrollingEnabled = false property after OpenSpace.MAP_RENDERED event is received. But I see that map still shifts!!!!??

And when I trace logs I get the following....

[INFO] Tiles creation progress: 100%
Map generation progress: 100%
[INFO] Map generation completed (144 ms)
[INFO] Map rendering duration: 9 ms
[INFO] Map shifted
[INFO] Avatars creation completed
[INFO] Map rendering completed
OpenSpace.MAP_RENDERED event received

[INFO] Map rendering duration: 2 ms
[INFO] Map shifted
[INFO] Avatar '25' created in (14,15,0)

How do I stop map from shifting?
Please do help.... :(

Re: Map shifting

Posted: 05 Mar 2013, 10:07
by Bax
Usually the map is shifted to center it on the user's avatar being created.
Just as a test, try not no create the avatar after loading the map, and the shift should not occur.
In the avatar creation parameters you have a setting which centers the viewport on the avatar upon creation. Maybe you set it to true?

Re: Map shifting

Posted: 06 Mar 2013, 04:22
by Madhav
Thanks Bax,
You were right...
Sorry I didn't noticed it.... I was centering the viewport on avatar creation....
But I don't really wanna do it... What I want is to center the map with respect to stage(center of stage), since I want my map to exactly fit to stage....

Any solutions!!???

Re: Map shifting

Posted: 06 Mar 2013, 09:11
by Bax
I strongly recommend that you read the OpenSpace API doc... on the IOpenSpaceAPI.renderMap method you have a parameter to control the initial map centering.

Re: Map shifting

Posted: 06 Mar 2013, 11:16
by Madhav
Thanks Bax...
I went through OpenSpace API doc... on the IOpenSpaceAPI.renderMap method.... and got it working now... :)