Пример #1
0
        public void Draw()
        {
            _battleManager.Draw("02doukutsu");
            _dialog.Draw(new Rect(200, 330, 440, 150));

            if (battleState == BattleStateEnum.Idle)
            {
                _iconManager.Draw("attack", new Vector(50, 350), ColorStruct.White * (_inputManager.IsPressedKey((int)Keys.Up) ? 1f : 0.7f));
                _iconManager.Draw("magic", new Vector(20, 380), ColorStruct.White * (_inputManager.IsPressedKey((int)Keys.Left) ? 1f : 0.7f));
                _iconManager.Draw("defend", new Vector(80, 380), ColorStruct.White * (_inputManager.IsPressedKey((int)Keys.Right) ? 1f : 0.7f));
                _iconManager.Draw("item", new Vector(50, 410), ColorStruct.White * (_inputManager.IsPressedKey((int)Keys.Down) ? 1f : 0.7f));
                _iconManager.Draw("run", new Vector(20, 410), ColorStruct.White * 0.7f);
            }

            var i = 0;

            foreach (var actor in Party.Actors)
            {
                DrawActor(i);
                DrawActorInfo(i, actor);
                i++;
            }

            // draw enemies
            _enemyManager.Draw("DarkTroll", 60, 200);

            // draw effects
            foreach (var effect in Effects)
            {
                effect.Draw();
                effect.Update();
                if (effect.Lifespan <= 0)
                {
                    Effects.Remove(effect);
                    break;  // can't iterate enumeration after removing, ok since we should never really need to have multiple effects die at once
                }
            }
        }
Пример #2
0
        public void DrawEvent(EventPage eventPage, Vector pos)
        {
            if (string.IsNullOrEmpty(eventPage.ImageKey))
            {
                return;
            }

            switch (eventPage.ImageType)
            {
            case ImageType.Icon:
                _iconManager.Draw(eventPage.ImageKey, eventPage.TilesetSource, new Rect(pos.X, pos.Y, eventPage.TilesetSource.Width, eventPage.TilesetSource.Height));
                break;
                //case ImageType.Tileset:
                //    _tilesetManager.Draw(eventPage.ImageKey, )
            }
        }