ive been studying ticked off and i cant seem to figure out how to compute the custom properties for the imagese
cStackRatio and cImageRatio
anybody already done this or know a solution?
thanks in advance,
-Rye
ticked off, cStackRatio and cImageRatio Computation
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: ticked off, cStackRatio and cImageRatio Computation
Hi Rye,
I still have no idea what the "ticked off" example is, but this SOUNDS like this:
cStackRatio = stack width/stack height
cImageRatio = image width/image height
Correct?
Best
Klaus
I still have no idea what the "ticked off" example is, but this SOUNDS like this:
cStackRatio = stack width/stack height
cImageRatio = image width/image height
Correct?
Best
Klaus
Re: ticked off, cStackRatio and cImageRatio Computation
hi klaus,
thanks for responding, ticked off is the example in the livecode beginners course, it contains code located in the resources stack that
resizes images on resizeStack.
cStackRatio, cPrimaryDimension and cImageRatio are custom properties set for each image in the resources substack
i want to know how they were computed as the livecode example video does not say how they were computed.
thanks
thanks for responding, ticked off is the example in the livecode beginners course, it contains code located in the resources stack that
resizes images on resizeStack.
Code: Select all
on resizeImages
put the mainstack of this stack into tMain
put the width of stack tMain into tStackWidth
put the height of stack tMain into tStackHeight
repeat with x = 1 to the number of images of me
put the short name of image x of me into tImageName
put the cStackRatio of image tImageName of me into tStackRatio
put the cPrimaryDimension of image tImageName of me into tPrimaryDimension
put the cImageRatio of image tImageName of me into tImageRatio
if tPrimaryDimension is "width" then
set the width of image tImageName of me to (tStackWidth * tStackRatio)
set the height of image tImageName of me to (the width of image tImageName of me / tImageRatio)
else if tPrimaryDimension is "height" then
set the height of image tImageName of me to (tStackHeight * tStackRatio)
set the width of image tImageName of me to (the height of image tImageName of me * tImageRatio)
end if
end repeat
end resizeImages
cStackRatio, cPrimaryDimension and cImageRatio are custom properties set for each image in the resources substack
i want to know how they were computed as the livecode example video does not say how they were computed.
thanks
Re: ticked off, cStackRatio and cImageRatio Computation
Hi Rye,
these videos are only available to users who have been attending that course, so I can't watch them.
But did you try my suggestion? I bet my assumption is correct!
Best
Klaus
these videos are only available to users who have been attending that course, so I can't watch them.
But did you try my suggestion? I bet my assumption is correct!

Best
Klaus
Re: ticked off, cStackRatio and cImageRatio Computation
I think they were computed manually and then stored as properties for later use. It's tedious but you only need to do it once. For each object you figure out the ratio of its size compared to the screen size in your base layout in the IDE. Then the script uses that ratio to calculate the display size based on the size of the mobile device screen.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com