You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create utility classes and methods to smooth usage of engine featues
Note
These features are to be delayed after release of 0.1.0.
1. Asset Registry
What is it?
A registry that holds loaded assets to be used
How the user uses it:
inside any block, it calls it similar to this:
resources {
texture("player.png")
sound("jump.wav")
font("ui.ttf", size =18)
} // Load data in batch
Problems:
Handle resources lifetime, scope, etc...
Lazy asset loading
What is it?
Simple lazy asset loading
How the users use it?:
val playerTexture by asset<Texture>("player.png")
Screen utilities
What is it?
Utilities for transition, load, unload screens
How users would use it?
// Load into a registry - can be used for fast loads
app.load{ Screen() }
app.transition<Screen>(){
// transition config
}
Manager utilities
What is it?
Utility methods for managers, instead of explicit holding references to them
How would users use it?
scene{
// use scene manager
}
inject<Type>() // same as ManagersRegistry.get(InjectionManager::class).inject<Type>()// lazy versionval physics by inject<PhysicsSystem>()
Goal
Create utility classes and methods to smooth usage of engine featues
Note
These features are to be delayed after release of
0.1.0.1. Asset Registry
What is it?
A registry that holds loaded assets to be used
How the user uses it:
inside any block, it calls it similar to this:
resources { texture("player.png") sound("jump.wav") font("ui.ttf", size = 18) } // Load data in batchProblems:
Lazy asset loading
What is it?
Simple lazy asset loading
How the users use it?:
Screen utilities
What is it?
Utilities for transition, load, unload screens
How users would use it?
Manager utilities
What is it?
Utility methods for managers, instead of explicit holding references to them
How would users use it?
scene{ // use scene manager } inject<Type>() // same as ManagersRegistry.get(InjectionManager::class).inject<Type>() // lazy version val physics by inject<PhysicsSystem>()