vchelaru/flatredball2/tweening
Claude Code and agent skill by vchelaru/flatredball2
- community
Checking that the SKILL.md file is still in the repository.
Tweening / interpolation in FlatRedBall2. Use when animating a float over time with an easing curve — position, scale, alpha, rotation, UI slide-in, hit-flash, juice. Covers Entity.Tween vs Screen.Tween, lifetime rules, and the required usings.
Install
npx vskill@latest install vchelaru/flatredball2/tweeningSKILL.md
Tweening in FlatRedBall2
Built on the FlatRedBall.InterpolationCore NuGet. FRB2 ships two extension methods that return a running Tweener:
Two using directives — why
InterpolationType, Easing, and Tweener come from the upstream FlatRedBall.Glue.StateInterpolation namespace and are not re-exported under FlatRedBall2.Tweening. Gum already depends transitively on FlatRedBall.InterpolationCore (via FlatRedBall.GumCommon), so the upstream namespace is present in every FRB2 project whether you use tweens or not. Declaring FRB2 wrappers with the same names would create IntelliSense auto-import ambiguity — picking the wrong one silently compiles but produces the wrong types. One set of types everywhere beats two similar ones, even if the upstream namespace is ugly.
Choosing the scope
Use `Entity.Tween` whenever the setter writes to an entity or its children. Destroying the entity clears its tweens automatically, so there is no use-after-destroy risk when the entity dies mid-tween.
Use `Screen.Tween` only when there is no entity owner — screen fades, global UI transitions, camera-level state.
If in doubt, pick Entity.
Pause behavior
Tweens freeze while Screen.IsPaused is true, alongside the rest of the Activity pipeline. For finer-grained control, override ShouldAdvanceTweens on the Entity or Screen subclass — e.g., freeze tweens on a single stunned entity without pausing the whole screen.
Gotchas
- Setter fires twice on the completing frame. The upstream
TweenerfiresPositionChangedwith a near-tovalue, then the wrapper invokes the setter once more with exactlytoso the final value is precise. Fine for plain assignment (v => X = v). If your setter has side effects, guard them. - `PositionChanged` is assigned, not subscribed. The wrapper wires it with
=. Additional listeners must use+=afterTween(...)returns. - `Ended` is an event. Use
+=. Fires once, after the final setter call, only if the tween completes (not onStop()). - Vector2 and Color have native overloads. No need to compose multiple float tweens.
Colordefaults toColorTweenMode.Rgb(channel-wise lerp, matchesColor.Lerp); passColorTweenMode.Hsvfor shortest-arc hue interpolation when you want a vivid sweep (e.g. red→blue passes through magenta, not gray). - `TweenAsync` for chaining. Each
Tweenoverload has aTweenAsynctwin returningTaskthat completes after the terminal-snap setter call. Useawait this.TweenAsync(...)to sequence tweens without duplicating the duration inEngine.Time.Delay. Cancellation: entity/screen destroy throwsTaskCanceledException; fire-and-forget (_ = TweenAsync(...)) silently swallows it.
Bump — wiggle from rest
Tween interpolates between two values — calling Tween(0 → 100, Elastic, Out) on a property already at 100 first snaps to 0 and then plays the curve. That snap is wrong for reaction effects (a button at rest that should "bump" when clicked, a hit-pulse on a sprite, a UI panel that wiggles on validation error).
Use Bump instead. It starts at restValue, peaks at exactly restValue + amplitude, and settles back to restValue — no snap.
amplitude is in the setter's units (pixels, scale, alpha) — independent of restValue.
Curves
All three curves share the same high-level shape — start at restValue, peak at exactly restValue + amplitude, settle back to restValue. Only the tail differs:
BumpCurve.Elastic(default) — oscillates above AND below rest with decreasing amplitude. Classic wiggle.BumpCurve.Back— single overshoot, then a smooth settle. No oscillation.BumpCurve.Bounce— oscillates between rest and progressively smaller peaks above rest. Never crosses below rest. Ball-settling feel.
Negative amplitude works for all three — the bump is mirrored: peak is below rest at restValue + amplitude, settles at rest.
Gotchas
- Stacking is not coordinated. Calling
Bumpwhile anotherTween/Bumpis driving the same property results in both setters firing each frame and fighting. Stop the previous tween first if needed. Same engine-wide stacking limitation asTween. - Terminal snap precision. Like
Tween, the final setter call is exactlyrestValue.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingfrb-skills/tweening/SKILL.md
Popularity
- Repository stars
- 15
- Repository forks
- 8
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/vchelaru/flatredball2/tweening)