User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

adding_code_comments_to_gestures [2015/09/15 13:21] (current)
glass created
Line 1: Line 1:
 +====== Adding Code Comments To Gestures ======
 +Since GML is built on the XML "​[W3c]"​ standard syntax in order to add comments to your GML simply wrap the text in "​!--"​ and "​--"​ tags. As shown below:
 +<​code:​csharp linenums:​1>​
 +<Gesture id="​n-drag"​ type="​drag">​
 +<!-- The '​n-drag'​ gesture can be activated by any number of touch points between 1 and 10. When a touch down is recognized on a touch object the position of the touch point is tracked. This change in the position of the touch point is mapped directly to the position of the touch object. -->
 +    <​match>​
 +        <​action>​
 +            <​initial>​
 +                    <   ​cluster point_number="​0"​ point_number_min="​1"​ point_number_max="​10"/>​
 +            </​initial>​
 +        </​action>​
 +    </​match> ​      
 +    <​analysis>​
 +        <​algorithm class="​kinemetric"​ type="​continuous">​
 +            <library module="​drag"/>​
 +            <​returns>​
 +                <​property id="​drag_dx"​ result="​dx"/>​
 +                <​property id="​drag_dy"​ result="​dy"/>​
 +            </​returns>​
 +        </​algorithm>​
 +    </​analysis> ​   ​
 +    <​mapping>​
 +        <update dispatch_type="​continuous">​
 +            <​gesture_event ​ type="​drag">​
 +                <​property ref="​drag_dx"​ target="​x"/>​
 +                <​property ref="​drag_dy"​ target="​y"/>​
 +            </​gesture_event>​
 +        </​update>​
 +    </​mapping>​
 +Comment tags are not treated in the same way as other tags in most parsers. As long as the text contents of the comment tags do not contain the characters "​--"​ it will be "​ignored"​ by the parser.
adding_code_comments_to_gestures.txt · Last modified: 2015/09/15 13:21 by glass