Beispiel #1
0
        public void Draw(SpriteBatchUI spriteBatch, int x, int y)
        {
            // determine if properties need to be updated.
            if (m_Entity != null && m_PropertyListHash != m_Entity.PropertyList.Hash)
            {
                m_PropertyListHash = m_Entity.PropertyList.Hash;
                Caption = m_Entity.PropertyList.Properties;
            }

            // update text if necessary.
            if (m_RenderedText == null)
            {
                m_RenderedText = new RenderedText("<center>" + Caption, 300, true);
            }
            else if (m_RenderedText.Text != "<center>" + Caption)
            {
                m_RenderedText = null;
                m_RenderedText = new RenderedText("<center>" + Caption, 300, true);
            }

            // draw checkered trans underneath.
            spriteBatch.Draw2DTiled(CheckerTrans.CheckeredTransTexture, new Rectangle(x - 4, y - 4, m_RenderedText.Width + 8, m_RenderedText.Height + 8), Vector3.Zero);
            // draw tooltip contents
            m_RenderedText.Draw(spriteBatch, new Point(x, y));
        }
Beispiel #2
0
 void buildGumpling(int x, int y, int width, int height, int hue, int textIndex, string[] lines)
 {
     Position = new Point(x, y);
     Size = new Point(width, height);
     Hue = hue;
     Text = lines[textIndex];
     m_Texture = new RenderedText(Text, width);
 }
 void BuildGumpling(int x, int y, int width, int height, int font, int hue, string text)
 {
     Position = new Point(x, y);
     Size = new Point(width, height);
     m_Rendered = new RenderedText(string.Empty, width);
     Hue = hue;
     FontID = font;
     Text = text;
 }
Beispiel #4
0
        public KeyPressControl(AControl parent, int x, int y, int width, int height, int entryID, WinKeys key)
                : base(parent)
        {
            Position = new Point(x, y);
            Size = new Point(width, height);
            Key = key;
            m_RenderedText = new RenderedText(string.Empty, width);
            IsChanged = false;

            HandlesMouseInput = true;
            HandlesKeyboardFocus = true;
            LeadingHtmlTag = "<center><span color='#fff' style='font-family: uni2;'>";
        }
Beispiel #5
0
        public void Draw(SpriteBatchUI spriteBatch, int x, int y)
        {
            // draw checkered trans underneath.

            if (m_RenderedText == null)
            {
                m_RenderedText = new RenderedText(Caption, 200);
            }

            spriteBatch.Draw2DTiled(Controls.CheckerTrans.CheckeredTransTexture, new Rectangle(x - 4, y - 4, m_RenderedText.Width + 8, m_RenderedText.Height + 8), Vector3.Zero);

            m_RenderedText.Draw(spriteBatch, new Point(x, y));
        }
Beispiel #6
0
 // ============================================================================================================
 // Ctors and BuildGumpling Methods
 // ============================================================================================================
 public TextEntryPage(AControl parent, int x, int y, int width, int height, int pageIndex)
     : base(parent)
 {
     base.HandlesMouseInput = true;
     base.HandlesKeyboardFocus = true;
     IsEditable = true;
     Position = new Point(x, y);
     Size = new Point(width, height);
     PageIndex = pageIndex;
     m_CaratBlinkOn = false;
     m_RenderedText = new RenderedText(string.Empty, Width, true);
     m_RenderedCarat = new RenderedText(string.Empty, 16, true);
 }
Beispiel #7
0
 public ButtonResizable(AControl parent, int x, int y, int width, int height, string caption, Action onClickLeft = null, Action onClickRight = null)
     : base(parent)
 {
     HandlesMouseInput = true;
     Position = new Point(x, y);
     Size = new Point(width, height);
     m_Caption = new RenderedText(string.Empty, width, true);
     Caption = caption;
     m_Gumps[0] = AddControl(new ResizePic(null, 0, 0, GumpUp, Width, Height), 1) as ResizePic;
     m_Gumps[1] = AddControl(new ResizePic(null, 0, 0, GumpDown, Width, Height), 2) as ResizePic;
     m_Gumps[2] = AddControl(new ResizePic(null, 0, 0, GumpOver, Width, Height), 3) as ResizePic;
     m_OnClickLeft = onClickLeft;
     m_OnClickRight = onClickRight;
 }
