Skip to content

klyph 1.0.0

Choose a tag to compare

@inemtsev inemtsev released this 04 Nov 14:21
· 77 commits to main since this release
03e6800

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 in klyph.platform that only
    the engine calls. It is outside the compatibility promise, and games use none of it.
  • AudioOutput with DEVICE and NONE, for AudioConfig.output.
  • Assets.spriteSheetOrNull and Files.readTextOrNull.
  • Color.BLACK, RED, GREEN, BLUE, YELLOW, CYAN, MAGENTA and GRAY.
  • Keyboard.axis(negative: KeyCode, positive: KeyCode), beside the Scancode overload.
  • The API reference with inline samples, published on every
    release, and Maven Central publishing from v* tags.

Changed

  • Camera works in points: zoom 1 is one world unit per point on every display, and
    viewportWidth, viewportHeight, worldToScreen and screenToWorld are in points. A game that
    set zoom = 2 * window.pixelDensity sets zoom = 2.
  • Canvas.drawSprite and drawRect default to DrawSpace.SCREEN; pass space = DrawSpace.WORLD
    to draw through the camera.
  • ParticleEmitter.lifetime is a ClosedRange<Duration>, such as 0.5.seconds..1.seconds.
  • World(initialCapacity) rejects a capacity below 1 with IllegalArgumentException.
  • Music.play throws IllegalArgumentException instead of IllegalStateException for a stream
    that does not match the track.
  • Files.writeBytes, Image.save, Window.capture and AppConfig.screenshot create 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/shooter and games/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 as input.keyboard.axis(...).
  • MouseWheel → MouseWheelScrolled, in klyph.event and as PlatformEvent.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.isEmpty and SceneStack.isEmpty are functions: isEmpty().
  • PcmStream extends AutoCloseable.

Removed

  • The Animation component key; SpriteAnimation is the animation component.
  • SpriteRenderer, the public Texture constructor, Entity.raw and TextureRegion.u0, v0,
    u1 and v1 are internal.