Example #1
0
 public void PushScene(Scene scene)
 {
     if (GameStates.ActiveState != null)
     {
         GameStates.ActiveState.Pause();
     }
     GameStates.Push(scene);
 }
Example #2
0
        public KeyboardInput(Torch.Scene scene, Torch.Object parent) : base(scene, parent)
        {
            var keyboard = ((InputManager)scene.Game.Services.GetService(typeof(IInputService))).GetKeyboard();

            keyboard.KeyPressed += HandleKeyDown;

            _controls.Add("left", Keys.A);
            _controls.Add("right", Keys.D);
            _controls.Add("up", Keys.W);
            _controls.Add("down", Keys.S);
            _controls.Add("party menu", Keys.Tab);
            _controls.Add("config menu", Keys.Escape);
            _controls.Add("interact", Keys.E);
        }
Example #3
0
        public DialogLayer(Torch.Scene scene, Dialog dialog)
        {
            InitializeComponent();

            _dialog = dialog;

            _keyboard             = ((InputManager)scene.Game.Services.GetService(typeof(IInputService))).GetKeyboard();
            _keyboard.KeyPressed += OnKeyPress;

            _optionsList.SelectionChanged += (s, a) =>
                                             _dialog.SetOption(_optionsList.SelectedItems.Count > 0 ? _optionsList.SelectedItems[0] : -1);

            _nextButton.Pressed += (s, a) => OnKeyPress(Keys.E);

            InitializeDialog();
        }
Example #4
0
        public BattleBoardLayer(Torch.Scene scene, Torch.Object parent) : base(scene, parent)
        {
            _gui = new GuiManager(
                (GraphicsDeviceManager)Game.Services.GetService(typeof(IGraphicsDeviceManager)),
                (IInputService)Game.Services.GetService(typeof(IInputService))
                );
            _gui.DrawOrder = 0;
            _gui.Initialize();

            _gui.Visualizer = FlatGuiVisualizer.FromFile(Game.Services, "Content/Gui/main_gui.xml");
            ((FlatGuiVisualizer)_gui.Visualizer).RendererRepository.AddAssembly(typeof(FlatGridCellControlRenderer).Assembly);

            Components.Add(_gui);

            ((IInputService)Game.Services.GetService(typeof(IInputService))).GetMouse().MouseButtonPressed += OnMouseButtonPressed;
        }
Example #5
0
        public CreditSlide(Torch.Scene scene, Torch.Object parent) : base(scene, parent)
        {
            var font = FontManager.Get("Menu");

            Components.Add(new TextObject(Game, this)
            {
                Font      = font,
                Color     = Color.White,
                Value     = "Steve Phillips",
                Alignment = TextObject.AlignTypes.Center,
                X         = Game.GraphicsDevice.Viewport.Width / 2,
                Y         = Game.GraphicsDevice.Viewport.Height / 2 - 25
            });

            Components.Add(new TextObject(Game, this)
            {
                Font      = font,
                Color     = Color.White,
                Value     = "George Emond",
                Alignment = TextObject.AlignTypes.Center,
                X         = Game.GraphicsDevice.Viewport.Width / 2,
                Y         = Game.GraphicsDevice.Viewport.Height / 2 + 25
            });
        }
Example #6
0
 public HUD(Torch.Scene scene, Torch.Object parent) : base(scene, parent)
 {
     _interactIcon = new ImageObject(Game, this, "HUD/interacticon");
 }
Example #7
0
 public BackgroundLayer(Scene scene, Torch.Object parent, string image)
     : base(scene, parent)
 {
     Components.Add(new ImageObject(Game, this, image));
 }
Example #8
0
 public XnaSlide(Torch.Scene scene, Torch.Object parent) : base(scene, parent)
 {
 }
Example #9
0
 public Environment(Torch.Scene scene, Torch.Object parent) : base(scene, parent)
 {
 }