Beispiel #8
0
        protected override bool IsPointWithinControl(int x, int y)
        {
            m_MouseOverText = -1; // this value is changed every frame if we mouse over a region.
            m_MouseOverHREF = -1; // this value is changed every frame if we mouse over a region.

            int height = 0;

            for (int i = 0; i < m_Entries.Count; i++)
            {
                RenderedText rendered = m_Entries[i];
                if (rendered.Regions.Count > 0)
                {
                    HtmlLink region = rendered.Regions.RegionfromPoint(new Point(x, y - height + m_ScrollBar.Value));
                    if (region != null)
                    {
                        m_MouseOverText = i;
                        m_MouseOverHREF = region.Index;
                        return(true);
                    }
                }
                height += rendered.Height;
            }
            return(false);
        }
Beispiel #9
0
 void buildGumpling(int x, int y, int width, int height, int hue, int entryID, int limitSize, string text)
 {
     Position = new Point(x, y);
     Size = new Point(width, height);
     Hue = hue;
     EntryID = entryID;
     Text = text;
     LimitSize = limitSize;
     m_CaratBlinkOn = false;
     m_RenderedText = new RenderedText(string.Empty, 512, true);
     m_Carat = new RenderedText(string.Empty, 16, true);
 }
Beispiel #10
0
 public TextLabelAscii(AControl parent, int width = 400)
     : base(parent)
 {
     m_Width = width;
     m_Rendered = new RenderedText(string.Empty, m_Width, true);
 }
Beispiel #11
0
 public void Dispose()
 {
     m_Texture = null;
 }
Beispiel #12
0
        public ChatLineTimed(string text, int width)
        {
            m_text = text;
            m_isExpired = false;
            m_alpha = 1.0f;
            m_width = width;

            m_Texture = new RenderedText(m_text, m_width);
        }
Beispiel #13
0
 void buildGumpling(int x, int y, int gumpID1, int gumpID2, ButtonTypes buttonType, int param, int buttonID)
 {
     Position = new Point(x, y);
     GumpUpID = gumpID1;
     GumpDownID = gumpID2;
     ButtonType = buttonType;
     ButtonParameter = param;
     ButtonID = buttonID;
     m_Texture = new RenderedText(string.Empty, 100, true);
 }
Beispiel #14
0
 public OverheadView(Overhead entity)
     : base(entity)
 {
     m_Texture = new RenderedText(Entity.Text, collapseContent: true);
     DrawTexture = m_Texture.Texture;
 }
Beispiel #15
0
        void buildGumpling(int x, int y, int width, int height, int background, int scrollbar, string text)
        {
            Position = new Point(x, y);
            base.Width = width;
            Size = new Point(width, height);
            HasBackground = (background == 1) ? true : false;
            HasScrollbar = (scrollbar != 0) ? true : false;
            UseFlagScrollbar = (HasScrollbar && scrollbar == 2) ? true : false;
            m_RenderedText = new RenderedText(text, width - (HasScrollbar ? 15 : 0) - (HasBackground ? 8 : 0));

            if (HasBackground)
            {
                this.AddControl(new ResizePic(this, 0, 0, 0x2486, Width - (HasScrollbar ? 15 : 0), Height));
                LastControl.HandlesMouseInput = false;
            }

            if (HasScrollbar)
            {
                if (UseFlagScrollbar)
                {
                    AddControl(new ScrollFlag(this));
                    m_Scrollbar = LastControl as IScrollBar;
                    m_Scrollbar.Position = new Point(Width - 14, 0);
                }
                else
                {
                    AddControl(new ScrollBar(this));
                    m_Scrollbar = LastControl as IScrollBar;
                    m_Scrollbar.Position = new Point(Width - 14, 0);
                }
                m_Scrollbar.Height = Height;
                m_Scrollbar.MinValue = 0;
                m_Scrollbar.MaxValue = m_RenderedText.Height - Height + (HasBackground ? 8 : 0);
                ScrollY = m_Scrollbar.Value;
            }

            if (Width != m_RenderedText.Width)
                Width = m_RenderedText.Width;
        }
Beispiel #16
0
 public OverheadView(Overhead entity)
     : base(entity)
 {
     m_Texture = new RenderedText(Entity.Text);
     DrawTexture = m_Texture.Texture;
 }