Releases: greenthepear/egriden
Releases · greenthepear/egriden
v0.2.1 Patch
Small patch to make working with pointers easier, also a new little example!
Check out CHANGELOG.md and https://pkg.go.dev/github.com/greenthepear/egriden.
Changes:
- Changed signature of
(Gobject).OnDrawFunc
and(Gobject).OnUpdateFunc
functions by adding aself Gobject
parameter. This removes confusing pointer stuff that happens when you want to make aBaseGobject
with custom functions like so:o := NewBaseGobject(...) o.OnDrawFunc = func (i *ebiten.Image, l Layer) { o.NextFrame() //Won't do anything! //Just changes the frame of the original gobject 'template' which will //not be running in the game, since that's what o points to. o.DrawSprite(i, l) } l.AddGobject(o.Build(), 0, 0)
- Also added a
l Layer
parameter to(Gobject).OnUpdateFunc
for convenience. Getting the object's layer pointer into theOnUpdate
function was tricky beforehand.
- Also added a
- Fixed the small issue that
(Gobject).OnUpdate
would never run ever. - Added a new simple example gopher-party to showcase many things added in v0.2.0 and this patch.
- Updated Ebitengine to v2.7.5.
- Updated localization files.
v0.2.0 "Liberty"
Release v0.2.0 "Liberty" is here! This is a BIG update that I'm very excited about, as it has pretty much all you need to publish a small game. Why "Liberty"? Because now you can have some freedom from the grid layers with traditional free layers, while getting useful utilities for the former. You now also have more control over sprite drawing. Oh and levels, no need to be confined to a single view/scene.
Check out CHANGELOG.md and https://pkg.go.dev/github.com/greenthepear/egriden.
Changes:
- Added free layers which allow you to place and draw objects anywhere on the screen according to their XY coordinates.
- Added levels, an interface for them and methods for
BaseLevel
.(*EgridenAssets).InitEgridenAssets()
now creates a default level.(*EgridenAssets).InitEgridenAssets()
was renamed from(*EgridenAssets).InitEgridenComponents()
.
- Added methods for deleting and moving Gobjects within a grid layer:
(*GridLayer).DeleteAt()
,(*GridLayer).MoveGobjectTo()
. - Added
(SpritePack).DrawOptions
field and(Gobject).SetDrawOptions
method, allowing you to customize rendering of sprites usingebiten.DrawImageOptions
. You can now also apply offsets for sprites with the new(Gobject).SetDrawOffsets()
method. - Added
(GridLayer).IsXYwithinBounds()
,(GridLayer).IsScreenXYwithinBounds()
,ScreenXYtoGrid()
andSnapScreenXYtoCellAnchor()
to make interactions between the screen (cursor) and grid layers easier. - Removed
baseGobjectWithoutScripts
, you can use the new(BaseGobject).OnDrawFunc
and(BaseGobject).OnUpdateFunc
fields to assign scripts, which are nil by default. - Made layer selection methods return nil instead of panicing if z is out of bounds.
- Renamed
(*GridLayer).AddObject
to(*GridLayer).AddGobject
. - More tests and bug fixes.
- "Updated" to go v1.22.3 and Ebitengine v2.7.3.
- Updated localization files.