Sie sind nicht angemeldet.

1

Donnerstag, 12. April 2012, 10:55

Math, Maps, Scale, and XY

I could use a little help creating a map.

I am creating a map "plugin". Each room on the map has a copy of itself (a separate png file (plugin)) that overlays on top of the room, thereby allowing me to change the alpha and make a room "clickable". Easy enough to do, except when I have the map set to adjust its size according to screen size.... example:

Quellcode

1
2
<!-- map height is 80% the height of the stage  and width is proportional -->
<plugin name="map" height="80%" width="prop" />


Now when I want to set the x and y coordinates of the rooms to the parent map, the x,y coordinates of the room change when the scale of the map increases or decreases, such as from windowed to fullscreen.
I was trying to get (determine) the size of the map plugin each time it was scaled, but couldn't figure it out. I tried...

Quellcode

1
get(plugin[map].height);
and thought this should be correct, but I couldn't trace a value for it.

I also am not sure what the best math equation is to solve x,y coordinates once I determine the current size of the map.

My simple mind could use a little help here, please.

2

Donnerstag, 12. April 2012, 15:06

Hi!
use scalechildren attribute of parent plugin
or % in x and Y of child plugin

Regards
Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

3

Donnerstag, 12. April 2012, 16:27

Solved with Scalechildren

Hi!
use scalechildren attribute of parent plugin
or % in x and Y of child plugin


Scalechildren did the trick, thanks Andrey.