goo2d 0.2.0
goo2d: ^0.2.0 copied to clipboard
The 2D renderer for the good game engine: transforms, camera, sprites, nine-slice borders, colliders and mouse picking, on top of the good kernel, which it re-exports.
0.2.0 #
World space changed direction. Read the first entry before you upgrade a game that has any y in it.
Breaking #
+yis up. It pointed down to match Flutter's canvas, whilegoo3dhas always had+yup, so a game moving between the two had every y-touching system reverse meaning with nothing to catch it. Anything you wrote with a sign in y needs that sign checked: an input binding that yielded-1onWnow walks a player the other way. Sprites are unaffected, since the quad is composed in view space. A positive rotation still turns the same way on screen.- A polygon collider takes its points.
hasPolygonCollidertook only a capacity, so a fixed triangle needed anEntityLifecycleListenerand anonEntityMountedbody to fill in; it now takes the shape as a named parameter like every otherhas*Collider. The eight-vertex cap moved to the physics bridge, sogoo2don its own accepts a longer outline — containment here is an even-odd crossing test, which needs no solver.
Fixed #
-
A collider offset and a sprite pivot take the same sign, and the docs said otherwise.
ColliderBody.containsLocalPointclaimed a collider lining up with an off-centre sprite needed the opposite sign. It does not, and a body placed by that advice sits at twice the offset from where it belongs, on the wrong side. A pivotoffsetYof+20draws the sprite 20 units up; a collideroffsetYof+20puts a body 20 units up. Check the sign on any collider you offset to match a pivot. Nothing about how either one behaves has changed — only what the documentation said about it, anddocs/guide/rendering.mdnow works it through where pivots are explained (#84). -
AudioClipmoved into the kernel. Nothing to do:goo2dre-exports the kernel, so every name is where it was. It moved because a clip has no canvas or dimension in it and a 3D project needs sound too (#93). -
Audio assets load.
AudioLoaderwas written and registered nowhere, so everyAudios.xload threwStateError- the CLI transcoded a clip, keyed it, packed it and shipped it, and the pipeline stopped there.Game2Dregisters it now, through the newdescribeAssetLoaders. This is loading and not playback:goo2dstill has no audio backend, mixer or voice management, so a loadedAudioClipis bytes held in memory. -
Textures decode without a
DrawCanvas2Dbeing built. The texture decoder was registered by that widget's constructor, so a game that built no canvas - a headless boot, a test, a case that starts before its first frame - failed every texture load with an error naming the missing loader rather than the cause.Renderer2Dregisters it now, which means mixing in the renderer is what gets you the decoder. If your game calledAssetLoaders.register<Texture>(const TextureLoader())to work around this, that line is no longer needed; leaving it in is harmless. -
Mouse picking is filtered by the view's scene. The renderer skipped entities outside the scene its view's camera is in and the picker did not, so a click could land on an entity that drew nothing.
goo2d re-exports the good kernel, so its Unreleased entries apply here
too — in particular the profiler coming out of GameState.
0.1.1 #
Documentation only. No code changes.
The README now opens with a runnable example instead of a description.
0.1.0 #
A ground-up rewrite sharing nothing with 0.0.2. Pin ^0.1.0.
The 2D renderer on top of the good
kernel:
- Transforms —
Transform2D, composed world transforms, and the camera. - Rendering — sprites,
SpriteFramefor sampling one region of a texture, nine-slice borders with source-relative cuts, and azIndexsort. - Colliders and mouse picking.
- Audio assets — decoding and the asset pipeline half. There is no audio backend, mixer, or voice management yet.
Not here yet: z-ordering and culling beyond declaration order and the zIndex
sort. Web is unsupported, because the kernel needs dart:ffi and isolates.
0.0.2 #
- An earlier, unrelated iteration of the engine. Superseded entirely by 0.1.0.