Rotate Image Clockwise using LibGDX(使用 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 具有所有绘图功能: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 顺时针旋转图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 LibGDX 顺时针旋转图像


基础教程推荐
- 如何对 HashSet 进行排序? 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01