コード例 #1
0
ファイル: DToggleButton.cs プロジェクト: konlil/pipe
        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);
        }
コード例 #2
0
ファイル: DMultiLineTextBox.cs プロジェクト: konlil/pipe
 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;
 }
コード例 #3
0
ファイル: DScrollBar.cs プロジェクト: konlil/pipe
 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;
 }
コード例 #4
0
ファイル: MainUI.cs プロジェクト: konlil/pipe
        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);
        }
コード例 #5
0
ファイル: DCheckbox.cs プロジェクト: konlil/pipe
 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;
 }
コード例 #6
0
ファイル: DToggleButton.cs プロジェクト: konlil/pipe
 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;
 }
コード例 #7
0
ファイル: DScrollBar.cs プロジェクト: konlil/pipe
 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);
 }
コード例 #8
0
ファイル: DButtonBase.cs プロジェクト: konlil/pipe
        public DButtonBase(DGuiManager guiManager)
            : base(guiManager)
        {
            Size = new Vector2(WIDTH, HEIGHT);
            UseHoverColor = true;

            label = new DText(guiManager);
        }
コード例 #9
0
ファイル: DCheckbox.cs プロジェクト: konlil/pipe
 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;
 }
コード例 #10
0
ファイル: DPanel.cs プロジェクト: konlil/pipe
        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);
        }
コード例 #11
0
ファイル: DImage.cs プロジェクト: konlil/pipe
        public DImage(DGuiManager guiManager)
            : base(guiManager)
        {
            Size = new Vector2(WIDTH, HEIGHT);

            content = new ContentManager(guiManager.Game.Services);
            content.RootDirectory = "Content";
            _acceptsFocus = false;
        }
コード例 #12
0
ファイル: DText.cs プロジェクト: konlil/pipe
        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;
        }
コード例 #13
0
ファイル: DToggleButton.cs プロジェクト: konlil/pipe
        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);
        }
コード例 #14
0
ファイル: DGrid.cs プロジェクト: konlil/pipe
        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;
        }
コード例 #15
0
ファイル: DForm.cs プロジェクト: konlil/pipe
        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);
        }
コード例 #16
0
ファイル: DCheckbox.cs プロジェクト: konlil/pipe
        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);
        }
コード例 #17
0
ファイル: Screen.cs プロジェクト: andhikanugraha/tetembakan
        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);
        }
コード例 #18
0
ファイル: DListBoxItem.cs プロジェクト: konlil/pipe
        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";
        }
コード例 #19
0
ファイル: DGoldenPanel.cs プロジェクト: konlil/pipe
        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);
        }
コード例 #20
0
ファイル: DCheckbox.cs プロジェクト: konlil/pipe
 public DCheckbox(DGuiManager guiManager, float x, float y, string _text)
     : this(guiManager, x, y)
 {
     if (_text != null)
         Text = _text;
 }
コード例 #21
0
ファイル: DToggleButton.cs プロジェクト: konlil/pipe
 public DToggleButton(DGuiManager guiManager, float x, float y, string _text)
     : this(guiManager, x, y)
 {
     if (_text != null)
         Text = _text;
 }
コード例 #22
0
ファイル: DComboBox.cs プロジェクト: konlil/pipe
 public DComboBox(DGuiManager guiManager, float x, float y)
     : this(guiManager)
 {
     this.Position = new Vector2(x, y);
 }
コード例 #23
0
ファイル: DScrollBar.cs プロジェクト: konlil/pipe
 public DScrollBar(DGuiManager guiManager, float x, float y)
     : this(guiManager)
 {
     this.Position = new Vector2(x, y);
 }
コード例 #24
0
ファイル: DScrollBar.cs プロジェクト: konlil/pipe
 public DScrollBar(DGuiManager guiManager, float x, float y, int _width, int _height)
     : this(guiManager, x, y)
 {
     this.Size = new Vector2(_width, _height);
 }
コード例 #25
0
ファイル: DMultiLineTextBox.cs プロジェクト: konlil/pipe
 public DMultiLineTextBox(DGuiManager guiManager)
     : base(guiManager)
 {
     FillColor = ColorTheme.InputFillColor;
     BorderColor = ColorTheme.BorderColor;
     Size = new Vector2(WIDTH, HEIGHT);
 }
コード例 #26
0
ファイル: DToggleButton.cs プロジェクト: konlil/pipe
 public DToggleButton(DGuiManager guiManager, float x, float y)
     : this(guiManager)
 {
     this.Position = new Vector2(x, y);
 }
コード例 #27
0
ファイル: DGoldenPanel.cs プロジェクト: konlil/pipe
 public DGoldenPanel(DGuiManager guiManager)
     : base(guiManager)
 {
 }
コード例 #28
0
ファイル: DScrollBar.cs プロジェクト: konlil/pipe
        public DScrollBar(DGuiManager guiManager)
            : base(guiManager)
        {
            FillColor = Color.White;
            BorderColor = Color.Gainsboro;

            //HoverFillColor = Color.Cornsilk;
            //HoverBorderColor = new Color(40, 40, 40);

            //UseHoverColor = true;
        }
コード例 #29
0
ファイル: DComboBox.cs プロジェクト: konlil/pipe
 public DComboBox(DGuiManager guiManager)
     : base(guiManager)
 {
     Size = new Vector2(DEFAULT_WIDTH, DEFAULT_HEIGHT);
     Text = "";
 }
コード例 #30
0
ファイル: DToggleButton.cs プロジェクト: konlil/pipe
 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);
 }