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

From Serious Documentation
Jump to: navigation, search
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 {{Const|touch|TOUCH.UP}}, {{Const|touch|TOUCH.DN}}, {{Const|touch|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

Revision as of 11:06, 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.