Starly is an orthographic camera library for Defold.
Its goal is to provide a feature-rich orthographic camera solution, confined to a single Lua module, where all properties can be edited or animated at runtime. By virtue of focusing solely on 2D, it’s able to implement much more creative and scenario-specific features that a more generalized library would be rightfully hesitant to attempt, due to added complexity and redundancy. In the future, I may add a Starly3D extension to the same repository that focuses solely on 3D.
Although many features are still in the works, here are some of the highlights:
- All camera properties are able to be edited or animated at any time, with immediate updates.
- Four viewport and projection behaviors, suitable to every type of game: center, expand, mixed, and stretch.
- All camera logic and state management is handled in a single Lua module, which means your render script contains exactly 0 lines of camera library code.
- The render script template contains convenience functions for organized predicate and target configuration, automatic predicate and target creation, automatic and custom target resize logic, etc. Despite these features, Starly makes no assumptions about whatever render script you decide to use, and does not require a single line of code to be included in your render script for the library to work.
- Provides proven features you might see in successful games, such as
starly.get_tight_world_area()
, which matches how the camera in Super Smash Bros maintains visibility of all characters and follows their movements.
Note that Starly doesn’t provide a pre-written update()
function in its render script template, should you choose to use it. You can learn more about that decision in the GitHub documentation.
Thanks for reading, and happy Defolding.