Friday, 10 December 2010

SceneEdit

They say that in the big games companies, the first thing they do is make the tools to make the game. I don't have as much manpower as EA, but then again, I'm not daft enough to think that single player games are dead, so maybe it evens out. The real decider is that having an editor app will mean lots more happy modders, than if people have to hand code in XML. Reason enough, methinks.

To code, then. Using Boo and Winforms. Lots of people seem to thing that coding for windows is horribly complicated, and nigh on impossible without an IDE like VS. I don't subscribe to that point of view.

import System
import System.Drawing
import System.Windows.Forms

class MainWin(Form):
        tree_panel as Panel
        scene_panel as Panel

        def constructor():
                InitializeComponent()

        def InitializeComponent():
                SuspendLayout()
                Text = "Clonemaster Scene Editor"
                Size = System.Drawing.Size(800,600)

                tree_panel = Panel()
                tree_panel.Size = Size(190,570)
                tree_panel.BorderStyle = BorderStyle.Fixed3D
                Controls.Add(tree_panel)

                ResumeLayout()

mw = MainWin()
Application.Run(mw)


That's just enough to put a bare window up and a side panel. I'm going to put the scene tree in a TreeView down the left hand side, and on the right have a panel for editing the information therein.

2 comments:

Unknown said...

*cough* coding for winforms in anything besides C and C++ is super easy. C# even has less code than your example.

Doc Clox said...

If you just consider the bit you see in studio after it's collapsed all the initialisation stuff, maybe.

For the whole program? I've done non-trivial amounts of coding in both languages and I'd be surprised if you could do it. Doubly so if it was still readable at the end.