moving an image using touch

cammel8

Member
Licensed User
Longtime User
I am creating a whiteboard program. What I want to do is have an image as the background then other smaller images that I can move around on that first image with bounding edges so I cant move the smaller images outside of the bigger image.

Imagine, if you will, a kitchen with a refrigerator with magnets on it. You can move the magnets anywhere on the fridge but you don't want to be able to move the magnet off the fridge and have it just Stuck to thin air in the rest of the room. then I also have a table that is round that I have to do the same thing with plates but because it is round i have to have it not go past a certain point on the table. Then lastly I have a faucet that needs to turn "on" when I drag down and turn "off" when I drag up.

When turning on the faucet i want to be able to "turn" the faucet on. I don't want to just change the picture from horizontal to vertical. I want to have it change the angle of the image as i drag up and down.

So far I have my layout then I realized I have no idea how to move things with touch. How do I Capture a touch event and how do I translate that to movement of a image. And once I am able to move the "magnets" how do I keep them from being moved off the fridge. Ultimately I would like if once the magnet was off the fridge it would drop to the floor but, baby steps.

Any ideas would be great on how o do this. Thanks in advance for any help you can give me.
 
Last edited:

cammel8

Member
Licensed User
Longtime User
Use the Floating Window class.
If you don't want the title bar above the window, hide it with EnableTitleBar(False).
To avoid the windows to go offscreen, set StillVisible to the window size.

ok am going to go read up on that and try it out thanx
 
Upvote 0

cammel8

Member
Licensed User
Longtime User
Ok so far i have gotten everything working kinda the way i want. Thank you for your help. It came out pretty good. I have another problem but i opened a new thread on it because it is kinda related but not.
 
Last edited:
Upvote 0
Top