Oak 2.0.0
Full Changelog:
alg
:
alg
has several new operations for working with degrees and radians.alg/floatgeom
has several new operations on points, includingNormalize
,Magnitude
,Dot
,DivConst
, andProject<X/Y/Z>
alg/floatgeom
now has aTriangle
type, with minimal current functionality.alg/intgeom
is now parallel in API toalg/floatgeom
, with only some functions that relied on floating point math removed.alg
has the new functionF64eqEps
which allows for the specification of the epsilon used for floating point equality.alg.WeightedChoose
has been removed.alg.CumWeightedChooseOne
has been renamed toalg.WeightedChooseOne
.alg.CumWeightedFromMap
has been renamed toalg.WeightedMapChoice
.alg.RemainingWeights
has been added, alike toalg.CumulativeWeights
, but with a change to the position of the total weight index.
audio
:
audio.Audio.Get<X/Y>()
have been renamed to<X/Y>p()
.audio.SupportsPos
has been changed to requireXp()
andYp()
in accordance.- Several errors returned by
audio
have been changed tooakerr
error types.
collision
:
- The library github.com/200sc/rtreego, which was a fork of a fork, has been brought into Oak entirely and operates directly on
collision
struct types instead of on interfaces. Some math functionality required for this was split off and brought intoalg/floatgeom
instead. These files are subject to thertree-LICENSE
license file. collision.Point
is now composed offloatgeom.Point3
instead ofphysics.Vector
- The subpackage
collision/ray
has been added to replace previous ray casting functionality. - All previous raycasting functionality has been removed, use
collision/ray
instead. - Previous
rtreego.Rect
s have been replaced withfloatgeom.Rect3
s. collision.Space.GetX()
andGetY()
have been renamed toX()
andY()
.collision.Tree.UpdateLabel
andcollision.Tree.UpdateSpaceRect
have been added- Several errors returned by
collision
have been changed tooakerr
error types.
dlog
:
- Previous
dlog
functionality is now built into the privatelogger
type, which will be used by default. dlog.SetLogger
allows for the specification of a user-made logger to replace the private type. EitherLogger
orFullLogger
, a superset ofLogger
, can be implemented by arguments toSetLogger
.- Log levels now have an explicit type,
dlog.Level
. - Disabling logging with the
nolog
build tag has been disabled, use a NOP custom logger implementation instead. - Input debug level strings are no longer case sensitive.
entities
:
- Almost all constructors in this package have changed to accommodate the ability to set the
collision.Tree
of createdcollision.Space
s, or for more realistic use in examples. - Several miscellaneous utilities have been added to the existing types here.
event
:
- Operations on this package now operate on a default
event.Bus
type, and custom event buses can be constructed for more fine management of event propagation. Events onevent.CID
s operate on this default bus as well. - The
event.Handler
interface has been added and can be used to replace the event package with a custom event handler from within the main Oak package.
examples
:
- Many new examples have been added. Some of these were previously external repositories.
fileutil
:
fileutil.ReadFile
uses the same double-checking thatfileutil.Open
has used iffilepath.Rel
fails.
mouse
:
mouse.LastMousePress
has been renamedmouse.LastPress
mouse.LastMouseEvent
has been renamedmouse.LastEvent
mouse.Event
is now composed of afloatgeom.Point2
instead of manual X and Y fields.mouse.NewEvent
andmouse.NewZeroEvent
helpers for constructing mouse events have been added.Event.ToSpace()
has been added, to convert a mouse event into a miniscule collision space.- "Click" events will be properly triggered now.
oakerr
:
- Several new error types have been added.
physics
:
Vector.GetX()
andVector.GetY()
have been removed.NewVector32
andPtrVector
have been added as additional constructors forphysics.Vector
s.
render
:
Renderable.UnDraw
is nowUndraw
render.Animation
has been removed and folded intorender.Sequence
.render.Composite
had been renamed torender.CompositeM
.- Support for adding custom image decoders has been added through
render.RegisterDecoder
. - Package global
NewText
constructors have been added as equivalent torender.DefFont.NewText
, etc. render.Draw
,render.DrawColor
,render.DrawForTime
, andrender.LoadSpriteAndDraw
now take in a variadic set of layers.render.Addable
has been renamed torender.Stackable
.Addable/Stackable.Add
now takes in variadic layer arguments.render.SetDrawPolygon
and otherDrawPolygon
functions have been moved to a struct.render.ReplaceDraw
has been removed.render.Layered
has been renamed toLayer
.render.Layered
is now an interface describing layering functionality.render.DrawLineOnto
has been renamed torender.DrawLine
render.LoadSprite
,render.LoadSheet
,render.GetSprite
, andrender.GetSheet
have all new signatures and functionality to be more consistent.render.Modification
has been changed torender/mod.Mod
, and is now paired withrender/mod.Filter
, for transformations that operate in place.- All
render.Modification
functions that were inrender
can now be found inrender/mod
- Several constructors that previously took slices in
render
now take variadic inputs. render.BoundingRect
andrender.WrappingContains
have been removed.render.Positional
is a new interface that describes the positional requirements of aRenderable
.render.Sequence
now have the functionSetFPS
to change animation speed after initialization.- Previous
Animation
functionality is now in the constructorNewSheetSequence
. render.Sheet
can be converted to a 2D slice of sprites throughToSprites
.render.Compound
has been renamed torender.Switch
.- Many errors are now using
oakerr
error types.
render/mod
:
- Previous
render.Modification
s have been split into two categories,Transform
s orMod
s, that create new images, andFilter
s, that operate in place. - Several new modifications are present here, many from gift.
render/particle
:
- Particles no longer have
String
functions. - In addition to
Size
, generators now have anEndSize
field for shifts in size over the particle lifespan.
scene
:
- This is a new package which holds functionality previously in the Oak main package. No additional functionality relative to what was previously in the main package has been changed or added, except that private functions on scene maps have been exported.
timing
:
ForceStep
has been added totiming.DynamicTicker
, which acts just asStep
but will block until the tick is accepted (if it ever is).
oak
:
Config.DisableKeyhold
has been removed. Keyhold functionality is always on, as it no longer has a significant perfomance hit.Config.LoadBuiltinCommands
has been added. In order to use the built in commands described in the debugConsole files, this must be true.Screen.X
andScreen.Y
have been added for managing the initial position of a screen.- All uses of "golang.org/x/exp/shiny" have been replaced with "github.com/oakmound/shiny"
AddCommand
will now return an error if a command added would overwrite an existing command.- Two new builtin commands
move
andfullscreen
, for moving the position of the window and toggling fullscreen mode, have been added. - Added Commands no longer use the prefix
c
. They no longer have any prefix, a function bound tofoo
will be triggered by the command line input offoo
. Built in commands can fail to be added if you already use their names in a user command. Driver
is a new function type allowing Oak to be built on top of any underlying graphics / window management driver. By default, this will use shiny'sMain
driver, which itself splits to different drivers depending on OS. Shiny provides an alternative, which we do not include in Oak (as it uses C) but do note the existence of, that uses OpenGL ES:shiny/driver/gldriver.Main
.- The
FullScreenable
interface andSetFullScreen
have been added to manage window full screen support. - The
MoveableWindow
interface andMoveWindow
have been added to manage manual window positioning. SetLogicHandler
can be used to overwrite the use of theoak/event
package with custom event handling.- All Oak operations relating to scenes can now be found in the
scene
package, with the exception ofAdd
andAddScene
. - Oak's previously private scene map has been exported as
SceneMap
.
Breaking API Changelog:
- All previous uses of
alg/intgeom
will be almost certainly invalid now, as almost all types and functions in the package have changed signatures. This also applies for libraries in oak that usedintgeom
, such asshape
. alg.WeightedChoose
has been removed.alg.CumWeightedChooseOne
has been renamed toalg.WeightedChooseOne
.alg.CumWeightedFromMap
has been renamed toalg.WeightedMapChoice
.audio.Audio.Get<X/Y>()
have been renamed to<X/Y>p()
.audio.SupportsPos
has been changed to requireXp()
andYp()
in accordance.- All previous raycasting functionality has been removed, use
collision/ray
instead. collision.Space.GetX()
andGetY()
have been renamed toX()
andY()
.oak.Config
and the structs underlying it have had several changes.- Added Commands no longer use the prefix
c
. They no longer have any prefix, a function bound tofoo
will be triggered by the command line input offoo
. Built in commands can fail to be added if you already use their names in a user command. - Disabling logging with the
nolog
build tag has been disabled, use a NOP custom logger implementation instead. - Almost all constructors in the
entities
package have changed to accommodate the ability to set thecollision.Tree
of createdcollision.Space
s, or for more realistic use in examples. - All Oak operations relating to scenes can now be found in the
scene
package, with the exception ofAdd
andAddScene
. physics.Vector.GetX()
andphysics.Vector.GetY()
have been removed.render.Animation
has been removed and folded intorender.Sequence
.render.Composite
had been renamed torender.CompositeM
.render.Draw
,render.DrawColor
,render.DrawForTime
, andrender.LoadSpriteAndDraw
now take in a variadic set of layers.render.Addable
has been renamed torender.Stackable
.render.Addable/Stackable.Add
now takes in variadic layer arguments.render.SetDrawPolygon
and otherDrawPolygon
functions have been moved to a struct.render.Layered
has been renamed toLayer
.render.DrawLineOnto
has been renamed torender.DrawLine
render.LoadSprite
,render.LoadSheet
,render.GetSprite
, andrender.GetSheet
have all new signatures and functionality to be more consistent.render.Modification
has been changed torender/mod.Mod
, and is now paired withrender/mod.Filter
, for transformations that operate in place.- All
render.Modification
functions that were inrender
can now be found inrender/mod
render.BoundingRect
andrender.WrappingContains
have been removed.render.Compound
has been renamed torender.Switch
.Renderable.UnDraw
is nowUndraw
.- Several constructors that previously took slices in
render
now take variadic inputs.