0.0.7
Pre-release--System--
System subclasses now support async/await**
func setup(game: Game, input: HID) async {}
func shouldUpdate(game: Game, input: HID, withTimePassed deltaTime: Float) async -> Bool {}
func update(game: Game, input: HID, withTimePassed deltaTime: Float) async {}
System and RenderingSystem now have a highPrecisionDeltaTime property.
//System
override func update(game: Game, input: HID, withTimePassed deltaTime: Float) async {
let timeInterval = self.highPrecisionDeltaTime
}
//RenderingSystem
override func render(game: Game, window: Window, withTimePassed deltaTime: Float) {
let timeInterval = self.highPrecisionDeltaTime
}
You can use this value when accumulating durations such as with timers.
--GameDelegate--
On iOS and iPadOS you can create a window for an AirPlay screen, allowing you to draw your game on both the device and a TV or Mac display.
func screenBecomeAvailable(game: Game) throws -> Window? {
return try game.windowManager.createWindow(identifier: "external display window")
}
On iPadOS you can now create multiple windows, and users can also request windows. This allows GateEngine to be used for document based apps if you want.
func userRequestedWindow(game: Game) throws -> Window? {
return try game.windowManager.createWindow(identifier: "userwindow")
}
--Input--
You can check which input method was used last. This is helpful for updating UI to display the correct prompts for a user to presss.
if input.recentInputMethod == .mouseKeyboard {
text.string = "Press Spacebar!"
}else if input.recentInputMethod == .gamepad {
text.string = "Press \(gamePads.any.button.confirmButton)!"
}
Mouse Buttons now allow you to check for repetition based gestures that respect the users preference for multi-click duration.
if input.mouse.button(.primary).isPressed(ifDifferent: &inputRecipts, andGesture: .doubleClick) {
// Double Clicked!
}
You can also check the count yourself for gamplay style combo stuff
let numClicks = input.mouse.button(.primary).pressCount
You can now track scroll input
if input.mouse.scroller(.horizontal).didScroll(ifDifferent: &inputRecipts) {
// Scrolled along x
}
--Other--
- On macOS window size, position, and full screen state are now remembered for every window and restored on launch.
- On HTML5 fixed an issue where mouse lock failed to behave as expected.