Exemplo n.º 1
0
        public static void Line(SpriteBatch spriteBatch, Texture2D texture, Vector2 origin, Vector2 target, float thickness, Color tint, float depth)
        {
            float   angle      = Utility.PointToPointAngle(origin, target);
            Vector2 renderLine = new Vector2(GameBase.ScreenScale(Vector2.Distance(origin, target)), Math.Max(GameBase.ScreenScale(thickness), 1.0f));

            spriteBatch.Draw(texture, GameBase.ScreenPosition(origin), null, tint, angle, new Vector2(0.0f, (thickness * texture.Height) / 2.0f), renderLine, SpriteEffects.None, depth);
        }
Exemplo n.º 2
0
        private static void DrawText(string text, SpriteBatch spriteBatch, SpriteFont font, Vector2 position, Color color, Vector2 origin,
                                     float scale, float depth)
        {
            spriteBatch.DrawString(font, text, GameBase.ScreenPosition(position + (_padding * scale * Platform_Scale_Modifier)), color, 0.0f, origin,
                                   GameBase.ScreenScale(scale * Platform_Scale_Modifier), SpriteEffects.None, depth);

            CalculateLastTextArea(text, font, position + (_padding * scale * Platform_Scale_Modifier), origin, scale);
        }