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.
Have you considered using a slider component instead of a pair of buttons?
Have the slider rely on “position changed” value event trap to determine if the touch point is left or right of center.
The other suggestion to use a canvas would also work, but a canvas is a bit more resource intensive.
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.
this is very good. I can take a look into the blocks and I will understand so much more quickly how that is related to each other than to read the documentation of MIT AI.
There are some interesting math formulas I have to study. And I think in a few days or weeks I will understand the whole blocks. I hope so…