Repository navigation
klyph 1.0.0
klyph 1.0.0 is the first stable release. Add it to a game with
plugins { id("com.eventslooped.klyph") version "1.0.0" }
klyph { entryPoint = "mygame.main" }
kotlin { sourceSets.nativeMain.dependencies { implementation("com.eventslooped.klyph:klyph:1.0.0") } }or start from klyph-template. The guide and API reference are at https://inemtsev.github.io/klyph/.
The first stable release. Code written for 1.0 keeps working in every 1.x release, except the
platform plumbing marked @KlyphPlatformApi.
Added
@KlyphPlatformApi: an opt-in marker on the SDL and GPU plumbing inklyph.platformthat only
the engine calls. It is outside the compatibility promise, and games use none of it.AudioOutputwithDEVICEandNONE, forAudioConfig.output.Assets.spriteSheetOrNullandFiles.readTextOrNull.Color.BLACK,RED,GREEN,BLUE,YELLOW,CYAN,MAGENTAandGRAY.Keyboard.axis(negative: KeyCode, positive: KeyCode), beside theScancodeoverload.- The API reference with inline samples, published on every
release, and Maven Central publishing fromv*tags.
Changed
Cameraworks in points: zoom 1 is one world unit per point on every display, and
viewportWidth,viewportHeight,worldToScreenandscreenToWorldare in points. A game that
setzoom = 2 * window.pixelDensitysetszoom = 2.Canvas.drawSpriteanddrawRectdefault toDrawSpace.SCREEN; passspace = DrawSpace.WORLD
to draw through the camera.ParticleEmitter.lifetimeis aClosedRange<Duration>, such as0.5.seconds..1.seconds.World(initialCapacity)rejects a capacity below 1 withIllegalArgumentException.Music.playthrowsIllegalArgumentExceptioninstead ofIllegalStateExceptionfor a stream
that does not match the track.Files.writeBytes,Image.save,Window.captureandAppConfig.screenshotcreate missing
folders on the way to the file.- The published javadoc jars hold the Dokka reference instead of being empty.
- The sample games, benchmarks and sandbox read every
KLYPH_*setting through
AppConfig.fromEnvironment. - The sample games moved to
games/shooterandgames/squish(:games:shooter,:games:squish).
The shooter has waves, divers and a boss every fifth wave; Bug Squish hides the cursor and
toggles fullscreen with F11. Both use the gameplay kit in place of their own copies. AudioConfig(enabled = false)→AudioConfig(output = AudioOutput.NONE);AudioConfig.enabled→AudioConfig.output.Assets.texture(image, filter)→Assets.createTexture(image, filter).Assets.music→Assets.musicTrack,Assets.musicOrNull→Assets.musicTrackOrNull.CollisionLayers.contains→CollisionLayers.intersects.Collisions.overlaps→Collisions.overlapping.Collisions.overlapsTo→Collisions.overlappingTo.Collisions.firstOverlapOrNull→Collisions.firstOverlappingOrNull.FrameStats.drawCalls→FrameStats.drawCallCount.FrameStats.collisionPairs→FrameStats.collisionPairCount.FrameStats.fixedSteps→FrameStats.fixedStepCount.AudioStats.activeVoices→AudioStats.activeVoiceCount.AudioStats.stolenVoices→AudioStats.stolenVoiceCount.AudioStats.droppedCommands→AudioStats.droppedCommandCount.AudioStats.closedStreams→AudioStats.closedStreamCount.Time.frame→Time.frameCount.Canvas.count→Canvas.quadCount.ParticleEmitter.count→ParticleEmitter.particleCount.ParticleEmitter(region, maxParticles)→ParticleEmitter(region, capacity).Input.axis(negative, positive)→Keyboard.axis(negative, positive), called asinput.keyboard.axis(...).MouseWheel→MouseWheelScrolled, inklyph.eventand asPlatformEvent.MouseWheelScrolled.EntityBuilder.parent(parent)→EntityBuilder.setParent(parent).Commands.spawn(build)→Commands.spawn(builder).SpriteAnimation.animation→SpriteAnimation.playhead.Animation.elapsed→Animation.frameElapsed.GamepadId.id→GamepadId.value.GpuDevice.release(window)→GpuDevice.unclaim(window).Commands.isEmptyandSceneStack.isEmptyare functions:isEmpty().PcmStreamextendsAutoCloseable.
Removed
- The
Animationcomponent key;SpriteAnimationis the animation component. SpriteRenderer, the publicTextureconstructor,Entity.rawandTextureRegion.u0,v0,
u1andv1are internal.