本文整理汇总了C#中Transform.GetAngle方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.GetAngle方法的具体用法?C# Transform.GetAngle怎么用?C# Transform.GetAngle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform.GetAngle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawTransform
public override void DrawTransform(ref Transform xf)
{
var drawSize = new Vector2(4, 4);
spriteBatch.FillRectangle(Level.ConvertFromBox2D(xf.Position) - drawSize / 2, drawSize, new Color(1.0f, 1.0f, 0.0f), xf.GetAngle());
}
示例2: DrawSprite
public void DrawSprite(Transform transform, float width, float height, string spriteName)
{
Texture2D texture = mTextures[spriteName];
Vector2 position = new Vector2(transform.Position.X, -transform.Position.Y);
position -= mCamera.mLowerView;
position *= mCamera.mZoom;
position.Y += mCamera.mPosition.Y * 2;
float rotation = -transform.GetAngle();
float sc = mCamera.mZoom / 6;
Vector2 scale = new Vector2(sc, sc);
float defaultBoxWidth = 6;
float defaultBoxHeight = 3;
scale.X *= width / defaultBoxWidth;
scale.Y *= height / defaultBoxHeight;
Vector2 origin = new Vector2(width / 2, height / 2) * mCamera.mZoom / scale;
mSpriteBatch.Draw(texture, position, null, Color.White, rotation, origin, scale, SpriteEffects.None, 0);
}