public InterfaceInputManagerTestScene() { inputActionHandler = new TestInputActionHandler(new RaylibInputs()); var screenStack = new ScreenStack { Size = new Vector2(500, 400), Offset = new(100) }; AddChild(screenStack); var screen1 = new Screen(); screenStack.Push(screen1); screen1.AddChild(new Rectangle { RelativeSizeAxes = Axes.Both, Color = new(100, 200, 50) });
public void NextComponentActionTest() { var inputs = new FakeInputs(); var inputActionHandler = new TestInputActionHandler(inputs); inputActionHandler.Propagator.Listeners.Add(interfaceInputManager); interfaceInputManager.NextComponentAction = TestAction.Action1; Assert.IsEmpty(interfaceInputManager.FocusedComponents); inputs.PushKey(KeyboardKey.KEY_A); inputActionHandler.Update(); inputs.ReleaseKey(KeyboardKey.KEY_A); inputActionHandler.Update(); AssertContains(component1, interfaceInputManager.FocusedComponents); }