I’ve finished the first iteration of CraftworkGUI for MonoGame. All of the features I planned to implement in one month are working. Does that mean it’s completely finished? Not even close, but it should be ready for use in real game, so that’s what I’m going to do next. Make a game with it.
The code is open source on github and the task list is available on Trello. If you try it out, I’d love to know about it. That’s why it’s open source after all.
There is a quick demo in source control showing how to setup a simple screen and use most of the controls. Here’s a snippet of code showing how the above screenshot is composed.
var screen = new Screen(800, 480); var dockLayout = new DockLayout(); var gridLayout = new GridLayout(1, 2); var leftStackLayout = new StackLayout() { Orientation = Orientation.Horizontal, VerticalAlignment = VerticalAlignment.Bottom }; var rightStackLaout = new StackLayout() { Orientation = Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Right }; var playButton = CreateButton(playRegion); var cogButton = CreateButton(cogRegion); var upButton = CreateButton(upRegion); var facebookButton = new Button(new VisualStyle(twitterRegion)) { HoverStyle = new VisualStyle(twitterRegion) { Rotation = 0.05f } }; var twitterButton = new Button(new VisualStyle(facebookRegion)) { HoverStyle = new VisualStyle(facebookRegion) { Rotation = 0.05f } }; var titleImage = new Image(new VisualStyle(titleRegion)) { Margin = new Margin(0, 50, 0, 0) }; _timeLabel = new Label() { Height = 32 }; screen.Background = new VisualStyle(backgroundRegion); dockLayout.Items.Add(new DockItem(playButton, DockStyle.Fill)); dockLayout.Items.Add(new DockItem(gridLayout, DockStyle.Bottom)); dockLayout.Items.Add(new DockItem(_timeLabel, DockStyle.Top)); dockLayout.Items.Add(new DockItem(titleImage, DockStyle.Top)); leftStackLayout.Items.Add(cogButton); leftStackLayout.Items.Add(upButton); rightStackLaout.Items.Add(facebookButton); rightStackLaout.Items.Add(twitterButton); gridLayout.Items.Add(new GridItem(leftStackLayout, 0, 0)); gridLayout.Items.Add(new GridItem(rightStackLaout, 0, 1)); screen.Items.Add(dockLayout); _gui.Screen = screen;

