Example #1
0
 private void BStopGame_Click(object sender, EventArgs e)
 {
     EditGraph.Restore();
     BRunGame.Enabled  = true;
     BStopGame.Enabled = false;
     EditGraph.Running = false;
 }
Example #2
0
        private void Visual_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                MapIn = true;
            }
            if (e.Button == MouseButtons.Left)
            {
                MouseIn = true;
            }

            if (MoveOn)
            {
                EditMode = 1;
            }
            if (RotateOn)
            {
                EditMode = 2;
            }
            if (ScaleOn)
            {
                EditMode = 3;
            }

            var n = EditGraph.Pick(MX, MY);

            EditNode = n;
            PropGrid.SelectedObject = n;
        }
Example #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     EditGraph.Copy();
     BRunGame.Enabled  = false;
     BStopGame.Enabled = true;
     EditGraph.Running = true;
 }
Example #4
0
        private void CineGraphNewSprite(object sender, EventArgs e)
        {
            EditNode = new GraphNode();
            TreeNode nt = new TreeNode();

            nt.Text = "New Sprite";
            GraphNode nn = new GraphNode();

            nn.Name = "New Sprite";
            NodeMap.Add(nt, nn);
            SceneTree.Nodes[0].Nodes.Add(nt);
            EditGraph.Add(nn);

            PropGrid.SelectedObject = nn;
        }
Example #5
0
        private void UpdateTick_Tick(object sender, EventArgs e)
        {
            EditGraph.X = EditGraph.X + mxi / EditGraph.Z;
            EditGraph.Y = EditGraph.Y + myi / EditGraph.Z;
            EditGraph.Z = EditGraph.Z + (mzi * 0.3f) / EditGraph.Z;
            if (EditGraph.Z < 0.1f)
            {
                EditGraph.Z = 0.1f;
            }
            if (EditGraph.Z > 5.0f)
            {
                EditGraph.Z = 5.0f;
            }

            mxi = mxi * mdrag;
            myi = myi * mdrag;
            mzi = mzi * mdrag;
            if (render)
            {
                return;
            }

            Visual.Invalidate();
            EditGraph.Update();
            if (ShowIcons)
            {
                if (IconsAlpha < 1.0f)
                {
                    IconsAlpha = IconsAlpha + 0.04f;
                }
                else
                {
                    IconsAlpha = 1.0f;
                }
            }
            else
            {
                if (IconsAlpha > 0.0f)
                {
                    IconsAlpha = IconsAlpha - 0.08f;
                }
                else
                {
                    IconsAlpha = 0.0f;
                }
            }
        }
Example #6
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var lp = EditGraph.GetPoint(MX, MY);
            var nl = new GraphLight();

            nl.X = lp.X;
            nl.Y = lp.Y;
            nl.Z = 1.0f;
            if (LightIcon == null)
            {
                Environment.Exit(1);
            }
            nl.ImgFrame = LightIcon;
            nl.W        = 32;
            nl.H        = 32;
            EditGraph.Add(nl, true);
            SyncUI();
        }
Example #7
0
 private void SceneTree_DragDrop(object sender, DragEventArgs e)
 {
     UpdateTick.Enabled = false;
     foreach (var f in dragFiles)
     {
         var sn = new GraphSprite(f);
         sn.W    = DefW;
         sn.H    = DefH;
         sn.Name = new System.IO.FileInfo(f).Name;
         if (SceneTree.SelectedNode != null)
         {
             var gn = NodeMap[SceneTree.SelectedNode];
             gn.Nodes.Add((GraphNode)sn);
             sn.Root = gn;
         }
         else
         {
             EditGraph.Add(sn);
         }
     }
     SyncUI();
     UpdateTick.Enabled = true;
 }