Jump to content
Search Community

LiquidArea center after reaching maximum width

bruno.swf test
Moderator Tag

Recommended Posts

Hello.

I'm having a problem with LiquidArea.

He has a maxWidth set, but I would like it to be centered on the screen after that width is reached.

 

The code I'm using is this:

var _ls:LiquidStage		= new LiquidStage(this.stage, 1000, 590, 1000, 590);
var _la_mat:LiquidArea 	= new LiquidArea(this, 50, 450, 900, 90, 0xff0000, 900, 90, 1200, 90, false);

_la_mat.pinCorners(_ls.BOTTOM_LEFT, _ls.BOTTOM_RIGHT, true);
_la_mat.preview = true;

 

Any solution?

 

Text by GoogleTranslate

Link to comment
Share on other sites

That's a pretty difficult thing to do actually unless you just set the maxWidth and maxHeight of the LiquidStage itself (and make sure your stage.align is set to CENTER). Otherwise, you could accomplish it by listening for the LiquidStage's RESIZE event and run your own function that centers the LiquidArea OR using pinCorners() with two DynamicPinPoints that have custom logic determining where the top left and bottom right corners would need to be whenever the stage resizes.

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.
×
×
  • Create New...