SHIP:Data Types:Touch

From Serious Documentation
Revision as of 10:49, 1 February 2013 by NickW-Serious (talk | contribs)
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, 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.