EngineFactory

Trait EngineFactory 

Source
pub trait EngineFactory {
Show 34 methods // Required methods fn id(&self) -> String; fn version(&self) -> String; fn author(&self) -> String; fn is_debug(&self) -> bool; fn is_decached(&self) -> bool; fn is_eyecandy_option_enabled(&self) -> bool; fn is_fullscreen_option_enabled(&self) -> bool; fn is_reset_sessions_option_enabled(&self) -> bool; fn width(&self) -> i32; fn height(&self) -> i32; fn bg_color(&self) -> i32; fn fullscreen_type(&self) -> FullScreen; fn joypad_touch_type(&self) -> JoypadTouch; fn secret(&self) -> String; fn target_framerate(&self) -> i32; fn is_fixed_updates(&self) -> bool; fn starting_scene_type(&self) -> SceneKind; fn key_pause(&self) -> Key; fn key_mute(&self) -> Key; fn key_back(&self) -> Key; fn key_next(&self) -> Key; fn key_special(&self) -> Key; fn on_init_complete(&self, kernel: Box<dyn Kernel>); fn create_asset_manager(&self) -> Box<dyn AssetManagerProcess>; fn create_encrypter(&self) -> Box<dyn Encrypter>; fn create_logger(&self) -> Box<dyn Logger>; fn create_overlay(&self) -> Box<dyn OverlayProcess>; fn create_preloader(&self) -> Box<dyn Preloader>; fn create_scene(&self, kind: SceneKind) -> Box<dyn EngineScene>; fn create_scene_transition( &self, kind_incoming: Option<SceneKind>, kind_outgoing: Option<SceneKind>, ) -> Box<dyn SceneTransition>; fn create_session(&self, id: Option<String>) -> Box<dyn Session>; fn create_text_style( &self, kind: Option<TextStyleKind>, ) -> Box<dyn TextStyle>; fn get_back_scene_type(&self, kind: SceneKind) -> SceneKind; fn get_next_scene_type(&self, kind: SceneKind) -> SceneKind;
}
Expand description

The Factory should be implemented by objects designed to populate an implementation.

The Factory represents the blueprint and builder for all project specific classes.

Required Methods§

Source

fn id(&self) -> String

The unique identifier for this specific project. <=16 chars, no spaces.

Source

fn version(&self) -> String

The current version of this specific project. Suggestion: major.minor.revision - e.g. 1.2.345

Source

fn author(&self) -> String

The author or this specific project.

Source

fn is_debug(&self) -> bool

A convenient switch to allow debug modes or verbose output in your code. Adjust as needed.

Source

fn is_decached(&self) -> bool

A convenient switch to force all loaded content to be freshly loaded each request (rather than caching).

Source

fn is_eyecandy_option_enabled(&self) -> bool

Disable to hide any eye candy options.

Source

fn is_fullscreen_option_enabled(&self) -> bool

Disable to hide any full screen options.

Source

fn is_reset_sessions_option_enabled(&self) -> bool

Disable to hide any session resetting options.

Source

fn width(&self) -> i32

The horizontal width of this application’s bounding rectangle.

Source

fn height(&self) -> i32

The vertical height of this application’s bounding rectangle.

Source

fn bg_color(&self) -> i32

The default background color of the application’s bounding rectangle.

Source

fn fullscreen_type(&self) -> FullScreen

The default scaling used for fullScreen mode.

Source

fn joypad_touch_type(&self) -> JoypadTouch

The default handler for joypadTouch mode.

Source

fn secret(&self) -> String

The default secret key used to encrypt data. Set it to something specific for your project, and conceal it’s value.

Source

fn target_framerate(&self) -> i32

The intended frequency of the update broad phase traversal stack. Technical limitations may prevent desired framerate from occurring.

Source

fn is_fixed_updates(&self) -> bool

If true will send the time between each update as if the targetFramerate was hit perfectly. If false will send the actual time between each update (which will vary from update to update).

Source

fn starting_scene_type(&self) -> SceneKind

The scene which is displayed first. The application starts here.

Source

fn key_pause(&self) -> Key

The default key used in this application to pause updates.

Source

fn key_mute(&self) -> Key

The default key used in this application to mute the audio.

Source

fn key_back(&self) -> Key

The default key used in this application to back out of the current scene.

Source

fn key_next(&self) -> Key

The default key used in this application to advance to the next scene.

Source

fn key_special(&self) -> Key

The default key used in this application to do a special action (determined by the specific application).

Source

fn on_init_complete(&self, kernel: Box<dyn Kernel>)

Called by the kernel to complete initialization (due to both requiring an initialized instance of each).

§Arguments
  • kernel - An intialized kernel offering services to the factory.
Source

fn create_asset_manager(&self) -> Box<dyn AssetManagerProcess>

Builds the application’s asset manager which store images, sounds etc. Return Asset manager.

Source

fn create_encrypter(&self) -> Box<dyn Encrypter>

Builds the application’s encrypter to encrypt sensitive data / assets. Return Encrypter to encrypt sensitive data / assets.

Source

fn create_logger(&self) -> Box<dyn Logger>

Builds the application’s logger to log events / analytics. Return Logger to log events / analytics.

Source

fn create_overlay(&self) -> Box<dyn OverlayProcess>

Builds the application’s overlay to decorate and provide top level functionality. Return Overlay to decorate and provide top level functionality.

Source

fn create_preloader(&self) -> Box<dyn Preloader>

Builds the application’s preloader to load initial media assets. Return Preloader to load initial media assets.

Source

fn create_scene(&self, kind: SceneKind) -> Box<dyn EngineScene>

Builds the application’s scenes which contain specific functionality. Return Scene which contain specific functionality.

  • kind - The type of scene.
Source

fn create_scene_transition( &self, kind_incoming: Option<SceneKind>, kind_outgoing: Option<SceneKind>, ) -> Box<dyn SceneTransition>

Builds the application’s transition between scenes. Can be individually tailored for any combination of incoming and outgoing scene. Return Transition between scenes.

  • kind_incoming - The type of the incoming scene. (optional)
  • kind_outgoing - The type of the outgoing scene. (optional)
Source

fn create_session(&self, id: Option<String>) -> Box<dyn Session>

Builds the application’s session to store user progress. Return Session to store user progress

§Arguments
  • id - The unique identifier of the session. If session already exists will load existing. (optional)
Source

fn create_text_style(&self, kind: Option<TextStyleKind>) -> Box<dyn TextStyle>

Builds the application’s textStyle to configure font formatting. Return TextStyle to configure font formatting.

§Arguments
  • kind - The type of textStyle. (optional)
Source

fn get_back_scene_type(&self, kind: SceneKind) -> SceneKind

When a scene is backed out of it will be replaced by the scene returned here. Return Scene type to back out to.

§Arguments
  • kind - Type of scene to back out from.
Source

fn get_next_scene_type(&self, kind: SceneKind) -> SceneKind

When a scene requests the next scene it will be replaced by the scene returned here. Return Scene type to advance to next.

§Arguments
  • kind - Type of scene to advance from.

Implementors§