v0.3.0
Highlights
For the full log see below.
- New
SceneGraph
nodes to handle different viewports, frame buffers, and materials (shaders, blend modes,
depth/stencil modes). - New input and unhandled input handling inside a
SceneGraph
. - New lifecycle methods added to Nodes in a
SceneGraph
:preUpdate()
,postUpdate()
andfixedUpdate()
. - Major optimizations and clean up of the
SceneGraph
in general. Camera
&Viewport
relationship refactoring to make more sense. See full changelog for more info.AnimationPlayer
playback clean up and add few additional playback methods- New optional
AnimationStateMachine
withinAnimationPlayer
. - New shape, lines, and path drawing class
ShapeRenderer
.
Breaking
-
refactor
Viewport
to contain an internalCamera
and removeViewport
fromCamera
.Migration:
Before:
val viewport = ExtendViewport(480, 270) val camera = OrthographicCamrea().apply { this.viewport = viewport }
New:
val viewport = ExtendViewport(480, 270) val camera = viewport.camera
-
remove
SceneGraph.viewport: Viewport
andSceneGraph.camera
and replaced with theViewportCanvasLayer
node.Migration:
Before:
val viewport: Viewport = graph.viewport val camera: Camera = graph.camera
After:
val viewport: Viewport = graph.sceneCanvas.viewport val camera: Camera = -graph.sceneCanvas.canvasCamera
-
update
SceneGraph.initialize()
to be suspending. -
update
SceneGraph.Node.initialize()
to be suspending. -
rename
Node2D.toWorld
functions totoGlobal
. -
update
Vec2f.rotate
to useAngle
instead of a float.Migration:
Before:
val vec = MutableVec2f() val angle: Angle = 45.degrees vec.rotate(angle.degrees)
After:
val vec = MutableVec2f() val angle: Angle = 45.degrees vec.rotate(angle)
New
- add: list of catching keys to prevent default platform functionality from performing on key events
- add:
loadSuspending
toAssetProvider
to load assets as a suspending function instead loading inside a coroutine - add:
onDestroy
open function andonDestroy
signal toNode
whendestroy()
is invoked. - add: contracts to
SceneGraph
DSL to allow usage of assigning objects toval
outside of it. - add: contract to
AssetProvider.prepare()
to allow usage of assigning objects toval
outside of it. - add:
CanvasItem
node as the base node for 2D transformations in theSceneGraph
.Node2D
now inherits directly
from this node. - add:
CanvasLayer
node that creates a separateOrthographicCamera
for rendering instead of inheriting the base
camera from theSceneGraph
. For example: When rendering certain nodes at a low resolution using aViewport
to
render UI at a higher resolution. This contains an instance to aViewport
but isn't used directly to render
children. A new node calledViewportCanvasLayer
can be used to render children nodes with a separate viewport. - add:
ViewportCanvasLayer
to use separateViewport
to render children nodes in aSceneGraph
. - add:
FrameBufferNode
which is aCanvasLayer
to allow rendering children nodes directly to aFrameBuffer
.
TheFrameBuffer
texture is then available to be rendered in a separate node. - add:
FrameBufferContainer
control node which can be used to help render aFrameBufferNode
. - add:
zoom
,near
, andfar
properties toCamera2D
which will be used to set theCanvasLayer.canvasCamera
properties before rendering. - add:
scale
property to therender
method ofLDtk
andTiled
tile maps. - add:
tmod
andtargetFPS
properties toSceneGraph
to be used as another way to handle frame independent
movements. - add: three new lifecycle calls to a
Node
:onPreUpdate
,onPostUpdate
, andonFixedUpdate
as well as their
respectiveSignal
types. TheonFixedUpdate
comes with a few more properties to handle changing the fixed time step
and as well as an interpolating ratio.SceneGraph.fixedTimesPerSecond
: can be used to set the amount of timesonFixedUpdate
is call per secondSceneGraph.fixedProgressionRatio
: is an interpolation ratio that can be used to render nodes that
useonFixedUpdate
for movement / physics.
- add:
input
andunhandledInput
callbacks to allNode
.input
: is called whenever there is anInputEvent
generated and is propagated up the node tree until a node
consumes it.unhandledInput
: is called when anInputEvent
isn't consumed byinput
or the UI.
- add:
resizable
,maximize
, andwindowPosition
configuration parameters to JVM. - add:
ppu
andppuInv
properties toSceneGraph
andNode
that allow setting the Pixels per Unit which is used
for rendering. - add:
Material
class and property toCanvasItem
that can be used to set and change shaders, blend modes, and
depth/stencil modes. - add:
AnimationState
optional state machine stack that can be to register animation states that will be played based
on a predicate. - add:
CropType
options toTexturePacker
:NONE
,FLUSH_POSITION
, andKEEP_POSITION
. - add:
ShapeRenderer
class to handle drawing shapes, lines, and paths using aBatch
instance and aTextureSlice
.
Changes
- update:
SceneGraph
methodsresize()
,render()
, andinitialize()
asopen
. - update:
AnimationPlayer
to handle the way animations are queued and played back based on a stack.
Bugs:
- fix: clearing signals of all existing nodes when destroyed.
- fix:
LDtk
auto tile maps now only loop through tiles within the view bounds instead of all the tiles.