LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: wxwsk8er on January 11, 2015, 19:10:10

Title: Sprite Sheet Help
Post by: wxwsk8er on January 11, 2015, 19:10:10
[Removed]
Title: Re: Sprite Sheet Help
Post by: abcdef on January 12, 2015, 06:49:56
you will need to post some code where where you create the texture data and where you bind it, your code doesn't seem to relate to where the problem lies.
Title: Re: Sprite Sheet Help
Post by: bogieman987 on January 20, 2015, 01:59:00
What about setting the UV coordinates so that they only encompass the necessary part of the sprite sheet?

So since the sprite sheet is 16x16 blocks, a box is only a small 0.0625 height/width in terms of UV co-ordinates, not pixels.

With that, the top left square would have the following co-ordinates:
X - Y
Top Left: 0.0 - 1.0
Top Right: 0.0625 - 1.0
Bottom Left: 0.0 - 0.9375
Bottom Right: 0.0625 - 0.9375
I believe.