SHIP:Data Types:Touch

From Serious Documentation
Revision as of 10:27, 1 February 2013 by NickW-Serious (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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 on the screen, 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, as an example, you would add (TOUCH0.event.e == TOUCH.UP) to the same listener's condition property.