Beispiel #1
0
 public void ScrollEditor(Point NewPosition)
 {
     hScrollBar.Value = NewPosition.X * 16;
     vScrollBar.Value = NewPosition.Y * 16;
     UpdateScrollbars();
     DrawingArea.Invalidate();
 }
Beispiel #2
0
 public ObjectPickerControl()
 {
     InitializeComponent();
     vScrollBar.Visible = true;
     SelectedObject     = 0;
     UpdateScrollbars();
     DrawingArea.Invalidate();
 }
Beispiel #3
0
 public void ScrollEditorPixel(Point NewPosition)
 {
     ViewablePixels.Location = NewPosition;
     hScrollBar.Value        = NewPosition.X;
     vScrollBar.Value        = NewPosition.Y;
     UpdateScrollbars();
     DrawingArea.Invalidate();
 }
Beispiel #4
0
 public void DrawCircle(string value, bool penIsActive)
 {
     for (int i = 0; i < 18; i++)
     {
         MoveForward(value, penIsActive);
         Angle += 20f;
     }
     DrawingArea.Invalidate();
 }
Beispiel #5
0
 public void DrawTriangle(string value, bool penIsActive)
 {
     Angle -= 60f;
     for (int i = 0; i < 3; i++)
     {
         Angle += 120f;
         MoveForward(value, penIsActive);
     }
     DrawingArea.Invalidate();
     Angle += 60f;
 }
Beispiel #6
0
 public void ReRenderAll(int Tileset)
 {
     for (int ObjIdx = 0; ObjIdx < 256; ObjIdx++)
     {
         try
         {
             TilesetObjects[Tileset][ObjIdx].UpdateObjCache();
         }
         catch (Exception) { }
     }
     DrawingArea.Invalidate();
 }
Beispiel #7
0
 public void Initialise(NSMBGraphics GFX, NSMBLevel Level, LevelEditor editor)
 {
     this.GFX           = GFX;
     this.Level         = Level;
     this.editor        = editor;
     Ready              = true;
     hScrollBar.Visible = true;
     vScrollBar.Visible = true;
     ViewablePixels     = new Rectangle();
     ViewableBlocks     = new Rectangle();
     UpdateScrollbars();
     remakeTileCache();
     DrawingArea.Invalidate();
 }
Beispiel #8
0
        public void SetEditionMode(EditionMode nm)
        {
            if (nm == mode)
            {
                return;
            }

            mode = nm;
            if (mode != null)
            {
                mode.Refresh();
            }

            DrawingArea.Invalidate();
        }
Beispiel #9
0
        private void DrawingArea_MouseDown(object sender, MouseEventArgs e)
        {
            if (visibleNodeList != null)
            {
                if (e.Button == System.Windows.Forms.MouseButtons.Middle || e.Button == MouseButtons.Left && Control.ModifierKeys == Keys.Alt)
                {
                    scrollingDragStartX = e.X;
                    scrollingDragStartY = e.Y;
                    scrollingDrag       = true;
                }

                if (e.Button == MouseButtons.Left)
                {
                    dragStartX = e.X;
                    dragStartY = e.Y;
                    drag       = true;

                    nodeSelected = false;

                    int nodeX = e.X + ViewablePixels.X - areaWidth / 2;
                    int nodeY = e.Y + ViewablePixels.Y - areaHeight / 2;

                    foreach (visibleNode n in visibleNodeList)
                    {
                        if ((nodeX - nodeImg.Size.Width / 2 <= n.posX && nodeX + nodeImg.Size.Height / 2 >= n.posX) &&
                            (nodeY - nodeImg.Size.Height / 2 <= n.posY && nodeY + nodeImg.Size.Height / 2 >= n.posY))
                        {
                            selectedNode = visibleNodeList.IndexOf(n);
                            nodeSelected = true;
                        }
                    }

                    ne.nodeChanged(selectedNode, nodeSelected);
                    DrawingArea.Invalidate();
                }
            }
            this.Focus();
        }
Beispiel #10
0
 public void repaint()
 {
     DrawingArea.Invalidate();
 }
Beispiel #11
0
 private void vScrollBar_ValueChanged(object sender, EventArgs e)
 {
     UpdateScrollbars();
     DrawingArea.Invalidate();
 }
Beispiel #12
0
 private void LevelEditorControl_Resize(object sender, EventArgs e)
 {
     UpdateScrollbars();
     DrawingArea.Invalidate();
 }
Beispiel #13
0
 private void Editor2D_SizeChanged(object sender, EventArgs e)
 {
     DrawingArea.Invalidate();
 }
Beispiel #14
0
 public void redraw()
 {
     DrawingArea.Invalidate();
 }