Skip to content

v0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Nov 11:00
· 14 commits to main since this release

Pite v0.4.0

Pite 0.4 brings a major leap forward for 2D animation, level authoring, and developer ergonomics πŸŽ‰ β€” introducing flipbook animations with AnimatedSprite2D, multi-layer grid tilemaps with TileMap2D and Rapier2D collider coalescing, structured 16-color pite check CLI diagnostics, a full-featured Assets panel file manager, simultaneous scene and code hot reloads on Ctrl+S, build-time schema-generated pite.pyi type stubs, and a unified Control transform hierarchy.


Highlights πŸ”₯

2D Flipbook Animations (AnimatedSprite2D)

Pite now features frame-by-frame 2D flipbook animations driven by sprite sheet atlases:

  • AnimatedSprite2D Node: Extends Node2D with sprite animation playback, seamless frame stepping, and loop management.
  • Atlas Animation Schema: Extended .atlas.json schema with "animations" defining named sequences of frames, frames-per-second (fps), and loop setting.
  • Scripting API: pite.AnimatedSprite2D exposes play(anim, loop), pause(), stop(), and is_playing(), along with properties atlas, animation, frame, speed_scale, playing, and autoplay.
  • Engine-Managed Signals: Emits animation_finished(anim_name) on completion of non-looping animations and animation_looped(anim_name) on each cycle of looping animations.
  • Precision Timing: Frame timing accumulation with remainder carry-over in _process, support for negative speed_scale (reverse playback), and scene-ready autoplay initialization.
  • Editor & Validation: Phosphor grid icon, atlas drag-and-drop support, inspector animation selection, static viewport frame rendering, and pite check animation reference verification.

2D Tilemaps Subsystem (TileMap2D)

Create rich 2D worlds with high-performance tilemaps and automated physics collider coalescing:

  • Multi-Layer Grid Tilemaps: Powered by .ptmap TOML sidecars referencing atlas frames with configurable grid sizes and layers.
  • Greedy Collider Coalescing: Adjacent solid tiles automatically coalesce into maximal static box colliders in Rapier2D, preventing internal edge snagging for character controllers.
  • Frustum-Culled Batch Rendering: Offscreen tiles are culled, batching visible tiles into efficient GPU draw calls.
  • Scripting API: pite.TileMap2D exposes get_cell, set_cell, erase_cell, clear, coordinate helpers world_to_map / map_to_world, layer introspection, and tile_size.
  • Interactive Editor Tools: Inspector tile palette with layer switcher and brush/eraser toggles; viewport interactive painting with grid snapping.

Redesigned pite check CLI Diagnostics

Project verification in pite check is now clearer, more actionable, and visually structured:

  • Structured Diagnostic Cards: What / Why / Fix cards for all errors and warnings with clear remediation steps.
  • 16-Color ANSI Output: Bold red (βœ– ERROR), bold yellow (β–² WARN), bold green (βœ” Checked), and bold cyan file locations.
  • Terminal & CI Ergonomics: Single-line quiet success banners, automatic terminal and NO_COLOR detection, --color <auto|always|never>, and -v, --verbose flag for scene cache inspection.
  • Machine-Readable JSON: Upgraded --json report to schema_version: 3 with structured summary and diagnostics objects.

Full-Featured Assets Panel File Manager

The Assets panel has been upgraded into a comprehensive file browser:

  • Creation Dialogs: Header + File and + Folder buttons plus context menu modals with starter templates for scripts (.py), scenes (.ptscn), and empty files/folders.
  • File Management: Folder-first sorting, empty folder preservation, Cut (Ctrl+X), Copy (Ctrl+C), Paste (Ctrl+V), Duplicate (Ctrl+D), Delete, and Rename (F2).
  • Automatic Reference Rewriting: Renaming or moving files outside or inside the editor automatically rewrites project references across scenes and scripts.
  • Drag-and-Drop Workflows: Drag files from the OS to import them, drop scripts onto Scene Tree nodes to attach them, and drag textures into Inspector fields.

Unified Scene & Code Saving with Instant Hot Reload

Pressing Ctrl+S / Cmd+S saves both the active .ptscn scene and any open Python script in the Code tab simultaneously, triggering an immediate hot reload without losing focus or requiring extra clicks.

