我正在从GLSprite示例代码示例开始工作。 我想知道的是,我需要做些什么来让代码将我的纹理视为精灵表? 我迄今为止所做的唯一修改是创建一个256 x 256 png的16个较小的图像作为我的帧。 我从来没有使用精灵表。 谢谢你的帮助。
I am working from the GLSprite sample code example. What I want to know is what do I need to do to the code to have it treat my texture as a sprite-sheet? The only modification I have done so far is to create a 256 x 256 png of 16 smaller images to be my frames. I have never worked with sprite-sheets before. Thanks for your help.
最满意答案
您需要调整纹理坐标以映射所需的精灵。 纹理坐标通常被标准化(0到1)。 假设你有一个4x4的精灵网格,第一个精灵将会拥有......的纹理坐标。
0, 0 0, 0.25 0.25, 0.25 0.25, 0You need to adjust the texture coordinates to map the required sprite. Texture coordinates are normally normalised (0 to 1). Assuming you have a 4x4 grid of sprites, the first sprite would have texture coords of...
0, 0 0, 0.25 0.25, 0.25 0.25, 0更多推荐
发布评论