Beispiel #1
0
 void EventBtn_MouseDown(object sender, MouseEventArgs e)
 {
     if (EventUp != null)
     {
         EventUp(this);
     }
     switch (e.Button)
     {
     case MouseButtons.Left:
         if (fix == false)
         {
             if (e.X < 5)
             {
                 db = DragBound.Left;
             }
             else if (e.X > Width - 5)
             {
                 db = DragBound.Right;
             }
             else
             {
                 db = DragBound.None;
             }
             widthOld    = Width;
             xOld        = Location.X;
             Cursor.Clip = new Rectangle(Parent.PointToScreen(Parent.Location), Parent.Size);
         }
         break;
     }
 }
Beispiel #2
0
    // Need to do last time
    public void SetDragColor(DragBound dragBound, FloorColor color)
    {
//		if (color == FloorColor.Edit)
//			ClearDragColor ();
        dragBound.SortBound();
        float minX = dragBound.bound [0].x, maxX = dragBound.bound [1].x;
        float minY = dragBound.bound [0].y, maxY = dragBound.bound [1].y;

        for (; minX <= maxX; ++minX)
        {
            for (int y = Mathf.RoundToInt(minY); y <= maxY; ++y)
            {
                int x = Mathf.RoundToInt(minX);
                floorBlocks.GetItem(x, y).floorColor = color;
            }
        }
    }