Jump to content
GreenSock

sandesh

AutoFitArea problem ?

Recommended Posts

Hi Jack,

 

I have racked my brains enough but can't simply get the solution.

I am using AutofitArea class and setting its calculateVisible property to true, still the masked area portion is not working as expected.

 

E.g: If you compile the attached files, the background along with the content should cover the whole stage, but its considering the width and height of the masked areas.

That's why you can see blank areas in the right and bottom sides of the player. Pls help. I dont know where i am going wrong.

 

Pls check this code in the as file. Rest ignore

 

_area = new AutoFitArea(this, 0, 0, 1280, 768)
_content = new Content
this.addChild(_content)
_area.attach(_content, ScaleMode.STRETCH, AlignMode.LEFT, AlignMode.TOP, false, 0, 999999999, 0, 999999999, true)

Link to comment
Share on other sites

In your resizeElements() method, you're resizing the _content instead of the _area.

 

For the record, LiquidArea automates this sort of thing in terms of adjusting the size of the area whenever the stage resizes. But LiquidArea is part of LiquidStage which is a Club GreenSock membership benefit, so if you're not in the club, it wouldn't do you any good :)

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.
×