Questions about image cropping and image loading

QuadBackgroundComponent doesn’t easily let you reset texture coordinates on the created quad. I’ve had this on my to-do list for a long time.

However, the quickest way to achieve what you want is probably to fork QuadBackgroundComponent for yourself and add some additional texture coordinates. Add a couple Vector2f fields for uv1 and uv2 and then add the appropriate code in refreshBackground() to set the texture coordinates.

Many of these classes are due for a refactoring to make them easier to extend and add behavior like this. I just haven’t gotten to it yet and code contributions tend to come from other directions.

3 Likes