Struct amethyst::ApplicationBuilder
[−]
[src]
pub struct ApplicationBuilder<'a, 'b, T: State + 'a> { pub events: EventsLoop, // some fields omitted }
Helper builder for Applications.
Fields
events: EventsLoop
Allows to create RenderSystem
Methods
impl<'a, 'b, T: State + 'a> ApplicationBuilder<'a, 'b, T>
[src]
fn new(initial_state: T) -> Result<Self>
[src]
Creates a new ApplicationBuilder with the given initial game state and display configuration.
fn register<C: Component>(self) -> Self
[src]
Registers a given component type.
fn add_resource<R>(self, res: R) -> Self where
R: Resource,
[src]
R: Resource,
Adds an ECS resource which can be accessed from systems.
fn add_barrier(self) -> Self
[src]
Inserts a barrier which assures that all systems added before the barrier are executed before the ones after this barrier.
Does nothing if there were no systems added since the last call to
add_barrier()
. Thread-local systems are not affected by barriers;
they're always executed at the end.
fn with<S>(self, sys: S, name: &str, dep: &[&str]) -> Self where
S: System<'c> + Send + 'a + 'b,
[src]
S: System<'c> + Send + 'a + 'b,
Adds a given system sys
, assigns it the string identifier name
,
and marks it dependent on systems dep
.
Note: all dependencies should be added before you add depending system
If you want to register systems which can not be specified as dependencies,
you can use "" as their name, which will not panic (using another name twice will).
fn with_thread_local<S>(self, sys: S) -> Self where
S: System<'c> + 'a + 'b,
[src]
S: System<'c> + 'a + 'b,
Adds a given thread-local system sys
to the Application.
All thread-local systems are executed sequentially after all non-thread-local systems.
fn with_renderer(
self,
pipe: PipelineBuilder,
config: Option<DisplayConfig>
) -> Result<Self>
[src]
self,
pipe: PipelineBuilder,
config: Option<DisplayConfig>
) -> Result<Self>
Automatically registers components, adds resources and the rendering system.
fn add_store<I, S>(self, name: I, store: S) -> Self where
I: Into<String>,
S: Store + Send + Sync + 'static,
[src]
I: Into<String>,
S: Store + Send + Sync + 'static,
Add asset loader to resources
fn register_asset<A, F>(self, make_context: F) -> Self where
A: Component + Asset + Clone + Send + Sync + 'static,
F: FnOnce(&mut World) -> A::Context,
[src]
A: Component + Asset + Clone + Send + Sync + 'static,
F: FnOnce(&mut World) -> A::Context,
Register new context within the loader
fn build(self) -> Result<Application<'a, 'b>>
[src]
Builds the Application and returns the result.