首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >旋转Atlas区域Libgdx

旋转Atlas区域Libgdx
EN

Stack Overflow用户
提问于 2015-09-30 15:53:24
回答 1查看 692关注 0票数 1
代码语言:javascript
复制
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):一个指向右边的箭头.

但我找不到旋转它的方法!我怎么能做到呢?因为我想让它倒下。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-09-30 16:24:50

虽然可以旋转雪碧图像,但不能旋转区域。

代码语言:javascript
复制
    //sprite:
    public void rotate(float degrees)

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

与其旋转区域本身,您还可以“告诉”SpriteBatch将其旋转绘制出来:

代码语言:javascript
复制
    batch.draw(region, x, y, originX, originY, width, height, scaleX, scaleY, rotation);
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32870559

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档