bool pressed = false; // Ensure clicks only register if we have released first #endregion Fields #region Constructors public DToggleButton(DGuiManager guiManager, float x, float y, string _text, int _width, int _height, Color _fillColor, Color _borderColor, Color _clickedFillColor, Color _clickedBorderColor) : this(guiManager, x, y, _text, _width, _height, _fillColor, _borderColor) { SetClickedColors(_clickedFillColor, _clickedBorderColor); }
public DMultiLineTextBox(DGuiManager guiManager, float x, float y, int width, int height, string text, Color fillColor, Color borderColor) : this(guiManager, x, y, width, height, text) { this.ColorTheme.FillColor = fillColor; this.ColorTheme.BorderColor = borderColor; }
public DScrollBar(DGuiManager guiManager, float x, float y, int _width, int _height, Color _fillColor, Color _borderColor) : this(guiManager, x, y, _width, _height) { this.FillColor = _fillColor; this.BorderColor = _borderColor; }
public override void Initialize() { base.Initialize(); gui_manager = game.GuiManager; form = new DForm(gui_manager, "test", null); form.Size = new Vector2(800, 600); form.Position = new Vector2(0, 0); form.Alpha = 0; form.Initialize(); gui_manager.AddControl(form); DLayoutFlow layout = new DLayoutFlow(2, 2, 60, 20, DLayoutFlow.DLayoutFlowStyle.Vertically); layout.Position = new Vector2(10, 10); button1 = new DButton(gui_manager); layout.Add(button1); button1.Text = "test"; button1.Initialize(); form.AddPanel(button1); button1.OnClick += new DButtonEventHandler(button_OnClick); check1 = new DCheckbox(gui_manager); layout.Add(check1); check1.Text = "Enable Fog"; check1.FontColor = Color.White; check1.FillColor = Color.Wheat; check1.Checked = true; check1.Initialize(); form.AddPanel(check1); check1.OnToggle += new CheckboxEventHandler(check_OnCheck); }
public DCheckbox(DGuiManager guiManager, float x, float y, string _text, Color _fillColor, Color _borderColor) : this(guiManager, x, y, _text) { this.FillColor = _fillColor; this.BorderColor = _borderColor; }
public DToggleButton(DGuiManager guiManager, float x, float y, string _text, int _width, int _height, Color _fillColor, Color _borderColor) : this(guiManager, x, y, _text, _width, _height) { this.FillColor = _fillColor; this.BorderColor = _borderColor; }
public DScrollBar(DGuiManager guiManager, float x, float y, int _width, int _height, Color _fillColor, Color _borderColor, Color _buttonFillColor, Color _buttonBorderColor) : this(guiManager, x, y, _width, _height, _fillColor, _borderColor) { SetButtonColors(_buttonFillColor, _buttonBorderColor); }
public DButtonBase(DGuiManager guiManager) : base(guiManager) { Size = new Vector2(WIDTH, HEIGHT); UseHoverColor = true; label = new DText(guiManager); }
public DCheckbox(DGuiManager guiManager, float x, float y, string _text, Color _fillColor, Color _borderColor, Color _checkedFillColor, Color _checkedBorderColor) : this(guiManager, x, y, _text, _fillColor, _borderColor) { this.ClickedFillColor = _checkedFillColor; this.ClickedBorderColor = _checkedBorderColor; }
Color _tintColor = Color.White; // Tint color, if you're into that sort of thing #endregion Fields #region Constructors public DPanel(DGuiManager guiManager) : base(guiManager.Game) { _guiManager = guiManager; _origin = new Vector2(0, 0); Size = new Vector2(1, 1); _guiManager.OnFocusQueueReject += new DGuiManagerFocusQueueHandler(_guiManager_OnFocusQueueReject); }
public DImage(DGuiManager guiManager) : base(guiManager) { Size = new Vector2(WIDTH, HEIGHT); content = new ContentManager(guiManager.Game.Services); content.RootDirectory = "Content"; _acceptsFocus = false; }
public DText(DGuiManager guiManager) : base(guiManager) { Size = new Vector2(WIDTH, HEIGHT); content = new ContentManager(guiManager.Game.Services); content.RootDirectory = "Content"; text = string.Empty; // hack to avoid a render-time null check _acceptsFocus = false; }
public DToggleButton(DGuiManager guiManager) : base(guiManager) { //FillColor = Color.Ivory; //BorderColor = new Color(40,40,40); //HoverFillColor = Color.Cornsilk; //HoverBorderColor = new Color(40, 40, 40); OnToggle += new ToggleButtonEventHandler(Toggle); }
public DGrid(DGuiManager guiManager, int columns, int rows) : base(guiManager) { _guiManager = guiManager; _columns = columns; _rows = rows; if (_columns <= 0 || _rows <= 0) throw new Exception("Cannot create a DGrid with zero or negative columns/rows."); GridColor = ColorTheme.FillColor; }
public DForm(DGuiManager guiManager, string formName, DForm parent) : base(guiManager) { _isForm = true; name = formName; parentForm = parent; childForms = new Dictionary<string,DForm>(); Size = new Vector2(FORM_WIDTH, FORM_HEIGHT); // Center by default this.Position = new Vector2((guiManager.Game.Window.ClientBounds.Width - Size.X) / 2f, (guiManager.Game.Window.ClientBounds.Height - Size.Y) / 2f); }
public DCheckbox(DGuiManager guiManager) : base(guiManager) { FillColor = ColorTheme.InputFillColor; BorderColor = ColorTheme.BorderColor; Size = new Vector2(BOXSIZE, BOXSIZE); //SetCentered(true); //content = new ContentManager(game.Services); //content.RootDirectory = Path.Combine("Content", "fonts"); Text = ""; OnCheck += new CheckboxEventHandler(Check); OnUncheck += new CheckboxEventHandler(Uncheck); }
protected override void LoadContent() { base.LoadContent(); guiManager = new DGuiManager(game, game.spriteBatch); layout = new DLayoutFlow(1, 12, DLayoutFlow.DLayoutFlowStyle.Vertically); layout.Position = new Vector2(10, 10); form = new DForm(guiManager, "Gunbound", null); form.Size = new Vector2(800, 600); form.Position = new Vector2(0, 0); form.Initialize(); guiManager.AddControl(form); }
public DListBoxItem(DGuiManager guiManager, string _text) : base(guiManager) { text = ""; if (_text != null) text = _text; FillColor = Color.LightYellow; BorderColor = Color.LemonChiffon; HoverFillColor = Color.Ivory; HoverBorderColor = Color.Wheat; Size = new Vector2(WIDTH, HEIGHT); UseHoverColor = true; content = new ContentManager(guiManager.Game.Services); content.RootDirectory = "Content"; }
public DGoldenPanel(DGuiManager guiManager, int dimension, DGoldenPanelAlignment _alignment) : this(guiManager) { alignment = _alignment; float height = dimension; float width = dimension; // Use golden ratio to get size // The longest side is used to obtain the length of the shorter. if (alignment == DGoldenPanelAlignment.Horizontal) height = GoldenRatio.ShortFromLong(width); else width = GoldenRatio.ShortFromLong(height); Size = new Vector2(width, height); }
public DCheckbox(DGuiManager guiManager, float x, float y, string _text) : this(guiManager, x, y) { if (_text != null) Text = _text; }
public DToggleButton(DGuiManager guiManager, float x, float y, string _text) : this(guiManager, x, y) { if (_text != null) Text = _text; }
public DComboBox(DGuiManager guiManager, float x, float y) : this(guiManager) { this.Position = new Vector2(x, y); }
public DScrollBar(DGuiManager guiManager, float x, float y) : this(guiManager) { this.Position = new Vector2(x, y); }
public DScrollBar(DGuiManager guiManager, float x, float y, int _width, int _height) : this(guiManager, x, y) { this.Size = new Vector2(_width, _height); }
public DMultiLineTextBox(DGuiManager guiManager) : base(guiManager) { FillColor = ColorTheme.InputFillColor; BorderColor = ColorTheme.BorderColor; Size = new Vector2(WIDTH, HEIGHT); }
public DToggleButton(DGuiManager guiManager, float x, float y) : this(guiManager) { this.Position = new Vector2(x, y); }
public DGoldenPanel(DGuiManager guiManager) : base(guiManager) { }
public DScrollBar(DGuiManager guiManager) : base(guiManager) { FillColor = Color.White; BorderColor = Color.Gainsboro; //HoverFillColor = Color.Cornsilk; //HoverBorderColor = new Color(40, 40, 40); //UseHoverColor = true; }
public DComboBox(DGuiManager guiManager) : base(guiManager) { Size = new Vector2(DEFAULT_WIDTH, DEFAULT_HEIGHT); Text = ""; }
public DToggleButton(DGuiManager guiManager, float x, float y, string _text, int _width, int _height) : this(guiManager, x, y, _text) { this.Size = new Vector2(_width, _height); }