public static void Init() { ViewPosition = new Vector3(View.Player.Position); Cursor = EntManager.Create<ent_cursor>(); Cursor.Spawn(); Cursor.SetPos(new Vector3(0, 0, 0)); Input.LockMouse = false; //Cursor.Scale = Vector3.One * 0.25f; //Slap some text on the screen CurrentModeText = new GUI.Text("debug", "Mode: " + CurrentMode.ToString()); CurrentModeText.SetPos(Utilities.engine.Width - 200, Utilities.engine.Height - CurrentModeText.GetTextHeight() ); GUI.GUIManager.PostDrawHUD += new GUI.GUIManager.OnDrawHUD(GUIManager_PostDrawHUD); Utilities.engine.Mouse.ButtonDown += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonDown); Utilities.engine.Mouse.ButtonUp += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonUp); Utilities.engine.Keyboard.KeyDown += new EventHandler<KeyboardKeyEventArgs>(Keyboard_KeyDown); View.CalcView += new Action(View_CalcView); //Create our GUI stuff, if neccessary if (TopControl == null) { TopControl = GUIManager.Create<Toolbar>(); TopControl.SetWidth(Utilities.engine.Width); ContextMenu dd = TopControl.AddButtonDropDown("File"); dd.AddButton("Load"); dd.AddButton("Save").SetEnabled(false); dd.AddButton("Exit").OnButtonPress += new Button.OnButtonPressDel(exit_OnButtonPress); TopControl.AddButton("Edit"); Button help = TopControl.AddButton("Help..."); help.OnButtonPress += new Button.OnButtonPressDel(help_OnButtonPress); Button tests = TopControl.AddButton("Panel Tests"); tests.OnButtonPress += new Button.OnButtonPressDel(tests_OnButtonPress); } TopControl.IsVisible = true; }
public Label() { this.Text = ""; DrawText = new Text("default", this.Text); }
public void SetFont(string font) { this.DrawText = new Text(font, this.Text); }
public override void Init() { this.ShouldDraw = false; //Don't draw the player entity itself BalanceLevel.OnStateChange += new Action<BalanceLevel.LevelState>(BalanceLevel_OnStateChange); GUIManager.PostDrawHUD += new GUIManager.OnDrawHUD(GUIManager_PostDrawHUD); StateText = new Text("debug", "WAITING"); StateText.SetColor(0, 0, 0); }