Lab App - Image move with mouse


#1

Hi,

Can someone please let me know what UI control will allow an image to move with the mouse. Or an image move with the press of the arrow keys. Thanks!


#2

From what I have seen from the applab documentation, I don’t think that is possible. https://docs.code.org/applab/
However, I will inquire further.


#3

@mlarrubia

Check Unit 5 Stage 14 for the use of the keyboard to move an image. There is some documentation on the onEvent help on how to get an image to follow the mouse. It involves using event.x and event.y for the location of the image.

Andrea


#4

Hi @mlarrubia,

Here is an example app that has an image which just follows the mouse.

Hope it helps!

-Dani


#5

Thanks Dani, I emailed you, can you please take a look at the program if you have a second.


#6

anmrobnott - Thanks This helped!


#7

Here’s a video I just made explaining how to implement movement of an image using the arrow keys. You can do the same sort of thing with the mousemove events if you want to tie it to mouse movement instead.