在 sfml 中将精灵移至另一个精灵

发布于 2025-01-11 15:39:48 字数 67 浏览 2 评论 0原文

我只是想知道是否有一个解决方案可以让我的精灵在另一种意义上改变旋转并远离另一个精灵(它的位置位于平视显示器视图的中心)。

I just want to know if there is a solution to make my sprite change the rotation in the other sense and move away from another sprite (it position is in the center of the hud view).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷路的信 2025-01-18 15:39:48

由于您没有提供任何代码或上下文,我无法真正帮助您,只能旋转精灵,我猜使用 Sprite 类的旋转方法。

sf::Sprite sprite;
sprite.rotate(45.f); //To rotate a sprite by 45°

Since you do not provide any code or context I can't really help you but to rotate a sprite, use the rotate method of the Sprite class I guess.

sf::Sprite sprite;
sprite.rotate(45.f); //To rotate a sprite by 45°
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文