Example #1
0
        public StatusBar(UiStateModel uiState, StyleProvider styleProvider)
        {
            _uiState = uiState ?? throw new ArgumentNullException(nameof(uiState));
            if (styleProvider == null)
            {
                throw new ArgumentNullException(nameof(styleProvider));
            }

            // copy down config
            _barHeight = 26;

            _fgStyle = styleProvider.GetStyle("StatusBarForegroundStyle");
            _bgStyle = styleProvider.GetStyle("StatusBarBackgroundStyle");

            _fgTextFormat = new CanvasTextFormat()
            {
                VerticalAlignment   = CanvasVerticalAlignment.Center,
                HorizontalAlignment = CanvasHorizontalAlignment.Left,
                FontWeight          = FontWeights.Bold,
                FontSize            = _barHeight * 0.75f
            };
        }
Example #2
0
 public GunTowerBodySprite(IConfig config, StyleProvider styleProvider)
 {
     Style = styleProvider.GetStyle(config.GetString(CfgStyleName));
 }