Could someone clearly explain the difference between →
ScaleMode.StretchToFill
ScaleMode.ScaleAndCrop
ScaleMode.ScaleToFit
←
I’ve read the API but I still could not understand.
What happens when I use each one?
Could someone clearly explain the difference between →
ScaleMode.StretchToFill
ScaleMode.ScaleAndCrop
ScaleMode.ScaleToFit
←
I’ve read the API but I still could not understand.
What happens when I use each one?
The trick is, think about a 1 inch square texture. How can you put it in a 2 by 3 inch area? It will never fit 100% properly, but there are a few ways you could fake it. That’s what the scaleMode options are for – tell it which way to sort of cram a texture into the wrong size. Options:
StretchToFill - It just stretches the texture as much as it needs to to fit the rectangle passed.
ScaleAndCrop - Makes the texture fill the complete rectangle but still tries to maintain the aspect ratio, if the aspect ratio causes anything to go over the rectangle it is just cropped
ScaleToFit - Dose not seem to change the texture, no matter what I do. It just keeps the original aspect ratio.