internal static void drawLine(Vector2 point1, Vector2 point2, Color color, CoordinateTypeEnum coordType) { if (s_blankTexture == null) { initialize(); } Vector2 center = point1; center.X += point2.X; center.Y += point2.Y; center.X /= 2.0f; center.Y /= 2.0f; Vector2 rotation = point2 - point1; DrawCommand drawer = DrawBuffer.getInstance().DrawCommands.pushGet(); drawer.Texture = s_blankTexture; drawer.ImageIndex = 0; drawer.Direction = rotation; drawer.CoordinateType = coordType; drawer.UseDestination = true; drawer.Destination = new Rectangle((int)point1.X, (int)point1.Y, (int)rotation.Length(), 1); drawer.Depth = LINE_DEPTH; drawer.Centered = false; drawer.Color = color; }
/// <summary> /// Draws a string to the screen with the specified options /// </summary> /// <param name="text">The text you want to draw</param> /// <param name="pos">The position to start drawing the top-left corner of the text</param> /// <param name="color">The color of the drawn text</param> internal void drawString(string text, Vector2 pos, Color color, CoordinateTypeEnum coordType) { FontStack stack = DrawBuffer.getInstance().FontDrawCommands; FontDrawCommand fd = stack.pushGet(); fd.set(m_font, text, pos, color, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 1.0f); fd.CoordinateType = coordType; }
/* * td.Texture = sprites_; td.ImageIndex = currentFrame_; td.Position = position_; td.Dest = false; td.CoordinateType = CoordinateTypeEnum.RELATIVE; td.Depth = depth_; td.Centered = true; td.Color = Color.White; td.Effects = SpriteEffects.None; td.Direction = rotation_; td.Scale = 1.0f; */ internal void set(GameTexture texture, int imageIndex, Vector2 position, CoordinateTypeEnum coordType, float depth, bool centered, Color color, float rotation, float scale) { Texture = texture; Position = position; Dest = false; ImageIndex = imageIndex; CoordinateType = coordType; Depth = depth; Centered = centered; Effects = SpriteEffects.None; Color = color; Rotation = rotation; Scale = scale; }
internal void set(GameTexture texture, int imageIndex, Rectangle destination, CoordinateTypeEnum coordType, float depth, bool centered, Color color, Vector2 direction, float scale) { Texture = texture; Destination = destination; Dest = true; ImageIndex = imageIndex; CoordinateType = coordType; Depth = depth; Centered = centered; Effects = SpriteEffects.None; Color = color; Direction = direction; Scale = scale; }
internal void clear() { SpriteFont = null; Text = ""; Position = Vector2.Zero; CoordinateType = CoordinateTypeEnum.ABSOLUTE; Color = Color.White; Rotation = 0.0f; Origin = Vector2.Zero; Scale = 1.0f; Effects = SpriteEffects.None; Depth = 0.0f; }