libGDX:使用PolygonRegion + Animation

时间:2015-06-01 13:31:34

标签: animation libgdx textures rendering polygon

libGDX中的

: 我目前正在使用动画来检索我的可渲染内容。 Animation.getKeyFrame()返回TextureRegion。到目前为止,我一直在游戏中使用盒子。 但是,我想使用PolygonRegion。据我了解,这意味着每次getKeyFrame()时我都必须创建一个新的PolygonRegion。有没有从动画中获取PolygonRegion的便宜方法。或者它足够便宜,不会造成任何渲染问题。

//per render()
textureRegion = animation.getKeyFrame(stateTime, true);
PolygonRegion polygonRegion = new PolygonRegion(textureRegion, regionVertices, new short[] {
            0, 1, 2,
            0, 2, 3
        });

0 个答案:

没有答案