FSO.Client.UI.Controls.UIImage.SetSize C# (CSharp) Method

SetSize() public method

public SetSize ( float width, float height ) : void
width float
height float
return void
        public void SetSize(float width, float height)
        {
            m_Width = width;
            m_Height = height;
            if (NineSlice)
            {
                NineSliceMargins.CalculateScales(m_Width, m_Height);
            }

            if (m_MouseEvent != null)
            {
                m_MouseEvent.Region = new Rectangle(0, 0, (int)m_Width, (int)m_Height);
            }
        }

Usage Example

Exemplo n.º 1
0
        public UIPropertyLog()
            : base(UIDialogStyle.Standard | UIDialogStyle.Close, true)
        {
            //todo: this dialog is resizable. The elements use offests from each side to size and position themselves.
            //right now we're just using positions.

            History = new List<VMChatEvent>();

            this.RenderScript("chatdialog.uis");
            this.SetSize(400, 255);

            this.Caption = "Property Log";

            ChatHistoryBackground = new UIImage(GetTexture((ulong)0x7A400000001)).With9Slice(13, 13, 13, 13);
            ChatHistoryBackground.Position = new Vector2(19, 39);
            ChatHistoryBackground.SetSize(341, 166+30);
            AddAt(3, ChatHistoryBackground);

            ChatHistorySlider.AttachButtons(ChatHistoryScrollUpButton, ChatHistoryScrollDownButton, 1);
            ChatHistorySlider.SetSize(ChatHistorySlider.Size.X, 138 + 30);
            ChatHistoryScrollDownButton.Position += new Vector2(0, 30);
            ChatHistoryText.AttachSlider(ChatHistorySlider);

            ChatHistoryText.Position = new Vector2(29, 47);
            var histStyle = ChatHistoryText.TextStyle.Clone();
            histStyle.Size = 8;
            ChatHistoryText.Size = new Vector2(322, 150+30);
            ChatHistoryText.MaxLines = 13;
            ChatHistoryText.TextStyle = histStyle;

            Remove(ChatEntryTextEdit);
            CloseButton.OnButtonClick += CloseButton_OnButtonClick;
        }
All Usage Examples Of FSO.Client.UI.Controls.UIImage::SetSize