Sign in to follow this  
mrEmpty

ImageLoader ScaleMode

Recommended Posts

Hello.

 

With the scaleModes, if your container is square but your loaded images are not, is there a simple way to crop them? I have tried all the scaling modes and all behave as expected, so I'm guessing not. I was thinking of loading each image into a sprite with a mask before placing it on the stage to act as a cropping method, but wanted to ask before I committed the time.

 

Thanks :)

Share this post


Link to post
Share on other sites

Absolutely. Just set the scaleMode to "proportionalOutside" and set crop to true.

 

var l:ImageLoader = new ImageLoader("1.jpg", {scaleMode:"proportionalOutside", crop:true});

 

It's all in the ASDocs - have you seen those? That wasn't meant as a jab at all; I just want to make sure you know about them because they can be super helpful in understanding what's possible, what properties/methods are available, etc. http://greensock.com/as/docs/tween/_loadermax.html

Share this post


Link to post
Share on other sites

Jab away, I'm immune to it :-)

 

I have read them, they are very good. However, one thing they don't mention is if any Greensock class misbehaves, uninstall CS5.5 and go back to 5! So many problems just solved. :-)

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.