Moving picture with mouse cursor (not drag)
Posted: Fri Nov 05, 2021 4:30 am
Hello guys,
I don't have any problem but I would like some opinion before I jump into a new code alone a get a lot of troubles!
I would like your opinion about eh best way to make the system I gonna to describe to you.
First, Take a look at this picture I've done :
(Clik on it to enlarge)
https://i.ibb.co/s2DRfz2/Key-Hole-WORK-IN-PROGRESS.jpg
This is the final picture which is compose of this 2 other one :
The mask
https://i.ibb.co/FVqwyx8/Key-Hole-WORK- ... S-Mask.jpg
The image
https://i.ibb.co/YDWfVMT/Key-Hole-WORK- ... SS-Pic.jpg
Now, the thing is, I want the player to be able to move the mouse cursor around to explore the image without having to click anywhere, just moving the mouse cursor around.
(In order to simulate the head movement of the charcter who is peeping through the keyhole.
So I have no idea how to begin my coding but I'm almost sure this is possible.
I'm wondering mainly about this things :
Which part should be fix and which part should move : the image it self or the mask which cover it (the result should be the same)
Should I do a moving keyhole in all axes, or only x axis (left and right) ? so I could use a keyhoe mask with is png and way larger than the picture itself.
How do I limit my movement to avoid displaying part of the side of the images ?
And what code should I use ?
I know it's a lot but I was wondering maybe someone around here is familiar with this kind of thing or have already done it in it's own project so I could lead me in the right direction, thanks guys !
I don't have any problem but I would like some opinion before I jump into a new code alone a get a lot of troubles!
I would like your opinion about eh best way to make the system I gonna to describe to you.
First, Take a look at this picture I've done :
(Clik on it to enlarge)
https://i.ibb.co/s2DRfz2/Key-Hole-WORK-IN-PROGRESS.jpg
This is the final picture which is compose of this 2 other one :
The mask
https://i.ibb.co/FVqwyx8/Key-Hole-WORK- ... S-Mask.jpg
The image
https://i.ibb.co/YDWfVMT/Key-Hole-WORK- ... SS-Pic.jpg
Now, the thing is, I want the player to be able to move the mouse cursor around to explore the image without having to click anywhere, just moving the mouse cursor around.
(In order to simulate the head movement of the charcter who is peeping through the keyhole.
So I have no idea how to begin my coding but I'm almost sure this is possible.
I'm wondering mainly about this things :
Which part should be fix and which part should move : the image it self or the mask which cover it (the result should be the same)
Should I do a moving keyhole in all axes, or only x axis (left and right) ? so I could use a keyhoe mask with is png and way larger than the picture itself.
How do I limit my movement to avoid displaying part of the side of the images ?
And what code should I use ?
I know it's a lot but I was wondering maybe someone around here is familiar with this kind of thing or have already done it in it's own project so I could lead me in the right direction, thanks guys !