Ejemplo n.º 1
0
 public System.Drawing.Rectangle TranslatePoint(Point point)
 {
     return(new System.Drawing.Rectangle((int)Math.Ceiling((-Left + point.X) * Scale * TileSize),
                                         (int)Math.Ceiling((-Top + point.Y) * Scale * TileSize),
                                         (int)Math.Ceiling(RealTileSize),
                                         (int)Math.Ceiling(RealTileSize)));
 }
Ejemplo n.º 2
0
        public void Center(Point point)
        {
            var size = ToTileSize();
            int left;
            int top;

            if (point == null)
            {
                // center on middle of floor
                left = (size.Item1 / 2) - (Width / 2);
                top  = (size.Item2 / 2) - (Height / 2);
            }
            else
            {
                // center given point
                left = point.X - (size.Item1 / 2);
                top  = point.Y + (size.Item2 / 2);
            }
            Left = left;
            Top  = top;
        }
Ejemplo n.º 3
0
 public void Center(object sender, Point e)
 {
     Center(e);
 }
Ejemplo n.º 4
0
 public bool ContainsTile(Point point)
 {
     return(Math.Ceiling((-Left + point.X) * RealTileSize) <= Width &&
            Math.Ceiling((-Top + point.Y) * RealTileSize) <= Height);
 }