Touch animation: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Created page with "{{Stub}} Designed for 2d objects, such as a canvas placements, this permits the receipt of touch (mouse click) events to enable the simulation of avionics with a touchscreen....")
 
No edit summary
Line 17: Line 17:
<binding>
<binding>
<command>nasal</command>
<command>nasal</command>
<script>print("touch input
<script>
(",cmdarg().getNode("x").getValue(),",",cmdarg().getNode("y").getValue())</script>
var values = cmdarg().getValues();
print("touch input:");
foreach(var field; keys(values)) {
debug.dump( field );
}
</script>
</binding>
</binding>
</action>
</action>

Revision as of 17:15, 30 October 2017

This article is a stub. You can help the wiki by expanding it.

Designed for 2d objects, such as a canvas placements, this permits the receipt of touch (mouse click) events to enable the simulation of avionics with a touchscreen.

The coordinates are passed in as arguments to the action; these can be accessed with Nasal via the cmdarg() method.

example:

<animation>
<type>touch</type>
<visible>true</visible>
<object-name>VSDImage</object-name>
<action>
<touch>0</touch>
<repeatable>false</repeatable>
<binding>
<command>nasal</command>
<script>
var values = cmdarg().getValues();
print("touch input:");
foreach(var field; keys(values)) { 
 debug.dump( field );
}
</script>
</binding>
</action>
</animation>


Related

References