OK! Sowrry for taking so long, I saw what you have done, and is somehow what I need, but my problem is actually with the "prop" value of height/width, since it seems to not work when the layer is type "container", I'll look later if I really need it to be container, which I think I do, since I need the image to always be inside a circle-shape, no matter the size or the shape of the image, always in a circle, so I use the bg-attributes of the container-type layer.Explore code from here: Link
Maybe this can help boost your learning curve ;)
Hmm Ok Klaus, I know, width and height should be always the same, but if I need it according to screen size, I can't just set "10%" to both of them, since one will scale with the height and the other with the width, and it'll change if it's landscape or portrait and so on, the circle will start changing and stop being a circle, or that's what happens to me at least :/.Hi,
using 'prop' for width or height can't work for container elements because container elements don't have an own 'original' size.
For a 'circle' width and height simply should be always the same.
Best regards,
Klaus
|
|
Source code |
1 |
<events onresize="calc(layer[circle].width, stagewidth * 0.1); copy(layer[circle].height, layer[circle].width);"/> |
Oky!, I've tried this (actually I've done it before too but somehow wasn't working xD) And it worked, but there's the other thing!...Hi,
okay, in this special case that can't be used,
but what's possible is using the onresize event and calculating and setting there the size, e.g.
Best regards,
Klaus
|
|
Source code |
1 |
if(stagewidth GT stageheight, calc(circles_size, stageheight * 0.1); , calc(circles_size, stagewidth * 0.2); ) set(layer[circle1].width, circles_size); set(layer[circle1].height, circles_size); set(layer[circle2].width, circles_size); set(layer[circle2].height, circles_size); |
|
|
Source code |
1 |
if(stagewidth GT stageheight, calc(layer[circle1].width, stageheight * 0.2); copy(layer[circle1].height, layer[circle1].width); calc(layer[circle2].width, stageheight * 0.2); copy(layer[circle2].height, layer[circle2].width); , calc(layer[circle1].width, stageheight * 0.1); copy(layer[circle1].height, layer[circle1].width); calc(layer[circle2].width, stageheight * 0.1); copy(layer[circle2].height, layer[circle2].width); ) |