logo
pub trait EngineFactory {
Show 34 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

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

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

The author or this specific project.

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

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

Disable to hide any eye candy options.

Disable to hide any full screen options.

Disable to hide any session resetting options.

The horizontal width of this application’s bounding rectangle.

The vertical height of this application’s bounding rectangle.

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

The default scaling used for fullScreen mode.

The default handler for joypadTouch mode.

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

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

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).

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

The default key used in this application to pause updates.

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

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

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

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

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.

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

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

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

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

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

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

  • kind - The type of scene.

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)

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)

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

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

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.

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