Trait primitives::prelude::EngineFactory [−][src]
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 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.
fn is_decached(&self) -> bool
fn is_decached(&self) -> bool
A convenient switch to force all loaded content to be freshly loaded each request (rather than caching).
fn is_eyecandy_option_enabled(&self) -> bool
fn is_eyecandy_option_enabled(&self) -> bool
Disable to hide any eye candy options.
fn is_fullscreen_option_enabled(&self) -> bool
fn is_fullscreen_option_enabled(&self) -> bool
Disable to hide any full screen options.
fn is_reset_sessions_option_enabled(&self) -> bool
fn is_reset_sessions_option_enabled(&self) -> bool
Disable to hide any session resetting options.
fn fullscreen_type(&self) -> FullScreen
fn fullscreen_type(&self) -> FullScreen
The default scaling used for fullScreen mode.
fn joypad_touch_type(&self) -> JoypadTouch
fn joypad_touch_type(&self) -> JoypadTouch
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.
fn target_framerate(&self) -> i32
fn target_framerate(&self) -> i32
The intended frequency of the update broad phase traversal stack. Technical limitations may prevent desired framerate from occurring.
fn is_fixed_updates(&self) -> bool
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).
fn starting_scene_type(&self) -> SceneKind
fn starting_scene_type(&self) -> SceneKind
The scene which is displayed first. The application starts here.
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.
fn key_special(&self) -> Key
fn key_special(&self) -> Key
The default key used in this application to do a special action (determined by the specific application).
fn on_init_complete(&self, kernel: Box<dyn Kernel>)
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.
fn create_asset_manager(&self) -> Box<dyn AssetManagerProcess>
fn create_asset_manager(&self) -> Box<dyn AssetManagerProcess>
Builds the application’s asset manager which store images, sounds etc. Return Asset manager.
fn create_encrypter(&self) -> Box<dyn Encrypter>
fn create_encrypter(&self) -> Box<dyn Encrypter>
Builds the application’s encrypter to encrypt sensitive data / assets. Return Encrypter to encrypt sensitive data / assets.
fn create_logger(&self) -> Box<dyn Logger>
fn create_logger(&self) -> Box<dyn Logger>
Builds the application’s logger to log events / analytics. Return Logger to log events / analytics.
fn create_overlay(&self) -> Box<dyn OverlayProcess>
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.
fn create_preloader(&self) -> Box<dyn Preloader>
fn create_preloader(&self) -> Box<dyn Preloader>
Builds the application’s preloader to load initial media assets. Return Preloader to load initial media assets.
fn create_scene(&self, kind: SceneKind) -> Box<dyn EngineScene>
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.
fn create_scene_transition(
&self,
kind_incoming: Option<SceneKind>,
kind_outgoing: Option<SceneKind>
) -> Box<dyn SceneTransition>
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)
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)
fn create_text_style(&self, kind: Option<TextStyleKind>) -> Box<dyn TextStyle>
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)
fn get_back_scene_type(&self, kind: SceneKind) -> SceneKind
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.
fn get_next_scene_type(&self, kind: SceneKind) -> SceneKind
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.