示例#1
0
        public EViewport AddViewport(int id, string name, int x, int y, int width, int height, bool allowResize = false, int minHeight = 0)
        {
            Viewports.Add(new EViewport(id, name, x, y, width, height, allowResize, minHeight));
            EViewport getViewport = Viewports[Viewports.Count - 1];

            getViewport.ParentScreen = this;
            return(getViewport);
        }
示例#2
0
 public ViewportEventArgs(EViewport eventViewport, int x, int y, ClickedMouseButton clickedButton, bool clickedInScreen)
 {
     EventViewport   = eventViewport;
     ClickedX        = x;
     ClickedY        = y;
     ClickedButton   = clickedButton;
     ClickedInScreen = clickedInScreen;
 }
示例#3
0
 /// <summary>
 /// Creates a panel containing a list of all currently open chat channels
 /// </summary>
 /// <param name="_Channels">A list of all currently open chat channels</param>
 /// <param name="_c_ChannelID">The channel which is currently focused</param>
 public ChatPanel(int id, string name, Texture2D backgroundSprite, int width, int height, Vector2 position, EViewport parentViewport, bool visible = false)
 {
     Id               = id;
     Name             = name;
     BackgroundSprite = backgroundSprite;
     Width            = width;
     Height           = height;
     OffsetPosition   = position;
     Visible          = visible;
     ParentViewport   = parentViewport;
 }
示例#4
0
        /// <summary>
        /// Creates a new scrollbar
        /// </summary>
        /// <param name="id">The ID of the scrollbar</param>
        /// <param name="name">The name of the scrollbar</param>
        /// <param name="height">The height of the scrollbar when it is drawn</param>
        /// <param name="maxHeight">The total height that the scrollbar can scroll up or down</param>
        /// <param name="position">The position of the scrollbar</param>
        /// <param name="toScroll">The control that will be scrolled</param>
        public Scrollbar(int id, string name, int height, int maxHeight, Vector2 position, dynamic toScroll, EViewport parentViewport, SpriteObject scrollbarBar, SpriteObject scrollbarUp, SpriteObject scrollbarDown, Panel panelToScroll = null)
        {
            Id             = id;
            Name           = name;
            MaxHeight      = maxHeight;
            Height         = height;
            OffsetPosition = position;
            ToScroll       = toScroll;
            ParentViewport = parentViewport;
            if (panelToScroll == null)
            {
                UpArrow = new Rectangle((int)OffsetPosition.X, (int)OffsetPosition.Y, 10, 10);
            }
            else
            {
                UpArrow = new Rectangle((int)OffsetPosition.X, (int)OffsetPosition.Y, 10, 10);
            }
            int plusHeight = 0;

            if (ToScroll == null && ListScroll == null)
            {
                plusHeight = (int)OffsetPosition.Y - panelToScroll.Stroke;
                //CurrentStep = (MaxHeight / 10) - (_PanelToScroll.Height / 10);
            }
            DownArrow = new Rectangle((int)OffsetPosition.X, Height + plusHeight - 9, 10, 10);
            int minusHeight = 0;

            if (ToScroll != null)
            {
                minusHeight = 40;
                MaxHeight   = ToScroll.Height;
            }
            else if (ListScroll != null)
            {
                minusHeight = 40;
                MaxHeight   = ListScroll.Height;
            }
            ScrolledPosition = new Rectangle((int)OffsetPosition.X, (int)OffsetPosition.Y, 10, Height - minusHeight);
            ScrollbarBar     = scrollbarBar;
            ScrollbarUp      = scrollbarUp;
            ScrollbarDown    = scrollbarDown;
            CountClick       = ClickState.Try;
            PanelToScroll    = panelToScroll;
        }
示例#5
0
        public Form AddForm(int id, string name, Texture2D sprite, int width, int height, Vector2 position, EViewport viewport, string text = "", bool visible = false, int stroke = 0)
        {
            Forms.Add(new Form(id, name, sprite, width, height, position, text, visible, stroke));
            Form getForm = Forms[Forms.Count - 1];

            getForm.ParentScreen   = this;
            getForm.ParentViewport = viewport;
            return(getForm);
        }
示例#6
0
        public Form AddForm(int id, string name, FormStyle style, ButtonStyle titleStyle, int width, int height, Vector2 position, EViewport viewport, string text = "", bool visible = false)
        {
            Forms.Add(new Form(id, name, style, titleStyle, width, height, position, text, visible));
            Form getForm = Forms[Forms.Count - 1];

            getForm.ParentScreen   = this;
            getForm.ParentViewport = viewport;
            return(getForm);
        }
