按顺时针旋转图片使用LibGDX [英] Rotate Image Clockwise using LibGDX

查看:186
本文介绍了按顺时针旋转图片使用LibGDX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何可以旋转图像顺时针使用LibGDX?我在找是当图像加载,假设一个明星,我需要从屏幕到屏幕年底的水平开始旋转,与星旋转,我怎么能做到这一点在libgdx?

How can we rotate a Image Clockwise using LibGDX? what i am looking is when a image is loaded,suppose a star, i need to rotate it from beginning of screen to end of the screen horizontally, with star rotating,how can i do that in libgdx?

推荐答案

在画的纹理与你的SpriteBatch,你可以使用的抽奖功能,包括旋转之一。这Javadoc开始所有的抽奖功能:<一href="http://libgdx.l33tlabs.org/docs/api/com/badlogic/gdx/graphics/g2d/SpriteBatch.html">SpriteBatch

When you draw the Texture with your SpriteBatch, you can use one of the draw functions that includes rotation. This javadoc has all the draw functions: SpriteBatch

您可以保留一个变量的位置和旋转,每次渲染,使其在移动时水平旋转增加位置的旋转和x分量。

You can keep a variable for position and rotation, and increase the rotation and x component of the position each time you render to make it rotate while moving horizontally.

这篇关于按顺时针旋转图片使用LibGDX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