Example #1
0
        internal void SetTextCommandOptions(bool left = true, bool disabledColor = false)
        {
            TextStyle s = left ? TextStyle : RightLabelStyle;

            s.Color = disabledColor ? DisabledForeColor : CurrentForeColor;

            s.Apply();
        }
        /// <summary>
        /// Apply text style to specified text component.
        /// </summary>
        /// <param name="text">Text component.</param>
        public void Apply(Text text)
        {
            DebugEx.VerboseFormat("TextStyleLoader.Apply(text = {0})", text);

            if (mTextStyle == null)
            {
                mTextStyle = AssetUtils.LoadTextStyle(mPath);
            }

            mTextStyle.Apply(text);
        }
Example #3
0
        internal void SetTextCommandOptions(bool left = true)
        {
            if (left)
            {
                TextStyle.Apply();
            }
            else
            {
                RightLabelStyle.Apply();
            }
            Color textColor = CurrentForeColor;

            N.SetTextColour(textColor.R, textColor.G, textColor.B, textColor.A);
        }
Example #4
0
        public void Apply(View view, ViewGroup.LayoutParams layoutParams)
        {
            if (Width.HasValue)
            {
                layoutParams.Width = Width.Value;
            }
            if (Height.HasValue)
            {
                layoutParams.Height = Height.Value;
            }
            if (MinHeight.HasValue)
            {
                view.SetMinimumHeight(MinHeight.Value);
            }
            if (MinWidth.HasValue)
            {
                view.SetMinimumWidth(MinWidth.Value);
            }

            if (_frame != null)
            {
                _frame.Apply(view, layoutParams);
            }
            if (_linear != null)
            {
                _linear.Apply(view, layoutParams);
            }
            if (_margin != null)
            {
                _margin.Apply(view, layoutParams);
            }
            if (_padding != null)
            {
                _padding.Apply(view, layoutParams);
            }
            if (_relative != null)
            {
                _relative.Apply(view, layoutParams);
            }
            if (_row != null)
            {
                _row.Apply(view, layoutParams);
            }
            if (_text != null)
            {
                _text.Apply(view, layoutParams);
            }
        }
Example #5
0
        protected override void OnRebuild()
        {
            var   styledString = m_style.Apply(m_string, Screen.Language);
            float startX       = Position.X;
            float startY       = Position.Y;

            switch (m_alignment)
            {
            case TextAlignment.Center:
            {
                startX -= 0.5f * m_font.Measure(styledString, m_parseImages) * m_scale;
                break;
            }

            case TextAlignment.Right:
            {
                startX -= m_font.Measure(styledString, m_parseImages) * m_scale;
                break;
            }
            }
            m_font.Render(styledString, startX, startY, m_geometry, m_textures, m_parseImages, m_scale);
        }