Esempio n. 1
0
        public override void Draw(SpriteBatch spriteBatch, Rectangle screenSize)
        {
            if (ScreenManager.IsConsoleOpen)
            {
                return;
            }

            using (spriteBatch.BeginUsing(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp))
            {
                var i = 1;
                foreach (var message in lines)
                {
                    var lineHeight = gcm.LatinFont.LineSpacing * (int)TimeSpinnerGame.Constants.InGameZoom * 0.5f;

                    var point = new Point(screenSize.X, (int)(screenSize.Height - lineHeight / 2 - lineHeight * i));

                    var fade = (message.OnScreenTime > fadeStart)
                                                ? 1 - ((message.OnScreenTime - fadeStart).Ticks / (double)fadeTime.Ticks)
                                                : 1;

                    DrawBackdrop(spriteBatch, point, screenSize, (int)lineHeight, fade);
                    DrawMessage(spriteBatch, point, message, fade);

                    i++;
                }
            }
        }
Esempio n. 2
0
        public void Draw(SpriteBatch spriteBatch, ItemTrackerState state)
        {
            ResetPosition();

            using (spriteBatch.BeginUsing(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp))
            {
                DrawItem(spriteBatch, state.Timestop, new ItemIdentifier(EInventoryRelicType.TimespinnerWheel));
                DrawItem(spriteBatch, state.TimeSpindle, new ItemIdentifier(EInventoryRelicType.TimespinnerSpindle));
                DrawItem(spriteBatch, state.TimeGear1, new ItemIdentifier(EInventoryRelicType.TimespinnerGear1));
                DrawItem(spriteBatch, state.TimeGear2, new ItemIdentifier(EInventoryRelicType.TimespinnerGear2));
                DrawItem(spriteBatch, state.TimeGear3, new ItemIdentifier(EInventoryRelicType.TimespinnerGear3));
                DrawItem(spriteBatch, state.Dash, new ItemIdentifier(EInventoryRelicType.Dash));
                DrawItem(spriteBatch, state.DoubleJump, new ItemIdentifier(EInventoryRelicType.DoubleJump));
                DrawItem(spriteBatch, state.Lightwall, new ItemIdentifier(EInventoryOrbType.Barrier, EOrbSlot.Spell));
                DrawItem(spriteBatch, state.CelestialSash, new ItemIdentifier(EInventoryRelicType.EssenceOfSpace));
                DrawItem(spriteBatch, state.PyramidKeys, new ItemIdentifier(EInventoryRelicType.PyramidsKey));
                DrawItem(spriteBatch, state.WaterMask, new ItemIdentifier(EInventoryRelicType.WaterMask));
                DrawItem(spriteBatch, state.GasMask, new ItemIdentifier(EInventoryRelicType.AirMask));
                DrawItem(spriteBatch, state.CardA, new ItemIdentifier(EInventoryRelicType.ScienceKeycardA));
                DrawItem(spriteBatch, state.CardB, new ItemIdentifier(EInventoryRelicType.ScienceKeycardB));
                DrawItem(spriteBatch, state.CardC, new ItemIdentifier(EInventoryRelicType.ScienceKeycardC));
                DrawItem(spriteBatch, state.CardD, new ItemIdentifier(EInventoryRelicType.ScienceKeycardD));
                DrawItem(spriteBatch, state.CardV, new ItemIdentifier(EInventoryRelicType.ScienceKeycardV));
                DrawItem(spriteBatch, state.Tablet, new ItemIdentifier(EInventoryRelicType.Tablet));
                DrawItem(spriteBatch, state.CardE, new ItemIdentifier(EInventoryRelicType.ElevatorKeycard));
                DrawItem(spriteBatch, state.EyeRing, new ItemIdentifier(EInventoryOrbType.Eye, EOrbSlot.Passive));
                DrawItem(spriteBatch, state.Kobo, new ItemIdentifier(EInventoryFamiliarType.Kobo));
                DrawItem(spriteBatch, state.MerchantCrow, new ItemIdentifier(EInventoryFamiliarType.MerchantCrow));
                DrawFireSource(spriteBatch, state);
                DrawPinkSource(spriteBatch, state);
            }
        }
        public override void Draw(SpriteBatch spriteBatch, SpriteFont menuFont)
        {
            if (!GameScreen.IsActive)
            {
                return;
            }

            using (spriteBatch.BeginUsing(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp))
            {
                foreach (var seedRepresentation in seedRepresentations)
                {
                    if (!seedRepresentation.Key.AsDynamic().IsScrolledOff)
                    {
                        seedRepresentation.Value.Draw(spriteBatch);
                    }
                }

                foreach (var archipelagoRepresentation in archipelagoRepresentations)
                {
                    if (!archipelagoRepresentation.Key.AsDynamic().IsScrolledOff)
                    {
                        archipelagoRepresentation.Value.Draw(spriteBatch);
                    }
                }
            }
        }