示例#7
0
        public Panel AddPanel(int id, string name, Texture2D backgroundSprite, int width, int height, Vector2 position, EViewport viewport, bool showScrollbar, string text = "", bool visible = false, int stroke = 0)
        {
            Panels.Add(new Panel(id, name, backgroundSprite, width, height, position, showScrollbar, text, visible, stroke));
            Panel getPanel = Panels[Panels.Count - 1];

            getPanel.ParentScreen   = this;
            getPanel.ParentViewport = viewport;
            return(getPanel);
        }
示例#8
0
        public ChatPanel AddChatPanel(int id, string name, Texture2D backgroundSprite, EViewport viewport, int width, int height, Vector2 position, bool visible = false)
        {
            ChatPanels.Add(new ChatPanel(id, name, backgroundSprite, width, height, position, viewport, visible));
            ChatPanel getChatPanel = ChatPanels[ChatPanels.Count - 1];

            getChatPanel.ParentScreen = this;
            return(getChatPanel);
        }
示例#9
0
        public ProgressBar AddProgressBar(int id, string name, Texture2D sprite, Texture2D backgroundSprite, int width, int height, Vector2 position, EViewport viewport, int borderSize, bool visible = false)
        {
            ProgressBars.Add(new ProgressBar(id, name, sprite, backgroundSprite, width, height, position, borderSize, visible));
            ProgressBar getProgressBar = ProgressBars[ProgressBars.Count - 1];

            getProgressBar.ParentScreen   = this;
            getProgressBar.ParentViewport = viewport;
            return(getProgressBar);
        }
示例#10
0
        public TextBox AddTextbox(int id, string name, Texture2D sprite, int width, int height, Vector2 position, EViewport viewport, string text = "", bool visible = false, bool readOnly = false)
        {
            Textboxes.Add(new TextBox(id, name, sprite, width, height, position, text, visible, readOnly));
            TextBox getTextbox = Textboxes[Textboxes.Count - 1];

            getTextbox.ParentScreen   = this;
            getTextbox.ParentViewport = viewport;
            return(getTextbox);
        }
示例#11
0
        public ListBox AddListBox(int id, string name, int width, int height, Vector2 position, EViewport viewport, bool visible = false)
        {
            ListBoxes.Add(new ListBox(id, name, width, height, position, visible));
            ListBox getListBox = ListBoxes[ListBoxes.Count - 1];

            getListBox.ParentScreen   = this;
            getListBox.ParentViewport = viewport;
            return(getListBox);
        }
示例#12
0
        public ComboBox AddComboBox(int id, string name, int width, int height, Vector2 position, SpriteObject background, EViewport viewport, bool visible = false)
        {
            ComboBoxes.Add(new ComboBox(id, name, width, height, position, background, visible));
            ComboBox getComboBox = ComboBoxes[ComboBoxes.Count - 1];

            getComboBox.ParentScreen   = this;
            getComboBox.ParentViewport = viewport;
            return(getComboBox);
        }
示例#13
0
        public Label AddLabel(int id, string name, int width, int height, Vector2 position, EViewport viewport, string text = "", bool visible = false, bool bigFont = false)
        {
            Labels.Add(new Label(id, name, width, height, position, text, visible, bigFont));
            Label getLabel = Labels[Labels.Count - 1];

            getLabel.ParentScreen   = this;
            getLabel.ParentViewport = viewport;
            return(getLabel);
        }
示例#14
0
        public Button AddButton(int id, string name, SpriteObject sprite, int width, int height, Vector2 position, EViewport viewport, string text = "", bool visible = false, SpriteObject pressedSprite = null, int stroke = 0, bool allowRightClick = false)
        {
            Buttons.Add(new Button(id, name, sprite, width, height, position, text, visible, pressedSprite, stroke, allowRightClick));
            Button getButton = Buttons[Buttons.Count - 1];

            getButton.ParentScreen   = this;
            getButton.ParentViewport = viewport;
            return(getButton);
        }
示例#15
0
        public Button AddButton(int id, string name, ButtonStyle style, int width, int height, Vector2 position, EViewport viewport, string text = "", bool visible = false)
        {
            Buttons.Add(new Button(id, name, style, width, height, position, text, visible));
            Button getButton = Buttons[Buttons.Count - 1];

            getButton.ParentScreen   = this;
            getButton.ParentViewport = viewport;
            return(getButton);
        }