Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在玩弄火焰游戏引擎,发现很难翻转精灵。大多数游戏引擎/库允许您通过将 x 比例乘以 -1 来做到这一点。但是,这不适用于 spritesheet/spriteanimation 类的大小变量。什么被认为是在颤动火焰中翻转精灵的正确方法?
在任何扩展的组件PositionComponent(您列出的所有组件都可以)上,您只需设置renderFlipX = true或renderFlipY = true在组件上,它将呈现翻转。
PositionComponent
renderFlipX = true
renderFlipY = true
如果您想在纯精灵上执行此操作,这似乎不是您想要做的,但无论如何我会在这里提到它,您必须render在调用之前覆盖该方法并翻转画布super,然后再将其恢复。
render
super