Jump to content
Search Community

ImageLoader ScaleMode

mrEmpty test
Moderator Tag

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 :)

Link to comment
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

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