Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
bebber

LiquidArea Percentage width

Recommended Posts

I'm givin a try to LiquidArea, and i have a question...

do you think that is possible to create a layout using percentage width instead of px?

 

(i'm using baseUI, another layout library that offer something similar...)

Link to comment
Share on other sites

Sure, you can simply create your own PinPoint anywhere on the stage and use it to pin the top left or bottom right corner of your LiquidArea. For example, let's say you want your LiquidArea to fill 30% of the screen's width. If your original swf was built at 1000x600, you could do this:

 

var ls:LiquidStage = new LiquidStage(this.stage, 1000, 600)
var area:LiquidArea = new LiquidArea(this, 0, 0, 300, 600);
var customPin:PinPoint = new PinPoint(300, 0, this.stage);
area.pinCorners(ls.TOP_LEFT, customPin);

 

Since the PinPoint is positioned at 300 pixels (30% of the width) on the stage, it will always stay at that relative position when the stage is stretched. So if the stage is stretched to 2000 pixels (200%), that PinPoint's x coordinate will be 600. Since the LiquidArea's right corner is pinned with that pin, it'll always stay at 30% of the width of the screen.

 

Make sense?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×