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.
我目前正在开发类似最终幻想的游戏,并且我正在研究从世界地图切换到战斗时的效果。我想要在旋转效果时放大,我想简单地为将传递给 SpriteBatch.Begin 的变换矩阵设置动画,但我的问题是当我旋转时,旋转原点是我整个场景的左上角并且它没有't“放大”居中。我看到您可以在 SpriteBatch.Draw 上指定一个旋转原点,但这会为每个精灵设置它,我想旋转整个场景。
您正在寻找的转换是这样的:
Matrix Transform = Matrix.CreateTranslation(-Position) * Matrix.CreateScale(scale) * Matrix.CreateRotationZ(angle) * Matrix.CreateTranslation(GraphisDevice.Viewport.Bounds.Center);