Exemple #1
0
        private void DrawHintIfSelected(SpriteBatch spriteBatch)
        {
            if (_selectedCondition != null && _selectedConditionIconIndex != null)
            {
                var personConditionHintText = GetConditionHintText(_selectedCondition);

                var hintFont               = _uiContentStorage.GetHintTitleFont();
                var titleTextSizeVector    = hintFont.MeasureString(personConditionHintText);
                var selectedConditionIndex = _selectedConditionIconIndex.Value;
                var hintXPosition          = selectedConditionIndex * (ICON_SIZE + ICON_SPACING) + _screenX;

                const int Y_POSITION_UNDER_ICON_SEQUENCE = ICON_SIZE + ICON_SPACING;
                const int HINT_TEXT_SPACING = 8;
                var       hintRectangle     = new Rectangle(hintXPosition, Y_POSITION_UNDER_ICON_SEQUENCE + _screenY,
                                                            (int)titleTextSizeVector.X + HINT_TEXT_SPACING * 2,
                                                            (int)titleTextSizeVector.Y + HINT_TEXT_SPACING * 2);

                var conditionHintBackgroundTexture = _uiContentStorage.GetHintBackgroundTexture();
                spriteBatch.Draw(conditionHintBackgroundTexture, hintRectangle, Color.DarkSlateGray);

                spriteBatch.DrawString(hintFont, personConditionHintText,
                                       new Vector2(hintRectangle.Left + HINT_TEXT_SPACING, hintRectangle.Top + HINT_TEXT_SPACING),
                                       Color.Wheat);
            }
        }
Exemple #2
0
        public override void Draw(GameTime gameTime)
        {
            base.Draw(gameTime);

            if (_sectorViewModel != null)
            {
                _sectorViewModel.Draw(gameTime);
            }

            DrawHud();

            DrawModals();

            if (_isBeginTransition)
            {
                _loadingAnimCounter += gameTime.ElapsedGameTime.TotalSeconds;
                _spriteBatch.Begin();
                _spriteBatch.Draw(_uiContentStorage.GetHintBackgroundTexture(), Game.GraphicsDevice.Viewport.Bounds,
                                  Color.Black);
                var pointCount = ((int)_loadingAnimCounter) % 4;
                _spriteBatch.DrawString(_uiContentStorage.GetButtonFont(), "Loading" + new string('.', pointCount),
                                        Game.GraphicsDevice.Viewport.Bounds.Center.ToVector2(), Color.White);
                _spriteBatch.End();
            }
        }