Creating a Map that adjusts to screen size

  • 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" />


    The problem is that when I want to set the x and y coordinates of the rooms to the parent map, the position of the room in accordance with the map changes (x,y) 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.

    Sorry, this is a double post as I was having trouble relocating my original in the forum.

  • I was trying to get the children to align according to the x and y coordinates of a map file that changes size when the screen size changes. So scalechildren ended up working ok. However, I have now noted that it is not functioning properly on the iPad. Instead, the children are now still very small so I am back to square 1. Is it possible for this to work on the iPad?

    Code
    <!-- MAPS -->		
    	<plugin name="map_fl2" url="images/map_fl2.png" visible="false" y="-70" alpha="1.0" enabled="false" align="center" zorder="5" height="60%" width="prop" scalechildren="true" />
    <!-- BUTTONS -->
    	<plugin name="btn_cr1" url="images/btn_room_c1.png" visible="false" alpha=".4" enabled="false" align="bottomright" parent="map_fl2" x="274" y="320" keep="false" 
    		 zorder="15" height="34.46%" width="prop" onhover="set(plugin[btn_cr1].alpha, 1.0);" onout="set(plugin[btn_cr1].alpha, .4);" onclick="loadscene(scene_3 Sample, null, MERGE, BLEND); box3();" />
    	<plugin name="btn_cr2" url="images/btn_room_c2.png" visible="false" alpha=".4" enabled="false" align="bottomright" parent="map_fl2" x="508" y="223" keep="false" 
    		 zorder="15" height="34.85%" width="prop" onhover="set(plugin[btn_cr2].alpha, 1.0);" onout="set(plugin[btn_cr2].alpha, .4);" onclick="loadscene(scene_4 Sample, null, MERGE, BLEND); box4();" />
    	<plugin name="btn_eh" url="images/btn_room_escap.png" visible="false" alpha=".4" enabled="false" align="bottomright" parent="map_fl2" x="16" y="94" keep="false" 
    		 zorder="15" onhover="set(plugin[btn_eh].alpha, 1.0);" onout="set(plugin[btn_eh].alpha, .4);" height="45.5%" width="prop" onclick="loadscene(scene_2 Escap Hall, null, MERGE, BLEND); box2();" />

    You can review the sample here:
    http://www.360rama.com/uncc/tour.html Files can be reviewed at the parent directory.

  • Thanks,
    I have implemented a work around to check if the viewer is flash (or else) so that I can use dots instead of room layouts when on the iPad. I have to give a presentation of the tour to the UN here in Bangkok in a couple days so I was just hoping for the best view option. No matter though, this just provides more examples to show :)
    Look forward to an update.
    Thanks Klaus
    Cheers

Jetzt mitmachen!

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