Skip to content

Anchor v2.1.0: Complete Overhaul, component-level control, scripting API, Sequence/Choreograph integration#2250

Open
KenanMillet wants to merge 16 commits into
Roll20:masterfrom
KenanMillet:Anchor-v2
Open

Anchor v2.1.0: Complete Overhaul, component-level control, scripting API, Sequence/Choreograph integration#2250
KenanMillet wants to merge 16 commits into
Roll20:masterfrom
KenanMillet:Anchor-v2

Conversation

@KenanMillet

Copy link
Copy Markdown
Contributor

Summary

Complete rewrite of Anchor with per-component tracking/locking, auto-created anchor tokens, a public scripting API, and integration with Sequence and Choreograph.

Changes (v1.0.0 → v2.1.0)

Core Features

  • Component flags: -pos, -x, -y, -rot, -scale, -w, -h, -layer, -flip, -flipv, -fliph, -z, -all
  • Per-component lock/unlock with pre-lock support
  • track/untrack/retrack commands for modifying tracked set
  • Auto-created invisible anchor tokens (GM-layer, auto-destroy when childless, persist flag)
  • Z-order anchoring with relative stacking
  • Flip mirroring (position offsets mirror across flip axis)
  • !anchor config with useroptions/globalconfig integration
  • Player permission gating (allow-player-use)
  • v1→v2 automatic state migration

Scripting API

  • getPosition/setPosition, getRotation/setRotation, getScale/setScale
  • getFlipV/setFlipV, getFlipH/setFlipH (true = flipped relative to parent)
  • getZOffset, getLocked, getUnlocked, lock, unlock
  • anchorObj, createAnchorFor, removeAnchor, updateObj, updateZOrder

Sequence Integration

Registers virtual attributes for animating in anchor-local space:

  • anchor.left, anchor.top — position
  • anchor.rotation — rotation
  • anchor.scaleW, anchor.scaleH — scale (multiplicative)
  • anchor.flipV, anchor.flipH — flip (boolean, non-lerpable)

Choreograph Integration

Registers token variables accessible as token.anchor.*:

  • parent (token), left, top, rotation, scaleW, scaleH, flipV, flipH, zOffset
  • locked, unlocked (string arrays)
  • siblings, children (token arrays with LINQ methods)
  • Lifecycle hook for direct !anchor command invocation

Documentation

  • Auto-generated Help: Anchor handout on startup
  • !anchor gen-dev-docs generates Help: Anchor/Scripting API
  • !anchor --help whispers command reference
  • README with full documentation

Dependencies

  • MatrixMath (required)
  • Sequence (optional — for animation integration)
  • Choreograph (optional — for scene integration)

Backward Compatibility

  • v1.0.0 state auto-migrates on first startup
  • Existing anchor relationships preserved
  • Locked tokens migrate with all components locked (matching v1 behavior)

…ograph integration (token vars, functions, lifecycle hook)
…ity (left/top/rotation), add scaleW/scaleH, siblings/children, remove anchorTo
…FlipV/H, setFlipV/H, getZOffset, getLocked, getUnlocked API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant