public void DrawUserPrimitiveOn(UserPrimitive uPrim, Animation anim, Vector2 pos, float renderAngle, Vector2 scale, Color color, byte alpha) { if (uPrim == null || anim == null) { return; } uPrim.Draw(anim, Engine.Time * anim.Speed, Matrix.CreateRotationZ(renderAngle) * Matrix.CreateScale(new Vector3(scale, 1f)) * Matrix.CreateTranslation(new Vector3(pos, 0f)), alpha); }
public virtual void DrawPrimitive() { if (Deleted) { return; } Graphics.GraphicsDevice.BlendState = BlendState; if (UserPrimitive == null) { if (!Precise) { Animation?.DrawPrimitive(ScaleRotation * Matrix.CreateTranslation(Position.X, Position.Y, 0f), Alpha, AnimationFrame); } else { Animation?.DrawPrimitive(ScaleRotation * Matrix.CreateTranslation((float)Math.Round(Position.X), (float)Math.Round(Position.Y), 0f), Alpha, AnimationFrame); } } else { UserPrimitive.Draw(Animation, AnimationFrame, ScaleRotation * Matrix.CreateTranslation(Position.X, Position.Y, 0f), Alpha); } }