繁体   English   中英

旋转阿特拉斯地区Libgdx

[英]Rotate Atlas Region Libgdx

protected TextureAtlas atlas = Assets.manager.get(Constants.ATLAS_PATH, TextureAtlas.class);

AtlasRegion region = interfaceAtlas.findRegion("arrow");

我加载了这样的图像( http://marinedealerconference.com/wp-content/uploads/2015/07/right.png ):一个指向右边的箭头......

但我找不到旋转它的方法! 我怎样才能? 因为我希望它失败了。

尽管您可以旋转SpriteImage,但您无法旋转区域

    //sprite:
    public void rotate(float degrees)

    //image - remember to set origin to the center here!
    public void rotateBy(float amountInDegrees)

您可以“告诉”SpriteBatch将其旋转绘制,而不是旋转区域本身:

    batch.draw(region, x, y, originX, originY, width, height, scaleX, scaleY, rotation);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM