public void PushScene(Scene scene) { if (GameStates.ActiveState != null) { GameStates.ActiveState.Pause(); } GameStates.Push(scene); }
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); }
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(); }
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; }
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 }); }
public HUD(Torch.Scene scene, Torch.Object parent) : base(scene, parent) { _interactIcon = new ImageObject(Game, this, "HUD/interacticon"); }
public BackgroundLayer(Scene scene, Torch.Object parent, string image) : base(scene, parent) { Components.Add(new ImageObject(Game, this, image)); }
public XnaSlide(Torch.Scene scene, Torch.Object parent) : base(scene, parent) { }
public Environment(Torch.Scene scene, Torch.Object parent) : base(scene, parent) { }