Milk2D is a lightweight, hand-rolled 2D game engine written in Go, powered by Ebiten.
- Game objects and component systems
- Rendering and viewport culling
- Asset loading
- Physics
- Scene Management
- Input (mouse,keyboard,gamepad)
- Audio ('player',transitions)
- Particle systems (emitters,affectors,lifetime)
- Event systems (pubsub)
- Optimized Serializer
- Debugging Tools (fps,profiler,inspector,logs)
Currently in early development. Perfect for engine nerds and folks who want to build up from clean primitives.
In order to load sprite you can call the milk2d.LoadSprite
method that will under the hood initialize & cache image under key, when initializing you can specify 'sub rectangle' used as a coords to 'cut out' final image out of original.
cowSprite := milk2d.LoadSprite("test", "/examples/assets/cow.png",0,0 256, 256)
In order to render sprite from center not its 0,0 origin,you can simply toggled centered boolean
cowSprite.SetCentered(true)
If you'd ever like to have outline around an player, let's say when you are hovering with mouse you'd do it like this:
cowSprite.Outline(color.RGBA{
R: 255,
G: 77,
B: 77,
A: 255,
}, 5)