Beispiel #1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            ScreenService.Instance.GraphicsDevice.Viewport = ScreenService.Instance.DefaultScreenCamera.CurrentViewport;
            spriteBatch.Begin(
                SpriteSortMode.FrontToBack, // this is also the order for building the screen.
                null,
                SamplerState.PointClamp,
                null,
                null,
                null,
                ScreenService.Instance.DefaultScreenCamera.TransformMatrix);
            base.Draw(spriteBatch);

            if (!Images.Any())
            {
                Messages.Add("no image received from server");
            }
            foreach (var img in Images.ToList())
            {
                img.Draw(spriteBatch);
            }

            if (!InventoryImages.Any())
            {
                Messages.Add("no inventory image received from server");
            }
            foreach (var img in InventoryImages.ToList())
            {
                img.Draw(spriteBatch);
            }

            MultiplayerText.Draw(spriteBatch);
            HealthImage.Draw(spriteBatch);
            SpeedImage.Draw(spriteBatch);
            StrenghImage.Draw(spriteBatch);
            DialogImage.Draw(spriteBatch);
            CursorImage.Draw(spriteBatch);

            //LerpMouseImage.Draw(spriteBatch);

            if (InfoWindow?.IsVisible == true)
            {
                InfoWindow?.Draw(spriteBatch);
            }

            if (DialogWindow?.IsVisible == true)
            {
                DialogWindow?.Draw(spriteBatch);
            }

            if (InventoryWindow?.IsVisible == true)
            {
                InventoryWindow.Draw(spriteBatch);
            }

            if (CharacterWindow?.IsVisible == true)
            {
                MoneyCount.Draw(spriteBatch);
                CharacterWindow?.Draw(spriteBatch);
            }

            if (CharacterWindow?.IsVisible == true)
            {
                CharacterWindow?.Draw(spriteBatch);
            }

            if (ChatWindow?.IsVisible == true)
            {
                ChatWindow?.Draw(spriteBatch);
            }

            spriteBatch.End();
        }