ilan Expert Licensed User Longtime User Sep 27, 2018 #1 hi "erel" i am pointing this question to erel since he is the creator of xui2d. i would like to understand how you add the tilemap the panel. and how it is positioning according to the world. so if my world is 25 meters width and 15 meter height i have from the center of the world 12.5 meters to the right and 12.5 meters to the left and 7.5 meters to the top and 7.5 meters to the bottom. now when i draw my tilemap is it also draw in the middle of the world?
hi "erel" i am pointing this question to erel since he is the creator of xui2d. i would like to understand how you add the tilemap the panel. and how it is positioning according to the world. so if my world is 25 meters width and 15 meter height i have from the center of the world 12.5 meters to the right and 12.5 meters to the left and 7.5 meters to the top and 7.5 meters to the bottom. now when i draw my tilemap is it also draw in the middle of the world?
Erel B4X founder Staff member Licensed User Longtime User Sep 27, 2018 #2 (0,0) = map bottom-left corner. The correct way to set the world center is: Code: Copy Dim WorldWidth As Float = 25 'meters Dim WorldHeight As Float = WorldWidth / RatioSetInDesignerScript 'same ratio as in the designer script X2.ConfigureDimensions(world.CreateVec2(WorldWidth / 2, WorldHeight / 2), WorldWidth) The result should look like: Above image is from the joints example (where the width is 6 meters). ScreenAABB shows the bottom-left corner and the top-right corner coordinates.
(0,0) = map bottom-left corner. The correct way to set the world center is: Code: Copy Dim WorldWidth As Float = 25 'meters Dim WorldHeight As Float = WorldWidth / RatioSetInDesignerScript 'same ratio as in the designer script X2.ConfigureDimensions(world.CreateVec2(WorldWidth / 2, WorldHeight / 2), WorldWidth) The result should look like: Above image is from the joints example (where the width is 6 meters). ScreenAABB shows the bottom-left corner and the top-right corner coordinates.
ilan Expert Licensed User Longtime User Sep 27, 2018 #3 Erel said: (0,0) = map bottom-left corner. Click to expand... so something like this?
Erel B4X founder Staff member Licensed User Longtime User Sep 27, 2018 #4 Not exactly. If the world center is set to 0, 0 then the map will only appear in the top right quarter.
Not exactly. If the world center is set to 0, 0 then the map will only appear in the top right quarter.