Jump to content

Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  

ImageLoader ScaleMode

Recommended Posts



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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.