2 maps and 2 buttons
Submitted by k_kwiatek on October 19, 2008 - 16:21.
I have two maps and two buttons.
I always want to show only one map.
Button 1 = map 1
Button 2 = map 2
I also have two RAMPS: map-shifter_1 and map-shifter_2
<ramp id="map-shifter_1" value1="0" value2="-820" duration=".3" pingpong="true">
<behavior>
<action event="change" type="setProperty" property="hoffset" target="opaque-map1" value='=getProperty("map-shifter_1","value")' />
</behavior>
</ramp> and
<ramp id="map-shifter_2" value1="0" value2="-820" duration=".3" pingpong="true">
<behavior>
<action event="change" type="setProperty" property="hoffset" target="opaque-map2" value='=getProperty("map-shifter_2","value")' />
</behavior>
</ramp> I use this code to show a map 1 after pressing a button 1:
<action event="release" type="setProperty" target="map-shifter_1" property="active" value="true" /> I click button 1 to see map 1.
I click button 2 to see map 2.
How can I move the map 2 to its original position (off the screen) when someone clicked button 1?
I tried sth like this but it doesn't work:
<action event="change" property="value" target="map-shifter_2" type="setProperty" value="=getProperty("map-shifter_2","value")"/>How can I only have one map every time?
Karol
fieldOfView | SPi-V dev
Re: 2 maps and 2 buttons
Before you activate the 'other' ramp, be sure to set the "direction" property of that ramp to -1.
<!--actions for button 1
* do show or hide map 1
-->
<action event="release" type="setProperty" target="map-shifter_1" property="active" value="true" />
<!--
* make sure that the ramp for map2 is always pointing in the 'hide' direction
-->
<action event="release" type="setProperty" target="map-shifter_2" property="direction" value="-1" />
<!--
* activate the ramp for map2
if map2 is already hidden, it should stay hidden
-->
<action event="release" type="setProperty" target="map-shifter_2" property="active" value="true" />
the use of *
Aldo,
that works well. Thanks for your help!
How about many objects?
Have a look to my example:
<action event="release" type="setProperty" property="active" target="informacja_losio_skrzyz_wies-blend" value=""/><action event="release" type="setProperty" property="direction" target="informacja_losio_skrzyz_history-blend" value="-1"/>
<action event="release" type="setProperty" property="active" target="informacja_losio_skrzyz_history-blend" value="true"/>
I tried to hide already opened windows with information by using (*):
<action event="release" type="setProperty" property="direction" target="informacja_losio_skrzyz_*-blend" value="-1"/><action event="release" type="setProperty" property="active" target="informacja_losio_skrzyz_*-blend" value="true"/>
but it is not working. Do I use (*) correctly?
Karol
Re: the use of *
The * character must be the last character in the target id
Re: the use of *
Thanks!