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

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

            TackGUI.RegisterGUIObject(this);
        }
示例#3
0
 internal override void OnRender()
 {
     if (m_hovering)
     {
         TackGUI.InternalTextArea(Bounds, Text, HoverStyle);
     }
     else
     {
         TackGUI.InternalTextArea(Bounds, Text, NormalStyle);
     }
 }
示例#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());
     }
 }
示例#6
0
        public GUIToggle()
        {
            Text       = "GUIToggle";
            IsSelected = false;

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

            TackGUI.RegisterGUIObject(this);
        }
示例#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;
        }
示例#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());
     }
 }
示例#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"));
        }
示例#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);
     }
 }