如何从 TextureAtlas 创建贴花
How to create a Decal from a TextureAtlas
我得到了一个 TextureAtlas
的瓷砖。从 TextureAtlas
我想创建 Decals
并沿 Z 轴定位它们。
我找不到任何 API 从 TextureAtlas
创建 Decals
。
(我可以从 TextureAtlas
创建一个 Sprite
但 Sprite 没有 Z 分量所以我不能使用 Sprite.setPosition
沿 z 轴放置它).
如何从我的 TextureAtlas
创建 Decals
?
libgdx 中实际上有一个贴花 class,要创建贴花,您需要给它一个纹理区域。
示例:
从图集获取纹理区域:
atlas.findregion("name of your region") ;
我得到了一个 TextureAtlas
的瓷砖。从 TextureAtlas
我想创建 Decals
并沿 Z 轴定位它们。
我找不到任何 API 从 TextureAtlas
创建 Decals
。
(我可以从 TextureAtlas
创建一个 Sprite
但 Sprite 没有 Z 分量所以我不能使用 Sprite.setPosition
沿 z 轴放置它).
如何从我的 TextureAtlas
创建 Decals
?
libgdx 中实际上有一个贴花 class,要创建贴花,您需要给它一个纹理区域。
示例:
从图集获取纹理区域:
atlas.findregion("name of your region") ;