Schema-Driven Type Stubs & Docs

  • Build-Time Generated Stubs: pite.pyi and pite.py type stubs are generated directly from engine node schemas at build time, ensuring editor autocomplete and type checking never drift from the Rust core.
  • Schema Documentation: Node descriptions, property documentation, and hover tooltips across the Scene Tree and Inspector are driven directly by NodeTypeSchema and PropSchema.

UI Hierarchy Refactoring (Control β†’ Node2D)

Control now inherits from Node2D (Node β†’ Node2D β†’ Control β†’ Label & Button), allowing Label and Button to inherit position and rotation transforms directly from Node2D alongside UI styling properties (color, font_size).


Changes Overview πŸ“œ

β€’ 2D flipbook animations (AnimatedSprite2D): frame-by-frame 2D animation node inheriting from Node2D, driven by .atlas.json animation definitions.
β€’ Animation playback API: play(anim, loop), pause(), stop(), is_playing(), and properties atlas, animation, frame, speed_scale, playing, autoplay.
β€’ Animation signals: engine-managed animation_finished(anim_name) and animation_looped(anim_name) signals.
β€’ 2D tilemaps (TileMap2D): multi-layer grid tilemaps via .ptmap TOML sidecars referencing atlas frames with frustum-culled batched GPU draw calls.
β€’ Greedy collider coalescing: adjacent solid tiles coalesce into maximal static box colliders in Rapier2D to eliminate internal edge snagging.
β€’ TileMap2D scripting API: get_cell, set_cell, erase_cell, clear, coordinate conversions world_to_map / map_to_world, layer introspection, and tile_size.
β€’ Enhanced pite check CLI diagnostics: redesigned report with What/Why/Fix cards, 16-color ANSI output, --color, --verbose, and schema v3 --json output.
β€’ Assets panel file manager: creation modals (+ File, + Folder), context menus, file drag-and-drop, and cross-panel asset assignments.
β€’ Simultaneous scene and code saving: Ctrl+S / Cmd+S saves active scene and open Python script simultaneously, triggering immediate hot reload.
β€’ UI hierarchy refactoring: Control now inherits from Node2D, providing position and rotation directly to Label and Button.
β€’ Project-level custom properties ([props]): declared in pite.toml and accessible in Python via get_custom_property, set_custom_property, and remove_custom_property.
β€’ Schema-driven documentation and stubs: NodeTypeSchema and PropSchema drive editor descriptions, tooltips, and build-time generated pite.pyi / pite.py stubs.
β€’ Python accessor updates: CharacterBody2D.is_on_floor, is_on_wall, and is_on_ceiling are now property attributes; Node2D.rotation is exposed to Python scripts and reflected by the renderer.
β€’ Scene Tree panel overhaul: modal node creation (Ctrl+A), 3-2 drag-and-drop reordering, subtree duplication (Ctrl+D), inline renaming (F2), and Phosphor category icons.
β€’ Inspector panel overhaul: inheritance-grouped collapsible sections, schema revert buttons, and interactive hex color editor.
β€’ Native Color property type: supports #rgb, #rrggbb, and #rrggbbaa hex parsing with live alpha swatches.
β€’ Scripting & physics synchronization: pre-step synchronization of node tree positions into Rapier2D for kinematic and static bodies manipulated in Python.
β€’ Signal error handling: formatted tracebacks printed to stderr when Python signal callback handlers raise exceptions.
β€’ Dependency updates: upgraded Rapier2D to 0.36.1 and Zip archive handling to 9.4.1; bumped workspace MSRV to Rust 1.95.
β€’ Crates.io packaging: all 13 workspace crates configured for crates.io publication with cargo install pite support.


Download ⬇️

β€’ pite-v0.4.0-linux.tar.gz / pite-v0.4.0-windows.zip / pite-v0.4.0-macos.tar.gz: engine + player binaries (any machine exports for all supported platforms), verified by SHA256SUMS.
β€’ pite-player-v0.4.0-<platform>: standalone player binaries for lightweight deployments and export toolchains.
β€’ Install scripts: install.sh (Linux/macOS) / install.ps1 (Windows) from the repo root.