Releases: littlektframework/littlekt
v0.5.3
v0.5.2
v0.5.1
v0.5.1
Breaking
- Update
EmptyDrawable
to be an immutable singleton object instead of a class. Any attempted changes to this will
throw an exception.- Migration:
val drawable = EmptyDrawable()
toval drawable = createEmptyDrawable()
orval drawable = EmptyDrawable
- Migration:
Changes
-
Update
ScrollContainer
vertical scrollbar to extend the entire height of the container. -
Update
ScrollContainer
add newDrawable
properties that can be overridden. -
Update
Scrollbar
add newDrawable
properties that can be overridden. -
Fix
Scrollbar
grabber height and position not fully reaching the correct position at the end of the scrollbar. -
Adds new child tree positioning methods.
NodeList
updated to use just an array list to handle the indexing as the
multiple collections were not able to handle the movement changes.sendChildToTop()
- sends child to top of parent treesendChildAtToTop()
- sends child at index to top of parent treesendChildToBottom()
- sends child to bottom of parent treesendChildAtToBottom()
- sends child at index to bottom of parent treeaddChildAt()
- adds new child to parent node at specified indexswapChildren()
- swap child positions in the parent treeswapChildrenAt()
- swap children node positions at indices in the parent tree
v0.5.0
Highlights
- Add
ScrollContainer
,VScrollBar
, andHScrollBar
control nodes for scroll handling - Add automatic caching of
Control
theme values when first grabbing the theme value.- For Example:
getThemeDrawable()
will return a result and then is cached in thedrawableCache
map. Any
subsequent calls togetThemeDrawable()
will first check in thedrawableOverrides
and then in
thedrawableCache
map and return a result if it exists. - When a theme owners theme changes, the theme owners and its child control nodes will all have their caches
cleared.
- For Example:
- Add an experimental API for rendering scalable TrueType Fonts (TTF) called
VectorFont
. A sampleVectorFontTest
exists for usage. - Add a
GestureProcessor
interface with aGestureController
input processor to handle gesture detection and
callbacks. Comes with aGestureProcessorBuilder
class for easy callback creation. A helper
extensionInput.gestureController
to easily create and add the gesture controller as an input processor to the
input. - Update default theme colors and tweak default UI assets to be slightly more presentable.
- Add
column
androw
DSL aliases forVBoxContainer
andHBoxContainer
containers.
Breaking
Context.onRender
,Context.onPostRender
,Context.onPostRunnable
, andContext.onResize
are now non-suspending. This fixed issues with the
Android and Web platforms from creating unneeded coroutines every frame. Wrap any suspending calls called within these
callbacks in a coroutine,KtScope.launch { }
, or check if the suspending function can be made non-suspending.
New
- add:
EmptyDrawable
to handle drawables that don't need drawn. - add: Additional vec3
CanvasLayer.canvasToScreen
methods. - add: two new size properties to
NinePatch
:totalWidth
&totalHeight
. - add: new
Textures.transparent
1x1 transparent pixel texture slice. - add:
MutableVec2f.mul(Mat4)
implementation. - add:
Node.moveChild(child, index)
method to handle moving a child to different index in the tree. - add:
SceneGraph
now propagates scroll input to control nodes that the mouse is over. - add:
allowGreater
&allowLesser
flags toRange
node to allow values pass the min & max values.
Changes
- fix:
SceneGraph
sometimes adding handled input to the unhandled input queue. - update:
Theme.FALLBACK_DRAWABLE
is not anEmptyDrawable
instead of a whiteTextureSliceDrawable
. - update:
Control
now checks to ensure node isvisible
before returning successfully in thehit
test. - update:
NinePatchDrawable
minWidth
andminHeight
calculations to use the newNinePatch.totalWidth
andNinePatch.totalHeight
properties. - fix:
PanelContainer
not fitting children nodes to the correct positions. - update: default UI asset pngs.
- update:
Label
defaultmouseFilter
is nowIGNORE
. - update:
Control.setAnchor
to be public. - fix:
Dispatchers
coroutines attempting to resume an already cancelled continuation. - fix: Android input not properly detecting the correct touch event action when touching with the 2 or more pointers.
- fix: LWJGL & JS input from not properly outputting the correct
Pointer
ontouchDragged
when using any pointer but the left mouse button. - fix:
FontCache
not resetting its current tint when callingclear()
. - fix:
Label
bottom vertical alignment calculation not being correct. - fix:
Label
horizontal alignment calculations not being correct. - fix:
Label
not taking into account the correct minimum size when usingellipsis
. - fix:
Button
horizontal alignment calculations not being correct. - fix:
Button
not taking into account the correct minimum size when usingellipsis
. - fix:
ProgressBar
percentage font positioning to be more centered. - update:
ProgressBar
to only measure font when value changes.
v0.4.0
Highlights
SceneGraph
nodes now allow for custom sort options when updating lists. This allows to render nodes based on the
sort while keeping the update order.SceneGraph
: NewySort
option added toNode2D
to allow y-sorting rendering.SceneGraph
will now handle debug rendering as well asControl
nodes to render it's bounds when rendering to help
UI positioning.JVM
: Addedarm64
dependencies for LWJGL.
Breaking
-
Add
ShapeRenderer
toSceneGraph
andNode
render methods. This includespreRender
,render
,postRender
anddebugRender
as well as all theNode
rendering signals.Migration:
Before:
DSL:
node { onRender += { batch, camera -> // render logic } }
Extending a Node:
override fun render(batch: Batch, camera: Camera) { // render logic }
New:
DSL:
node { onRender += { batch, camera, shapeRenderer -> // render logic } }
Extending a Node:
override fun render(batch: Batch, camera: Camera, shapeRenderer: ShapeRenderer) { // render logic }
New
- add:
Camera.boundsInFrustum
implementation. - add: New implementation of
AnimationPlayer.start()
that will restart the current running animation to the first
frame.AnimationPlayer.resume()
provides the old functionality ofAnimationPlayer.start()
- add:
AnimationPlayer.restart()
alias forAnimationPlayer.start()
. - add:
Experimental
annotation that requires opt-in.
Changes
- fix: add missing
contract
call forvBoxContainer
. - fix: JVM - add a
isMac
check before attempting to set window icon. - fix: Texture Packer Plugin - All LWJGL dependencies are now removed from the plugin.
- update: Refactor
AnimationPlayer.start()
toAnimationPlayer.resume()
. - update:
AnimationPlayer
restarts the last frame time back to zero when stopping an animation. - update:
GpuFont
is now marked asExperimental
. - update Android compile & target versions to 33.
- update
AssetProviderer
to use anArrayList
instead of aMutableList
to fix iterating through assets to prepare.
v0.3.2
v0.3.1
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.
v0.2.0
New
- add: Full Android support.
- add:
MutableTextureAtlas
class to combine existingTextureAtlas
,Texture
, andTextureSlice
types into a
singleTextureAtlas
. - update:
vfsFile.readBitmapFont()
loader to allow passing in a list of existingTextureSlice
, such as from
aTextureAtlas
. - update:
core
now includestools
as an api vs just **implementation. Required for the newMutableTextureAtlas
class. - JVM config: add
backgroundColor
option for initially setting background color. - JS config: add
backgroundColor
option for initially setting background color. - add:
Batch
interface. - update:
SpriteBatch
to use new interface. - update: all references to
SpriteBatch
withBatch
. - add: New batch implementation called
TextureArraySpriteBatch
that uses texture arrays to render multiple textures as
a single draw call (GL 3+). - add: new helper methods for projecting / un-projecting coordinates on a
Camera
. - update:
GLVersion
to handle parsing version for OpenGL ES. - update:
Pointer
enum to support more than 3 pointers / touches (due to Android support). - update:
Pointer
with anindex
parameter for determine the actual index of the pointer / touch. - update:
Input
with newvibrate()
andcancelVibrate()
methods (Android support). - update
GLSLGenerator
to handle ES versions for mobile platforms. - BREAKING: remove:
getColorHex
andgetColorInt
methods fromLDtkIntGridLayer
. - add:
getColor()
that returns a newColor
instance toLDtkIntGridLayer
. - add:
truncate
string toFont
,FontCache
andGlyphLayout
. - add: ability to focus
Control
nodes and cycle through them with keyboard. - add:
onFocus
andonFocusLost
methods toControl
- BREAKING: move most UI enum classes to the specific Node class such as
SizeFlag
,StretchMode
,
andAnchorLayout
- update:
SceneGraph
to trigger ui input events for keyboard - update:
BaseButton
to allow for triggering press signal with keyboard - update
Button
with new focus theme variable drawable - add:
LineEdit
control for editing single lines of text. - add:
Clipboard
support - add: showing/hiding soft keyboard for Android
- BREAKING: rename
InputMultiplexer
toInputMapController
- add: new
InputMapProcessor
interface withonAction
callbacks used withInputMapController
- update:
InputMapController
to handlePointer
types as a binding - update:
InputMapController
to handle key modifiers in a binding (SHIFT, CTRL, and ALT) - update:
SceneGraph
to use anInputMapController
and input actions - update:
SceneGraph
focus key binds to use action bindings - add: helper methods to set default UI input action bindings to for
SceneGraph
- add:
justTouched
andtouchJustReleased
methods toInput
- BREAKING: rename
onKeyTyped
toonCharType
. - add: new
onKeyRepeat
method toInputProcessor
- add: support for
KEY_REPEAT
event inSceneGraph
- BREAKING: move
StretchMode
intoTextureRect
class. - add:
TILE
stretch mode implementation toTextureRect
- add:
TextureProgress
control node - update:
NinePatch
to support setting source rectangle - BREAKING: update:
NinePatchRect
control node to use aTextureSlice
vs using aNinePatch
directly. - BREAKING: update
Scene
to use scoped lifecycle methods withContext
- BREAKING: update
Scene
to no longer inherit fromAssetProvider
- update:
Game
withvfs
andclipboard
properties - add: a return value to
Context
callback methods (onRender
,onPostRender
,onResize
,onDispose
,onPostRunnable
) that can be invoked once to remove the callback from being invoked. - add: new
SizeFlag
value ofNONE
which is the same as creating aSizeFlag(0)
- add: a new parameter to the
resize
method of aSceneGraph
to allow centering of the camera iftrue
. - update:
Context
callbacks (onRender
,onPosRender
,onResize
,onDispose
, andpostRunnable
) to return
aRemoveContextCallback
lambda that can be invoked to remove itself from being called by theContext
. - update: the
resize()
method in aSceneGraph
to allow optional centering of camera. - update: LDtk version support to
1.0.0 beta3
- BREAKING: remove
readLDtkLevel
fromVfsLoaders
. - BREAKING: refactor
readLDtkMap
toreadLDtkMapLoader
. This now returns theLDtkMapLoader
which then can be
used to callloadMap()
andloadLevel()
. - BREAKING: remove
LDtkWorld
andLDtkLevel
fromAssetProvider
default loaders - add: Passing in optional
TextureAtlas
when reading anLDtkMapLoader
. Requires preloading tileset textures in order
to benefit from it. - add: Tiled map support. Includes, orthographic, isometric, and staggered map rendering support.
- update:
Rect
class is now open. - add:
extrude
,bleed
andbleedIterations
toTexturePacker
to prevent atlas bleeding and prevent filtering
artifacts when RGB values are sampled for transparent pixels. - add
TexMinFilter
andTexMagFilter
constructor params toFrameBuffer
Bugs:
- fix: remove clearing color buffer in
LwjglContext
. - fix:
PathInfo
to handle./
. - fix:
InputQueueProcessor
from triggering any subsequent input processors if the input has been handled - fix:
InputQueueProcessor
not correctly resetting internal input events to be reused. - fix:
Pool
from freeing an allocated object when using a callback. - fix:
TextureSlice
using incorrect UV coordinates for a 1x1 slice - fix: LWJGL input not resetting the last char when typing
- fix:
TextureRect
not actually using the specified width and height for stretching - fix:
SceneGraph
focusing aControl
node that wasn't enabled - fix:
Node
not updating children nodes whenenable
value was changed. - fix:
Button
sometimes not calculating text size resulting in misplaced text - fix:
Label
sometimes not calculating text size resulting in misplaced text - fix:
GlyphLayoutRun
not correctly calculating next glyphadvance
value. - fix:
Button
text width calculations due toGlyphLayoutRun
glyphadvance
fix - fix:
LWJGL
application defaulting to graphic cardsvSync
setting whenvSync
was set to false. It now will
properly turn offvSync
. - fix:
AnimationPlayer
not able to restart a current animation by usingstop()
and thenplay()
without having to
swap animations.
Upgrades:
Kotlin
from1.6.0
to1.6.10
LWJGL
from3.2.3
to3.3.0
kotlinx-coroutines
from1.6.0-RC
to1.6.0-native-mt
kotlinx-serialization
from1.3.1
to1.3.2
v0.1.0
LittleKt initial release which includes:
- JVM support
- JS support
- A Scene Graph and Node types
- A UI built on top of the Scene Graph
- Sprite batching
- Virtual File System
- Shading and GLSL Generator
- LDtk support
- Atlas support
- A texture packer for creating atlases
- Bitmap font support
- Audio streaming and clips
- Math module and utilities