I am working on an app that requires hidden objects on an image. As the app is run some of those objects need to be visible and sometimes not. If the image size of the main background image changes the placed objects are no longer in the correct place. I know there is a solution, I just don't know what that solution is!
Thanks
Tom
Objects placed on Image Move when size changed
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 10057
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Objects placed on Image Move when size changed
You can prevent the image from resizing by setting its lockLoc property to true.
If you want the image to resize, you can adjust the placement of the other objects by setting their location (or short, loc) property.
If you want the image to resize, you can adjust the placement of the other objects by setting their location (or short, loc) property.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Objects placed on Image Move when size changed
I think the issue is that the overlying controls are not scaling position as the image resizes. Tom, is this so?
If it is, grouping the lot will not help. You will have to calculate the change in the background image, and shift the controls accordingly. One issue here is that unless you also scale the rects of those controls, they will stay the same size, which may not be what you want.
Write back. (Bogs!)
Craig
If it is, grouping the lot will not help. You will have to calculate the change in the background image, and shift the controls accordingly. One issue here is that unless you also scale the rects of those controls, they will stay the same size, which may not be what you want.
Write back. (Bogs!)
Craig
Re: Objects placed on Image Move when size changed
Thanks, Craig,
I am pretty sure this is the issue. I think I can work it out now.
Tom
I am pretty sure this is the issue. I think I can work it out now.
Tom
Re: Objects placed on Image Move when size changed
Ah.
There are some threads about this very thing, though it may take some effort to find them via keywords.
Basically, pixel by pixel, since you know the change in the rect, and, say, the "old" and "new" topLeft, the math is straightforward. Or you can do the whole thing at once if you lock the screen and do one set of calculations. But "live" scaling is so much sexier.
Thanks for replying before Bogs had a chance to razz me.
Craig
There are some threads about this very thing, though it may take some effort to find them via keywords.
Basically, pixel by pixel, since you know the change in the rect, and, say, the "old" and "new" topLeft, the math is straightforward. Or you can do the whole thing at once if you lock the screen and do one set of calculations. But "live" scaling is so much sexier.
Thanks for replying before Bogs had a chance to razz me.
Craig