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:

    Code
    <!-- 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...

    Code
    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.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!