How to: Use Squid in your Game

The first thing you need is a Desktop

using Squid;

public class GameGui: Desktop { }

And a simple Game class

using Squid;

public class Game
{
   public GameGui GUI;

   public Game()
   {
      // assign your engine specific renderer
      // lets use XNA as an example
      GuiHost.Renderer = new RendererXNA();
      
      // create a gui desktop
      GUI = new GameGui();
   }
}

The Desktop needs to be updated every frame.
Lets also span it across the whole screen

public class Game
{
   [..]

   void Update()
   {
     // "Engine" stands for user defined code
     GUI.Size = new Point(Engine.ViewportWidth, Engine.ViewportHeight);
     GUI.Update();
   }
}

Some input signals would be nice

public class Game
{
   [..]

   void Update()
   {     
      // "Engine" stands for user defined code
      KeyData[] keys = Engine.GetKeys();
      bool[] buttons = Engine.GetMouseButtons();
      int mouse_x = Engine.MouseX;
      int mouse_y = Engine.MouseY;
      int wheel = Engine.MouseWheel;
      float time = Engine.ElapsedMilliseconds;

      GuiHost.SetMouse(mouse_x, mouse_y, wheel);
      GuiHost.SetButtons(buttons);
      GuiHost.SetKeyboard(keys);
      GuiHost.TimeElapsed = time;      

      GUI.Size = new Point(Engine.ViewportWidth, Engine.ViewportHeight);
      GUI.Update();
   }
}

That looks great, lets draw it

public class Game
{
   [..]

   void Draw()
   {
      GUI.Draw();
   }
}