• Advertisement
Sign in to follow this  

Using a whole image in a sprite?

This topic is 1785 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to create rectangular buttons for my GUI using sprites (I figure that this is the easiest way to display a textured rectangle on screen) but I have a little problem - the sprite drawing interface only lets me select an area of a texture to use as my sprite - there doesn't seem to be an option to compress a whole texture to the correct size so that it fits into an arbitrary rectangle. Does anyone know how I can make a sprite resize the texture so that it fits into my specified rectangle?

 

Thanks!

Share this post


Link to post
Share on other sites
Advertisement

I did see that, but I think it just uses the image in its native size rather than fitting it to the rectangle I specified. i.e. if the image is 100x200, it won't resize it to fit into my desired rectangle with dimensions of 50x100 for example. That's what I'm trying to do.

Share this post


Link to post
Share on other sites

Thanks, that seems to be the only way. I decided that it's probably a better idea to create my buttons as offscreen textures and then load them in as individual sprites rather than trying to force text on top of a blank sprite.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement