was8bit 2020-10-30 05:14 (Edited)
DRAG : put finger close to mouse and drag it close to where you want it
FINE CONTROL : put finger at some distance from mouse, then drag slowly to move mouse slowly into position
CLICK : double tap anywhere on the screen to click mouse.. on this demo, this will turn a character off/on (gray/red)
NOTE: when repeatedly repositioning mouse, be sure not to quickly touch in the same area, as this might sometimes be interpreted as a mouse click
Reworked for iphone :)
G-9 2020-10-30 09:02
I can’t double click on phone...
Timo 2020-10-30 09:22
The idea is interesting, but I also have trouble with the click on my phone. Do you have to click on the arrow? Maybe the click should be possible anywhere on screen.
was8bit 2020-10-30 11:28
Ah, thanks for the feedback, i will rework the click :)
was8bit 2020-10-30 12:24
Ok, tested on my iphone, reworked code, and tweaked settings... should work OK now :)
G-9 2020-10-30 12:51
was8bit 2020-10-30 15:13
Does this mean it works ok now ?
G-9 2020-10-30 15:26
Yea basically ;)
was8bit 2020-10-31 04:42
Now, the important question, how does it function for you as an ability to click small things by using the touch screen?
If it isn't 100%, you can tweak these variables at the top of the code to see what may work better...
FINESWIPE is used when you are using Fine Control.. 0.333 means the mouse moves 1 pixel per 3 pixels your finger moves (1/3) or a 1:3 ratio... a smaller decimal would move the mouse slower... a larger decimal would move the mouse quicker
TAPTOUCH : for when you double tap, how precise must your finger taps be between the first and second tap... too precise and the double tap wont often be recognized... to far of a difference and multiple swipes might be taken as a double tap.. currently set for 32 pixel variance
SET_OFF is how much time between taps is allowed... if time exceeds SET_OFF then the doubletap sequence is reset... this helps avoid multiple mouse moves being mistaken as a double tap.. to small, though, and double taps may become difficult...
GAMELEGEND 2020-11-01 00:11
what is the ITOUCH variable for
was8bit 2020-11-01 04:13
Most all of my variables where i have added an i in front of the name means INDEX... think of them as light -switches (on/off) or gear settings on a car (reverse, neutral, drive) their value helps keep track of the state or condition something is in....
Specifically ITOUCH=0 indicates that the screen is currently NOT being touched...
IF TOUCH THEN will constantly run as long as someone's finger is touching the screen... the IF ITOUCH=0, then, captures the FIRST immediate moment the finger hits the screen, and allows me to capture data about the first touch, and also initalize anything i may need at the beginning of the touch...
In this case, the OLD touched position (OX,OY) needs reset to the initial touch position otherwise the code will act on the old position from a past touch... so this simply resets and initializes OX,OY and gets it set up to start working properly with the new touch...
GAMELEGEND 2020-11-01 04:14 (Edited)
ah I see
thanks for explaining
I tried to figure it out my self
and ended with more questions than answers
was8bit 2020-11-01 04:27
I "TRY" to make my code readable... i often use "tricks" or fixes for issues that seem to work well...
TAP will only run the first instance you touch, then will not run again until you lift your finger and put it back down again
TOUCH runs constantly, as long as the finger is touching...
But there is often a need to do some "fixing" of things at the very start the TOUCH is first ran, so my "fix" you see helps me grab that first run thru that might help the TOUCH code run the way i want it too..
... another example of how i use the i-Prefix is for controlling a sequence, say an explosion... so IBLAST can control each stage of the blast, say 0 means the blast is "off" or done, 1 is a small ignition spark, 2-5 animates a rapid animation, and 6-8 the smoke after the blast... then if the player hits the bomb, the player may only get hit if IBOMB>=2 and IBOMB<=5 as smoke doesnt hurt the player..
Something that complicated requires I use REM statements where i write out step for reference as i code things... but often it doesnt need to be that complicated ... ;)