This project is read-only.

Question about TexturedElement:TextureCrop()

Aug 3, 2010 at 11:12 AM

I tried to use TexturedElement:TextureCrop(), thinking that it I could use it like a mask to only show part of a texture with the remaining areas being transparent.  I was either incorrect or I am using it wrong.  Instead, I am getting some strange behavior that I do not understand.  It seems to be doing some sort of alpha transparancy.  Could you explain for me what this function does?


Aug 10, 2010 at 6:29 PM
Edited Aug 10, 2010 at 6:30 PM


I'm sorry I didn't notice your question. I hope you haven't been waiting on an answer,

The texture crop is actually pretty simple. If your texture is 512x512 in size, and you set the crop rectangle to { x=32, y=32, width=400, height=400 } then the inner 400x400 pixels, starting at 32,32 will be displayed, instead of the full 512x512. So it'll display the pixels between 32,32 -> 432,432 instead of 0,0 -> 512,512.

Does that make sense? I realise it's totally lacking in docs.