Esempio n. 4
0
        public override void Draw(SpriteBatch spriteBatch, SpriteFont menuFont)
        {
#if DEBUG
            var levelId = LevelReflected._id;
            var text    = $"Level: {levelId}, Room ID: {currentRoom.ID}";

            var inGameZoom = (int)TimeSpinnerGame.Constants.InGameZoom;

            using (spriteBatch.BeginUsing(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp))
                spriteBatch.DrawString(menuFont, text, new Vector2(30, 130), Color.Red, inGameZoom);
#endif
        }
        public void Draw(SpriteBatch spriteBatch, Rectangle backdropArea, int iconSize)
        {
            var background = backgrounds[currentBackground];
            var size       = iconSize / 2;

            using (spriteBatch.BeginUsing(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointWrap))
            {
                for (var x = 0; x < backdropArea.Width; x += size)
                {
                    for (var y = 0; y < backdropArea.Height; y += size)
                    {
                        DrawBackground(spriteBatch, background, new Rectangle(x, y, size, size));
                    }
                }
            }
        }
Esempio n. 6
0
        void DrawSeedRepresentation(SpriteBatch spriteBatch, SpriteFont menuFont)
        {
            var zoom             = (int)TimeSpinnerGame.Constants.InGameZoom;
            var menuDrawPosition = ((object)Dynamic._primaryMenuCollection).AsDynamic().DrawPosition;

            seedRepresentation.IconSize = menuFont.LineSpacing * zoom;

            var seedStringSize             = menuFont.MeasureString(seedMenuEntry.Text + " ") * zoom;
            var seedRepresentationDrawArea = new Point(
                (int)menuDrawPosition.X + ((int)seedStringSize.X / 2),
                (int)menuDrawPosition.Y - ((int)seedStringSize.Y / 2));

            seedRepresentation.SetDrawPoint(seedRepresentationDrawArea);

            using (spriteBatch.BeginUsing(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp))
                seedRepresentation.Draw(spriteBatch);
        }
        public override void Draw(SpriteBatch spriteBatch, SpriteFont menuFont)
        {
            if (!IsUsedAsSeedSelectionMenu || !GameScreen.IsActive)
            {
                return;
            }

            using (spriteBatch.BeginUsing(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp))
            {
                var zoom = (int)TimeSpinnerGame.Constants.InGameZoom;

                var yPosition = ScreenManager.SmallScreenRect.Y + 40 * zoom;

                DrawBackdrop(spriteBatch, yPosition, zoom);
                DrawSeedString(spriteBatch, menuFont, yPosition, zoom);
            }
        }
Esempio n. 8
0
        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.Black);

            backgroundRenderer.Draw(spriteBatch, graphics.GraphicsDevice.Viewport.Bounds, trackerRenderer.IconSize);

            if (trackerState != null)
            {
                trackerRenderer.Draw(spriteBatch, trackerState);
            }
            else
            {
                using (spriteBatch.BeginUsing(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp))
                    spriteBatch.DrawString(font, "Awaiting data", new Vector2(8, 8), Color.Black);
            }

            base.Draw(gameTime);
        }