Esempio n. 1
0
        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));
        }
Esempio n. 2
0
		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;
			}
		}
Esempio n. 3
0
		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;
			}
		}
Esempio n. 4
0
        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);
            }
        }
Esempio n. 5
0
        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);
            }
        }