Game Development Reference
In-Depth Information
Determining the type of stylus input
If we use s3ePointerGetInt with the property S3E_POINTER_TYPE and get the
return type S3E_POINTER_TYPE_STYLUS , we can interrogate a little further to find
out what type of stylus we will be using by calling s3ePointerGetInt again with
the property S3E_POINTER_STYLUS_TYPE . The return values possible are in the
following table:
Return Value Description
S3E_STYLUS_TYPE_INVALID Call was invalid; most likely because we are not
running on a hardware that uses a stylus.
S3E_STYLUS_TYPE_STYLUS
Inputs are made by touching a stylus to the
input surface.
S3E_STYLUS_TYPE_FINGER
Inputs are made by touching a finger to the
input surface.
This is probably not a distinction that we will need to worry about in most cases, but
it might be useful to know so that games can be made more forgiving about inputs
when they are made with a finger, since a stylus has a much smaller contact surface
and should therefore allow for a far more accurate input.
Updating current pointer input status
In order to keep the s3ePointer API up-to-date with current touch screen inputs, it is
necessary to call the s3ePointerUpdate function once per frame. This will update
the cache of the current pointer status that is maintained within the s3ePointer API.
Detecting single touch input
If the s3ePointer API is available on our device, we are guaranteed to be able to
detect and respond to the user touching the screen and moving their stylus or
finger about, or moving an on-screen cursor around and pressing some kind of
selection button.
Even if our hardware supports multi-touch, we can still make use of single touch
input if our game has no need to know about multiple simultaneous touch points.
This may make it a little simpler to code our game, as we don't need to worry about
issues such as two buttons on our user interface being pressed at the same time.
As with key input, we can choose to use either a polled or callback-based approach.
Search WWH ::




Custom Search