-
Notifications
You must be signed in to change notification settings - Fork 3
Core
The core of Pile. Contains the main loop and takes care of Core Module initialization as well as Pile's built in application entry point. Provides a main function. See the Getting Started guide on how to set up a project.
Defaults contains the default values for different constructors, such as the default TextureFilter for Textures.
Core.Title is the name of the application (set in Config.gameTitle), not necessarily the window title. While it is also used as the default window name, it shouldn't be used as the primary way to set it (See Window). Title is also used to create System.UserPath (for example Documents/My Games/ExampleGame/), thus should not change and be a rather constant application or project name. The window title should be set through Config.windowTitle (or System.Window.SetTitle(...) afterwards).
The OnStart event is called just before Core.Run is called. If any call returns .Err the application will exit directly. Note that OnStart is not called in Packager mode since the application will exit before that point.
Config are the settings Core.Run will be run with. Config.gameTitle and Config.createGame have to be set during static initialization (or an OnStart callback). Config.windowWidth and Config.windowHeight defaults to 720p. Other options like windowState and windowTitle can be set optionally.
Core.Run(...) is the function run to start Pile. You won't have to interact with it since it will be called by Main automatically to start the game with the parameters set in Core.Config. This call has to happen before using Pile features that depend on Core Module functionality. It initializes Core Modules (includes creating/opening a window) among other things and then starts running the Game instance. This contains the core loop.
Core.Exit() tells Core to stop running the Game instance the next time a loop is completed. This closes the application.
Core.Sleep(uint ms) tells Core to suspend the core loop for that amount of milliseconds. It's basically a way for you to Sleep() the main thread at a controlled time after the frame. The game itself will not be aware of the sleep time (Time.Delta etc. wont include the sleep time).
See Getting Started, Template Project or Packager.