Expand description
Deprecated: superseded by repame_view2d, which merges this crate with
repame-actors into the one 2D viewport crate. Deleted at the next
breaking bump; import repame-view2d in new code.
The re-export below keeps every path that lived here resolving, module
paths included (repame_sprite::batch::…, repame_sprite::design::…,
repame_sprite::fullscreen::…), so a consumer can move at its own pace.
Modules§
- actors
- Live vector actors:
.renrigs played throughrenamite-player. Timelines and state machines drive playback; the Canvas bridge paints.actors_viewis presentational,actors_view_withtakes opts. Rigs drawn many times under one world camera are thedrawmodule instead. - batch
- GPU sprite batch: instanced textured quads as a
WgpuCallback. Owns the atlas texture array and instance buffer. Feeds fromAtlasUploads, draws through a caller-supplied camera matrix. - camera
- Camera and framing law: dp canvas in, world out, and back.
- cursor
- Hardware-cursor frames: one strip in, one magnified RGBA frame out.
- design
- Design-space conversion: a design box onto a dp canvas. This is the scale
games hand-roll as
grid_scale/ui_scale/world_scale, the fill-and-cropcover_fitbeside the existing contain fit, and thefield_sizeview of how much design space a canvas shows. - draw
- World-anchored instanced draw list.
- fullscreen
- Fullscreen procedural passes: game-specific WGSL over a generated triangle, with engine-owned pipeline/uniform/texture management.
- pick
- Pointer picks in world space: the event vocabulary and the click rule.
- sprite
- Sprite data: one row per drawn quad, its blend, and its tint.
Structs§
- Actor
Draw - One placement of one item. Cheaper to clone than to configure.
- Actor
Draw List - ActorId
- Index into an
ActorLibrary. - Actor
Library - Actor
View Opts - Full-control options for
actors_view_with. - Atlas
Upload - One pending atlas upload: blit
rgba(tightw*h*4 bytes) intopageat (x,y). Built from arepame-atlasdrain by the game. - Batch
Desc - Batch construction parameters. Pages map 1:1 onto array layers.
- Batch
Frame - One view’s worth of atlas draws: the sprite rows for this frame plus the
shared atlas uploads. Each scene node owns its frame, so several views can
batch from one atlas without sharing (and clobbering) one batch; the pixel
data itself rides an
Arcand is never cloned. - Camera2d
- 2D orthographic camera. Owned by the UI (signals), copied into the
snapshot per frame.
effective_centeriscenter + offset. Canvas, GPU batch, and picks derive from these fields together. - Cursor
Frame - One decoded + magnified hardware-cursor frame.
- Design
Mapping - A design box mapped onto a dp canvas under one
DesignFitpolicy: the scale, the offsets it implies, the inverse, and the snapping rule. Build it per frame, or on resize, from the measured canvas and the game’s design size. - Fullscreen
Desc - Construction parameters for one effect.
- Fullscreen
Pass - A game-owned procedural effect.
Send + Syncfor the compositor thread. Rebuilt from the snapshot every frame (same pattern as the sprite batch): uniforms refresh each prepare, texture uploads ride along only on change frames. - Fullscreen
Texture - One texture upload: tight
w*h*4 RGBA8, row-major top first. Recreates the slot texture when the size changes, plain rewrite otherwise. Out-of-range or malformed uploads are dropped with a warning. - Fullscreen
Texture Ref - Player
- Topmost pickable item under
pt(world space). Moved torenamite-modelso canvas behaviors can hit-test without pulling the player in. Seerenamite_model::pick. Self-contained player: owns the project, hides the borrow plumbing. - Player
Host - Per-surface state for one embedded player: the engine, the tessellator
(
SceneRenderer), the viewport fit/zoom mapping, and playback control. - Raster
Atlas - Atlas resources backing
ActorItem::Rasterplacements. The pixel data rides anArc; every view batches its own rows per frame from it. - Sprite
Batch - Per-frame snapshot batch.
Send + Syncso it can cross into the compositor thread viarepose_render_wgpu::Callback. - Sprite
Instance - One batched sprite.
uvis in atlas texels normalized to 0..1. - View
Transform - Re-exported for embedders that paint chrome or read the view transform
without depending on
renamite-behavior-commondirectly. Screen ↔ world mapping. Px tolerance in world units. - World
Text - World-anchored text floater (damage numbers,
+25).
Enums§
- Actor
Fit - How the artboard maps onto the surface.
- Actor
Item - What a placement draws. One draw list carries all three media so a single surface can hold them in one z order; a rig is one kind of item, not the only kind of input.
- Design
Fit - Which ratio maps the design box onto the canvas. The anchoring question
(“where does the box sit once the scale is picked”) stays with
FitMode; this is only the ratio. - FitMode
- How the world rect is framed when the canvas aspect differs from
world_size. Named like Godot’s `Window.stretch/aspect. - Pick
Event - Player
Error - Sprite
Blend - Blend mode per sprite. Additive uses
SrcAlpha + One. Sorted into ranges (alpha, then multiply, then additive): push order across blend modes is NOT preserved, see the batch module docs. - Texture
Filter - Texture sampling for atlas layers.
Constants§
- CLICK_
SLOP_ DP - Press slop in dp: pointer-up farther than this from pointer-down
cancels the
Click(drag-off-cancel). Density-independent: compared after dividing physical-px deltas by the painted density, so a tap cancels identically on density 1 and density 3. - MINIMAL_
REN - Minimal
.rendocument (empty 64x64 composition, no nodes). Fixture helper for hosts built without asset files.
Traits§
Functions§
- actors_
view - Presentational rig surface with default opts: transparent, exact fit, no input, no auto-tick. The game applies machine inputs and ticks.
- actors_
view_ mixed - One z-ordered world surface for all three
ActorItemmedia. Rigs and rects are mesh placements and share the instanced mesh path; raster runs go to the atlas batch, which keeps its instancing. Because the whole list is emitted into one scene, the media interleave freely in z. - actors_
view_ mixed_ with_ events actors_view_mixedwith thePickEventsurface ofactors_view_world_with_events.- actors_
view_ with - Rig surface with full control. Canvas size comes from layout
(
fill_max_size); the game sizes and layers the surface. - actors_
view_ world - World camera surface: every rig in
library, instanced bydraws. - actors_
view_ world_ with_ events - World camera surface that also reports
PickEvents: press/release in world and screen space, hover, a click gated behindclick_within_slop_dp, and the touch triplet. - click_
within_ slop_ dp - Dp-space slop check: physical-px points divided by
density(falling back to 1.0) before comparing againstCLICK_SLOP_DP. - contain_
fit - Contain-fit of a
worldextent into a dp-space canvas: uniform scale plus centering offsets.world_to_dp/dp_to_worldinvert each other for any positive scale. The fill-and-crop sibling iscover_fit(seedesignfor the game-facing mapping). - cover_
fit - Cover-fit of a
designextent onto a dp canvas: uniform scale plus centering offsets, the fill-and-crop sibling ofcontain_fit. The design box is scaled up until it covers the canvas, so the offsets are zero on the tight axis and negative on the cropped one.designis the boxcontain_fitcallsworld; degenerate sides read as(1.0, 0.0, 0.0)likecontain_fit. - cursor_
frame - dp_
to_ world - Inverse of
world_to_dp. Degenerate scales return the look point. - dp_
to_ world_ with_ roll - Inverse of
world_to_dp_with_roll. - draw_
batch - Draw the default batch (backward compat for single-batch apps).
- draw_
batch_ with_ id - Draw the prepared batch for one id. Shared by
SpriteBatchand viewport payloads so all GPU consumers issue identical draw calls. - effective_
fit - Effective fit for one frame: base contain-fit scaled by
zoom / units_per_pixel, re-centered. Default camera matchescontain_fit; zoom 2 doubles on-screen size on both backends. - fit_
view_ proj - GPU camera for the shared framing contract: matrix form of
world_to_dpovercanvas_dp(dp = physical px / density). - fit_
view_ proj_ with_ roll fit_view_projplus camera roll about the look point.0.0matchesfit_view_proj.- frame_
uv - UV rect for one cell of a sprite-sheet grid:
hframescolumns byvframesrows,framecounted row-major from the top-left. - host_
from_ bytes - Host a packed
.renbrig. Same rig, a fraction of the bytes: use this for shipped art and keep the.renas the source of truth. - host_
from_ str - Host a
.renrig from source text. The game ticks the handle per frame and paints it viaactors_vieworactors_view_with. Hosts start playing; sim-driven games callpauseto hold. - instance_
rows - Transform rows mapping quad corners (-0.5..0.5) to world coords,
honoring size, rotation, anchor, and mirror. Matches the canvas path
pixel-for-pixel at the default anchor: corner (-0.5,-0.5) lands on
center - size / 2. - rgba8
- screen_
camera - Y-down orthographic camera: world (0,0) is the top-left of the
viewport, matching canvas orientation by construction. Standalone
batches and tests use this directly; viewport snapshots frame through
fit_view_proj(contain-fit + look) instead. - sprite_
aabb - World-space axis-aligned bounds of a sprite quad.
- unproject_
px - Unproject one window-physical px point through this frame’s camera.
- world_
to_ dp - World point to dp canvas point through the fit. At the default
center (
world / 2) this isoffset + world * scale. - world_
to_ dp_ with_ roll world_to_dpplus camera roll aroundcam_center.
Type Aliases§
- Player
Host Ref - Shared host handle: the embed owner builds it and passes it to the widget.