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))); }
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; }
public void Center(object sender, Point e) { Center(e); }
public bool ContainsTile(Point point) { return(Math.Ceiling((-Left + point.X) * RealTileSize) <= Width && Math.Ceiling((-Top + point.Y) * RealTileSize) <= Height); }