Example #1
0
        public GUIBox()
        {
            Bounds      = new RectangleShape(5, 5, 300, 35);
            NormalStyle = new GUIBoxStyle();
            HoverStyle  = new GUIBoxStyle();

            TackGUI.RegisterGUIObject(this);
        }
Example #2
0
        public GUITextArea()
        {
            Text        = "";
            NormalStyle = new GUITextAreaStyle();
            HoverStyle  = new GUITextAreaStyle();

            TackGUI.RegisterGUIObject(this);
        }
Example #3
0
 internal override void OnRender()
 {
     if (m_hovering)
     {
         TackGUI.InternalTextArea(Bounds, Text, HoverStyle);
     }
     else
     {
         TackGUI.InternalTextArea(Bounds, Text, NormalStyle);
     }
 }
Example #4
0
 internal override void OnRender()
 {
     if (m_hovering)
     {
         TackGUI.InternalBox(Bounds, HoverStyle);
     }
     else
     {
         TackGUI.InternalBox(Bounds, NormalStyle);
     }
 }
 internal override void OnRender()
 {
     if (RequiringInput)
     {
         TackGUI.InternalTextArea(Bounds, Text, RequiringInputStyle.ConvertToGUITextStyle());
     }
     else
     {
         TackGUI.InternalTextArea(Bounds, Text, NormalStyle.ConvertToGUITextStyle());
     }
 }
Example #6
0
        public GUIToggle()
        {
            Text       = "GUIToggle";
            IsSelected = false;

            NormalStyle        = GUIToggleStyle.DefaultNormalStyle;
            HoverStyle         = GUIToggleStyle.DefaultHoverStyle;
            SelectedHoverStyle = GUIToggleStyle.DefaultSelectedHoverStyle;
            SelectedStyle      = GUIToggleStyle.DefaultSelectedStyle;

            TackGUI.RegisterGUIObject(this);
        }
Example #7
0
        /// <summary>
        /// Intialises a new Button
        /// </summary>
        public GUIButton()
        {
            Text = "GUIButton";

            NormalStyle = new GUIButtonStyle();

            HoverStyle        = new GUIButtonStyle();
            HoverStyle.Colour = new Colour4b(225, 225, 225, 255);

            ClickedStyle        = new GUIButtonStyle();
            ClickedStyle.Colour = new Colour4b(195, 195, 195, 255);

            TackGUI.RegisterGUIObject(this);
        }
        public GUIInputField()
        {
            Text           = "";
            RequiringInput = false;

            NormalStyle         = GUIInputFieldStyle.DefaultNormalStyle;
            RequiringInputStyle = GUIInputFieldStyle.DefaultRequiringInputStyle;

            TackGUI.RegisterGUIObject(this);

            m_caretBox                    = new GUIBox();
            m_caretBox.NormalStyle        = new GUIBox.GUIBoxStyle();
            m_caretBox.NormalStyle.Colour = Colour4b.Black;
        }
Example #9
0
 internal override void OnRender()
 {
     if (m_pressing)
     {
         TackGUI.InternalTextArea(Bounds, Text, ClickedStyle.ConvertToGUITextAreaStyle());
     }
     else if (m_hovering)
     {
         TackGUI.InternalTextArea(Bounds, Text, HoverStyle.ConvertToGUITextAreaStyle());
     }
     else
     {
         TackGUI.InternalTextArea(Bounds, Text, NormalStyle.ConvertToGUITextAreaStyle());
     }
 }
Example #10
0
        internal void OnStart()
        {
            if (ActiveInstance != null)
            {
                TackConsole.EngineLog(EngineLogType.Error, "There is already an active instance of TackGUI.");
                return;
            }

            ActiveInstance = this;

            m_currentMouseEvents = new List <GUIMouseEvent>();

            m_fontCollection   = new PrivateFontCollection();
            m_activeFontFamily = new FontFamily("Arial");
            m_fontCollection.AddFontFile(Environment.GetFolderPath(Environment.SpecialFolder.Fonts) + "\\Arial.ttf");
            TackConsole.EngineLog(EngineLogType.Message, string.Format("Added default font file from: {0}\\Arial.ttf", Environment.GetFolderPath(Environment.SpecialFolder.Fonts)));

            m_guiOperations = new List <GUIOperation>();

            m_defaultGUIShader = new Shader("shaders.default_gui_shader", TackShaderType.GUI, System.IO.File.ReadAllText("tackresources/shaders/gui/default_gui_vertex_shader.vs"),
                                            System.IO.File.ReadAllText("tackresources/shaders/gui/default_gui_fragment_shader.fs"));
        }
Example #11
0
 internal override void OnRender()
 {
     if (IsSelected)
     {
         if (m_hovering)
         {
             TackGUI.InternalToggle(Bounds, IsSelected, Text, SelectedHoverStyle);
         }
         else
         {
             TackGUI.InternalToggle(Bounds, IsSelected, Text, SelectedStyle);
         }
     }
     else if (m_hovering)
     {
         TackGUI.InternalToggle(Bounds, IsSelected, Text, HoverStyle);
     }
     else
     {
         TackGUI.InternalToggle(Bounds, IsSelected, Text, NormalStyle);
     }
 }