Difference between revisions of "SHIP:Data Types:Touch"

From Serious Documentation
Jump to: navigation, search
(Created page with "A {{Port|touch}} port's {{Portvar|touch|event}} portvar is a complex {{DataType|Touch}} datatype with several properties. For example: * '''TOUCH0.event.e''' contains the TOU...")
 
Line 1: Line 1:
 
A {{Port|touch}} port's {{Portvar|touch|event}} portvar is a complex {{DataType|Touch}} datatype with several properties. For example:
 
A {{Port|touch}} port's {{Portvar|touch|event}} portvar is a complex {{DataType|Touch}} datatype with several properties. For example:
  
* '''TOUCH0.event.e''' contains the TOUCH.UP, TOUCH.DN, TOUCH.MV event code
+
* '''TOUCH0.event.e''' contains the {{Const|touch|TOUCH.UP}}, {{Const|touch|TOUCH.DN}}, {{Const|touch|TOUCH.MV}} event code
 
* '''TOUCH0.event.x''' contains the most recent x position of the touch
 
* '''TOUCH0.event.x''' contains the most recent x position of the touch
 
* '''TOUCH0.event.y''' contains the most recent y position of the touch
 
* '''TOUCH0.event.y''' contains the most recent y position of the touch
* '''TOUCH0.event.value''' (or in short form, '''TOUCH0.event''') changes whenever any sub-property (e, x, or y) changes.
+
* '''TOUCH0.event.value''' (or in short form, '''TOUCH0.event''') changes whenever any sub-property ('''e''', '''x''', or '''y''') changes.
  
To listen in a SHIP GUI for a touch event in a box on the screen, set the {{Node|listener|listener}}'s {{Prop|listener|listeningto}} property to, for example, '''TOUCH0.event.e'''. You may want to be more specific and only listen for a release, as an example, you would add '''(TOUCH0.event.e == TOUCH.UP)''' to the same {{Node|listener|listener}}'s {{Prop|listener|condition}} property.
+
To listen in a SHIP GUI for a touch event in a {{Node|box}}, create a listener in that box and set the {{Node|listener|listener}}'s {{Prop|listener|listeningto}} property to, for example, '''TOUCH0.event.e'''. You may want to be more specific and only listen for a release. In that case, you would add '''(TOUCH0.event.e == TOUCH.UP)''' to the same {{Node|listener|listener}}'s {{Prop|listener|condition}} property.

Revision as of 10:49, 1 February 2013

A touch port's event portvar is a complex Touch datatype with several properties. For example:

  • TOUCH0.event.e contains the TOUCH.UP, TOUCH.DN, TOUCH.MV event code
  • TOUCH0.event.x contains the most recent x position of the touch
  • TOUCH0.event.y contains the most recent y position of the touch
  • TOUCH0.event.value (or in short form, TOUCH0.event) changes whenever any sub-property (e, x, or y) changes.

To listen in a SHIP GUI for a touch event in a box, create a listener in that box and set the listener's listeningto property to, for example, TOUCH0.event.e. You may want to be more specific and only listen for a release. In that case, you would add (TOUCH0.event.e == TOUCH.UP) to the same listener's condition property.