java.lang.Object
technology.sola.engine.input.TouchInput
TouchInput contains information about user interaction with the touch screen.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMax number of simultaneous touches supported. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the number of active touches (fingers on the screen).@Nullable Touch@Nullable Touch@Nullable TouchgetTouch(int id) Gets theTouchof the given finger by unique id.voidonTouchEvent(TouchEvent event) Called by theSolaPlatformwhenever a touch event occurs.voidUpdates the status of changedTouches from the previous frame.
-
Field Details
-
MAX_TOUCHES
public static final int MAX_TOUCHESMax number of simultaneous touches supported.- See Also:
-
-
Constructor Details
-
TouchInput
public TouchInput()
-
-
Method Details
-
getActiveTouchCount
public int getActiveTouchCount()Gets the number of active touches (fingers on the screen).- Returns:
- the active touch count
-
activeTouchesIterator
- Returns:
- iterator for all the active touches
-
getFirstTouch
- Returns:
- the
Touchof the first finger or else null
-
getFirstActiveTouch
- Returns:
- the
Touchof the first finger that is still on the screen or else null
-
getTouch
Gets theTouchof the given finger by unique id.- Parameters:
id- the id (typically 0-9)- Returns:
- the
Touchof the given finger or else null
-
updatedStatusOfTouches
public void updatedStatusOfTouches()Updates the status of changedTouches from the previous frame. -
onTouchEvent
Called by theSolaPlatformwhenever a touch event occurs.- Parameters:
event- theTouchEvent
-