UnderwaterApps / overlap2d-runtime-libgdx

Overlap2D - UI and Level Editor libgdx runtime
http://overlap2d.com
Other
170 stars 96 forks source link

Add annotation based injection method #4

Closed erodozer closed 9 years ago

erodozer commented 9 years ago

Works like JavaFX, you can easily keep all the main elements you wish to store as instance variables as annotated fields. It casts the elements based on compatibility, so if the item loaded from your Overlap2D project does not match the field type, your application will crash.

Injection works with any object type, not just stages, so you can inject into simple struct like objects or more. Injection may only be called after the scene loader has loaded a scene.

Really this is only done as a fun convenience.

azakhary commented 9 years ago

Thanks! This is great.