View Full Version : Scale vs. height/width
girardjf
01-22-2003, 10:23 AM
Laszlotians,
I have noticed that there does not seem to be a "scale" attibute to the <view/> tag. I have also noticd that a child view of a class or another view may have it's height and width assigned via a percentage.
Is there a uniform way to assign height and width to a view or collection of views, and then animate both properties via the same attribute?
Something like: scale="50%"
-jgirard
antun
01-22-2003, 11:29 AM
Yes, try:
<canvas>
<view name="bigview" width="100" height="this.width"
onclick="this.setAttribute( 'width', 200 );">
<simplelayout axis="x" />
<view bgcolor="red" width="50%" height="parent.height" />
<view bgcolor="blue" width="50%" height="parent.height" />
</view>
</canvas>
You can set the height of something to its own width.
-Antun
There are xscale and yscale attributes too
Let's say you want to keep something scaled when you set its width
<view width="100" yscale="this.xscale" />
This was a new feature in DR.
daxiang28
04-07-2005, 02:36 AM
hi there,
i have a feeling that i'm missing something really simple, but i was wondering how i can scale images in a view to match the size of the parent canvas containing it. i want to create a dynamic background gradient that scales with the browser. i produced a gradient in flash as a .swf and am able to see it as a resource in the laszlo flash. when i try to set height or width attributes to it in terms of percentages, it doesn't seem to work. does anybody have any thoughts?
ps. i'm running the 3.0b version of lps.
<canvas width="100%" height="100%" id="mingCanvas" debug="true">
<view resource="/library/images/ux/testGradient.swf" height="100%" width="100%" />
</canvas>
Thanks,
Steve
You need to tell the view you want it stretch to its size:
<canvas width="100%" height="100%" id="mingCanvas" debug="true">
<view resource="/library/images/ux/testGradient.swf" height="100%" width="100 stretches="both"/>
</canvas>
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.