示例#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));
        }
示例#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;
			}
		}
示例#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;
			}
		}
示例#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);
            }
        }
示例#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);
            }
        }