private PointF GetCoordinates(IBlitter g, MessagePosition position, string message) { var size = g.MeasureString(message, MessageFont); float x = position.Anchor.IsLeft() ? position.X : g.ClipBounds.Width - position.X - size.Width; float y = position.Anchor.IsTop() ? position.Y : g.ClipBounds.Height - position.Y - size.Height; return(new PointF(x, y)); }
private float GetY(IBlitter g, int y, int anchor, string message) { var size = g.MeasureString(message, MessageFont); switch (anchor) { default: case 0: //Top Left case 1: //Top Right return y; case 2: //Bottom Left case 3: //Bottom Right return g.ClipBounds.Height - y - size.Height; } }
private float GetX(IBlitter g, int x, int anchor, string message) { var size = g.MeasureString(message, MessageFont); switch (anchor) { default: case 0: //Top Left case 2: //Bottom Left return x; case 1: //Top Right case 3: //Bottom Right return g.ClipBounds.Width - x - size.Width; } }
private float GetY(IBlitter g, int y, int anchor, string message) { var size = g.MeasureString(message, MessageFont); switch (anchor) { default: case 0: //Top Left case 1: //Top Right return(y); case 2: //Bottom Left case 3: //Bottom Right return(g.ClipBounds.Height - y - size.Height); } }
private float GetX(IBlitter g, int x, int anchor, string message) { var size = g.MeasureString(message, MessageFont); switch (anchor) { default: case 0: //Top Left case 2: //Bottom Left return(x); case 1: //Top Right case 3: //Bottom Right return(g.ClipBounds.Width - x - size.Width); } }