Release

Advanced Sprite Control test

3

was8bit 2021-11-22 20:07 (Edited)

This test covers...

1) Being able to detect touching the AREA that a sprite covers, despite empty spaces inside the sprite

2) Being able to distringuish between a TAP or a DRAG sprite action

TAP: touch and quickly release ...

DRAG: hold touch until sprite changes color, then drag SLOWLY... release to reset sprite

(Includes check to ignore touch if one first touches outside the sprite then drags over to the sprite, will also begin to ignore if you drag too quickly)


was8bit 2021-11-22 20:21 (Edited)

Applications...

For a tool, like a paint program... tap to change tool, drag to use...

To place a gamepiece... tap to adjust or command the piece, drag to move it...

The touchspace can be edited, and the concept allows pieces that look nice but may be otherwise difficult to access with touch control...

The touchspace trick is simple, just change the sprite to its touchspace, check for touch, then change sprite back to normal right away.. thus the touchspace is never seen by user ;)

The TAP/DRAG is done by keeping track how long the touch lasts, in 1/60 of a second... i have chosen 7/60 with TAPMAX=7 but anyone can adjust to their tastes...


was8bit 2021-11-22 20:29

I plan on using this for one more mobile phone game ;)


Log in to reply.