Beispiel #1
0
        public override void ScaleToScreenResolution()
        {
            base.ScaleToScreenResolution();

            GUIGraphicsContext.ScaleRectToScreenResolution(ref _spinControlPositionX, ref _spinControlPositionY,
                                                           ref _spinControlWidth, ref _spinControlHeight);
        }
Beispiel #2
0
 public override void ScaleToScreenResolution()
 {
     base.ScaleToScreenResolution();
     GUIGraphicsContext.ScaleRectToScreenResolution(ref _buttonX, ref _buttonY, ref _buttonWidth, ref _buttonHeight);
 }
        /// <summary>
        /// This method gets called when the control is created and all properties has been set
        /// It allows the control to do any initialization
        /// </summary>
        public override void FinalizeConstruction()
        {
            base.FinalizeConstruction();
            _imageFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                                 _focusedTextureName);
            _imageFocused.ParentControl = this;
            _imageFocused.Filtering     = false;
            _imageFocused.DimColor      = DimColor;
            _imageFocused.ColourDiffuse = ColourDiffuse;
            _imageFocused.SetBorder(_strBorderTF, _borderPositionTF, _borderTextureRepeatTF, _borderTextureRotateTF,
                                    _borderTextureFileNameTF, _borderColorKeyTF, _borderHasCornersTF,
                                    _borderCornerTextureRotateTF);
            TileFillTF = _textureFocusTileFill;
            _imageFocused.MaskFileName    = _focusedTextureMask;
            _imageFocused.OverlayFileName = _overlayTF;

            _imageNonFocused = LoadAnimationControl(_parentControlId, _controlId, _positionX, _positionY, _width, _height,
                                                    _nonFocusedTextureName);
            _imageNonFocused.ParentControl = this;
            _imageNonFocused.Filtering     = false;
            _imageNonFocused.DimColor      = DimColor;
            _imageNonFocused.ColourDiffuse = ColourDiffuse;
            _imageNonFocused.SetBorder(_strBorderTNF, _borderPositionTNF, _borderTextureRepeatTNF, _borderTextureRotateTNF,
                                       _borderTextureFileNameTNF, _borderColorKeyTNF, _borderHasCornersTNF,
                                       _borderCornerTextureRotateTNF);
            TileFillTNF = _textureNoFocusTileFill;
            _imageNonFocused.MaskFileName    = _nonFocusedTextureMask;
            _imageNonFocused.OverlayFileName = _overlayTNF;

            if (_hoverFilename != string.Empty)
            {
                GUIGraphicsContext.ScaleRectToScreenResolution(ref _hoverX, ref _hoverY, ref _hoverWidth, ref _hoverHeight);
                _hoverImage = LoadAnimationControl(_parentControlId, _controlId, _hoverX, _hoverY, _hoverWidth, _hoverHeight,
                                                   _hoverFilename);
                _hoverImage.ParentControl = this;
                _hoverImage.DimColor      = DimColor;
                _hoverImage.ColourDiffuse = ColourDiffuse;
                _hoverImage.SetBorder(_strBorderH, _borderPositionH, _borderTextureRepeatH, _borderTextureRotateH,
                                      _borderTextureFileNameH, _borderColorKeyH, _borderHasCornersH, _borderCornerTextureRotateH);
                TileFillH = _hoverTileFill;
                _hoverImage.MaskFileName    = _hoverMask;
                _hoverImage.OverlayFileName = _overlayH;
            }

            GUILocalizeStrings.LocalizeLabel(ref _label);

            // Use a GUIFadeLabel if a valid scrollStartDelay is specified, otherwise use a GUILabelControl (default)
            if (_scrollStartDelay < 0)
            {
                _labelControl = new GUILabelControl(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                                    _label, _textColor, Alignment.ALIGN_LEFT, VAlignment.ALIGN_TOP, false,
                                                    _shadowAngle, _shadowDistance, _shadowColor);
                ((GUILabelControl)_labelControl).TextAlignment  = _textAlignment;
                ((GUILabelControl)_labelControl).TextVAlignment = _textVAlignment;
            }
            else
            {
                _labelControl = new GUIFadeLabel(_parentControlId, 0, _positionX, _positionY, _width, _height, _fontName,
                                                 _textColor, Alignment.ALIGN_LEFT, VAlignment.ALIGN_TOP,
                                                 _shadowAngle, _shadowDistance, _shadowColor,
                                                 _userWrapString);
                ((GUIFadeLabel)_labelControl).TextAlignment  = _textAlignment;
                ((GUIFadeLabel)_labelControl).TextVAlignment = _textVAlignment;
                ((GUIFadeLabel)_labelControl).AllowScrolling = false;
                ((GUIFadeLabel)_labelControl).AllowFadeIn    = false;
            }
            _labelControl.DimColor      = DimColor;
            _labelControl.ParentControl = this;
        }