Hi all,
I have a Sprite3D of 20x32. I apply a texture of 32x32px (power of 2) and it is stretched to fit the sprite width.
How do I avoid that? I want the texture to be cropped if it’s bigger than the sprite.
Crop texture in Sprite3D?Software: Away3D 4.x |
||
Hector, Sr. Member
Posted: 28 June 2012 07:30 PM Total Posts: 137 |
||
Richard Olsson, Administrator
Posted: 29 June 2012 08:40 AM Total Posts: 1192 [ # 1 ] Either you modify the UV coordinates of the sprite, for example using a UV transform matrix, or you just make sure that your images always fills out the full 32x32 bitmap. If I were you, I would just scale up the image (non-uniformly is fine) to match the 32x32 bitmap. Just use a matrix and draw() it while scaling it up. Once it’s applied to a sprite that is 20x32, it will be scaled down again on the X axis and the visual result will be identical to the original bitmap. |
||
|
||
|