Interface Elements

One thing I’ve felt particularly dirty about while working on Slower Than Light is the amount of code replication I have.  I’m not talking about code I wrote; in order to get the interface to look right, I’m having to implement a control system that rides on top of .NET and replicates a fair amount of the functionality of the standard System.Windows.Form controls.  I have Text Boxes and Listboxes and Buttons and Labels and so on, and a carefully crafted series of rectangles and flags to handle redrawing them only when they need to be redraw, and so forth.  All of these things are done, arguably better than I could hope to do them, by the extant controls.  So what am I doing?

Part of it is that my earlier working with Mono, the cross-platform .NET implementation, sometimes gave me considerable grief with windowing.  I could count on having draw surfaces and control input work more or less how I wanted them to, but sometimes the controls would act differently on Linux than they would on Windows, which makes one-man support for a cross-platform product a nightmare.

The other part of it is that I could not control the art and appearance quite the way I wanted with the basic controls.  Being able to draw controls is one thing, but being able to rotate and move them when I need to without converting out of System.Drawing.Drawing2D and then back in is really nice.  I am quite sure when that art and UI design take the main stage in a couple months, I will be very grateful for the investment I’m making now.

Leave a Reply