[英]Rotate Atlas Region Libgdx
protected TextureAtlas atlas = Assets.manager.get(Constants.ATLAS_PATH, TextureAtlas.class);
AtlasRegion region = interfaceAtlas.findRegion("arrow");
I've load an image like this ( http://marinedealerconference.com/wp-content/uploads/2015/07/right.png ): an arrow that points right... 我加载了这样的图像( http://marinedealerconference.com/wp-content/uploads/2015/07/right.png ):一个指向右边的箭头......
But I can't find a way to rotate it! 但我找不到旋转它的方法! How can I?
我怎样才能? Because I want it goes down.
因为我希望它失败了。
you cannot rotate region although you can rotate Sprite or Image 尽管您可以旋转Sprite或Image,但您无法旋转区域
//sprite:
public void rotate(float degrees)
//image - remember to set origin to the center here!
public void rotateBy(float amountInDegrees)
Instead of rotating the region itself you can "tell" SpriteBatch to draw it rotated: 您可以“告诉”SpriteBatch将其旋转绘制,而不是旋转区域本身:
batch.draw(region, x, y, originX, originY, width, height, scaleX, scaleY, rotation);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.