I hope my question is clear:
I want two buttons side by side to move a sprite left or right. I would like to have the thumb not lifted from the display so that the other button is triggered. the finger should “slide” on the display. with which block is this possible?
it doesn’t work with GOT FOCUS or with LOST FOCUS or I didn’t get it.
I’m going to make a circular fake button, where the thumb can move in any direction. So I have to determine from where in which direction the thumb is moved. I sincerely hope that when changing direction you will still be able to tell where the thumb first touched the display (startX startY) and make all movements dependent on it.
Problems maybe: Canvas size and fixed pixels on various displays
We will see. I like to try it. Especially because I will certainly get help here if I do not know what to do.
Make the canvas a % size instead of fixed pixel. At least you will have a standard behavior that is consistent across devices.
But (and that is the clever bit) you can get the “canvas.width” and “canvas.height” out, and those values are returned in pixel, a value that is consistent with the position of anything drawn in it.
For instance, if you are touching the dead center of the canvas, then the X and Y value will be canvas.width/2 and canvas.height/2.
By setting the canvas in %, but internally processing based on calculations based on canvas.height and canvas.width (expressed in pixels) you simply create the reference that will naturally adapt to the device on which the app is installed.