feedback
The fingertipKit front door: `require("fingertipKit.feedback")`. `start(opts)` puts up one non-interactive overlay screen on this player's peer and polls the player's own touches (and the left mouse button) every frame: a finger landing plays a tap ripple and the look's tap sound…
feedback
The fingertipKit front door: require("fingertipKit.feedback"). start(opts) puts up one non-interactive overlay screen on this player's peer and polls the player's own touches (and the left mouse button) every frame: a finger landing plays a tap ripple and the look's tap sound, a moving finger leaves a trail, and the kit's recogniser reports tap, doubleTap, hold, swipe, flick, drag and pinch (onGesture), which also dismiss the matching gesture hints. It holds the settings (look and per-style overrides), builds look-styled buttons (button, pressStyle), shows hints (hint, hintOnce with per-player memory, clearHints, resetHints), manual ripples (ripple), scripted ghost fingers (virtualTouch) and test counters (stats). Game code, the TouchFeedback component and the gallery call it; the package README documents every call.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
defaults( ) → Config
now( ) → number
nextId(prefix: string) → string
| arg | type | description |
|---|---|---|
| prefix | string |
look( ) → Looks
rippleStyle( ) → string return cfg
trailStyle( ) → string return cfg
pressName( ) → string return cfg
handName( ) → string return cfg
contains(list: { string }, v: string?) → boolean
| arg | type | description |
|---|---|---|
| list | { string } | |
| v | string? |
refreshOrigin(t: number) → void
Overlay origin: the screen root lays out inside the safe area, so points in ui.screenSize() space are shifted by the safe area's corner.
| arg | type | description |
|---|---|---|
| t | number |
toLocal(x: number, y: number) → void
| arg | type | description |
|---|---|---|
| x | number | |
| y | number |
buildRoot( ) → void
flush( ) → void
push(l: Live, cap: number) → void
| arg | type | description |
|---|---|---|
| l | Live | |
| cap | number |
spawnRipple(x: number, y: number, style: string?, color: string?, scale: number?) → void
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| style | string? | |
| color | string? | |
| scale | number? |
spawnTrail(tr: Track, x: number, y: number) → void
| arg | type | description |
|---|---|---|
| tr | Track | |
| x | number | |
| y | number |
buildHint(h: Hint) → void
| arg | type | description |
|---|---|---|
| h | Hint |
removeHint(h: Hint, success: boolean) → void
| arg | type | description |
|---|---|---|
| h | Hint | |
| success | boolean |
hintMatches(h: Hint, kind: string, info: { [string]: any }) → boolean
| arg | type | description |
|---|---|---|
| h | Hint | |
| kind | string | |
| info | { [string]: any } |
gesture(kind: string, info: { [string]: any }) → void
| arg | type | description |
|---|---|---|
| kind | string | |
| info | { [string]: any } |
begin(key: string, x: number, y: number, t: number, control: boolean?, v: { [string]: any }?) → void
| arg | type | description |
|---|---|---|
| key | string | |
| x | number | |
| y | number | |
| t | number | |
| control | boolean? | |
| v | { [string]: any }? |
move(tr: Track, x: number, y: number, t: number) → void
| arg | type | description |
|---|---|---|
| tr | Track | |
| x | number | |
| y | number | |
| t | number |
finish(tr: Track, t: number) → void
| arg | type | description |
|---|---|---|
| tr | Track | |
| t | number |
pinchCheck( ) → void
pollContacts(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
updateHints(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
expire(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
setShown(v: boolean) → void
| arg | type | description |
|---|---|---|
| v | boolean |
frame( ) → void
apply(opts: { [string]: any }?) → void
| arg | type | description |
|---|---|---|
| opts | { [string]: any }? |
running( ) → boolean
ensureLoop( ) → void
start(opts: { [string]: any }?) → void
Start touch feedback for the local player (idempotent: a second call only applies the new settings). Settings: look, ripple, trail, press, hand, sound (bool), volume, layer, scale, ripples (bool), trails (bool), mouse (bool, left button acts as a finger), controls (bool, show feedback on on-screen controls), edit (bool, also run in edit mode).
| arg | type | description |
|---|---|---|
| opts | { [string]: any }? | Optional settings; a missing key takes its default (a style left nil follows the look). |
examples
TF.start({ look = "neon", sound = false })stop( ) → void
Stop all touch feedback: removes the overlay, every effect and every hint.
examples
TF.stop()
running( ) → boolean
Whether touch feedback is running.
examples
if TF.running() then ... end
settings( ) →
A copy of the current settings, with the styles the look resolves to.
examples
print(TF.settings().ripple)
stats( ) →
Counters for testing and tuning: contacts began/ended, ripples, trail particles, gestures recognised, hints shown/dismissed, overlay rebuilds and their cost.
examples
print(TF.stats().began)
setStyle(key: string, list: { string }, value: string?) → void
| arg | type | description |
|---|---|---|
| key | string | |
| list | { string } | |
| value | string? |
setLook(name: string) → void
Switch the whole look (cartoon, minimal, neon, pixel, pastel). Individual style overrides stay.
| arg | type | description |
|---|---|---|
| name | string | Look name. |
examples
TF.setLook("neon")setRipple(style: string?) → void
Override the ripple style (nil follows the look).
| arg | type | description |
|---|---|---|
| style | string? | Ripple style or nil. |
examples
TF.setRipple("inkBlot")setTrail(style: string?) → void
Override the trail style (nil follows the look).
| arg | type | description |
|---|---|---|
| style | string? | Trail style or nil. |
examples
TF.setTrail("comet")setPress(style: string?) → void
Override the button press effect (nil follows the look).
| arg | type | description |
|---|---|---|
| style | string? | Press effect or nil. |
examples
TF.setPress("wobble")setHand(style: string?) → void
Override the hint hand style (nil follows the look).
| arg | type | description |
|---|---|---|
| style | string? | Hand style or nil. |
examples
TF.setHand("pixelHand")setSound(on: boolean, volume: number?) → void
Turn the tap sound on or off, optionally with a volume.
| arg | type | description |
|---|---|---|
| on | boolean | Whether to play the tap sound. |
| volume | number? | Optional volume 0..1. |
examples
TF.setSound(false)
looks( ) →
Every look name.
examples
TF.looks()
ripples( ) →
Every ripple style.
examples
TF.ripples()
trails( ) →
Every trail style.
examples
TF.trails()
presses( ) →
Every button press effect.
examples
TF.presses()
hands( ) →
Every hint hand style.
examples
TF.hands()
hintKinds( ) →
Every hint kind.
examples
TF.hintKinds()
ripple(x: number, y: number, opts: { [string]: any }?) → void
Play a ripple at a UI logical point (ui.screenSize() space), e.g. where a game event happened. Starts the overlay if needed.
| arg | type | description |
|---|---|---|
| x | number | Logical x. |
| y | number | Logical y. |
| opts | { [string]: any }? | Optional { style, color, scale }. |
examples
TF.ripple(200, 300, { style = "confetti", scale = 1.5 })onGesture(fn: (string, { [string]: any }) →
Subscribe to the gestures the kit recognises (tap, doubleTap, hold, swipe, flick, drag, pinch). fn(kind, info) with info.x/y in the overlay's logical points and info.dir for swipe, flick and pinch. A flick (a swipe released within 0.25 s at 600+ points per second) also reports swipe.
| arg | type | description |
|---|---|---|
| fn | (string, { [string]: any } | Callback. |
examples
local off = TF.onGesture(function(kind, info) print(kind) end)
virtualTouch(key: string, x: number, y: number, opts: { [string]: any }?) → void
Drive a virtual finger (a demo, a tutorial replay, a ghost of another player's input): call it every frame with the finger's UI logical point and it gets the same ripple and trail a real finger gets. It lifts on TF.virtualRelease(key) or when not refreshed for 0.3 s. opts: trail (style for this finger), ripple (false = none, or a style), sound (true to play the tap sound), gestures (true to let it count as gestures and dismiss hints).
| arg | type | description |
|---|---|---|
| key | string | Unique finger key. |
| x | number | Logical x (ui.screenSize() space). |
| y | number | Logical y. |
| opts | { [string]: any }? | Optional finger options. |
examples
TF.virtualTouch("ghost", 200, 300, { trail = "comet" })virtualRelease(key: string) → void
Lift a virtual finger started with TF.virtualTouch.
| arg | type | description |
|---|---|---|
| key | string | The finger key. |
examples
TF.virtualRelease("ghost")merge(dst: { [string]: any }, src: { [string]: any }?) → void
| arg | type | description |
|---|---|---|
| dst | { [string]: any } | |
| src | { [string]: any }? |
pressStyle(baseStyle: { [string]: any }?, name: string?) →
Return a copy of `baseStyle` with a press effect (pop, glow, wobble, pushDown; nil = the look's) added as hover/active states with a transition.
| arg | type | description |
|---|---|---|
| baseStyle | { [string]: any }? | The node's style table. |
| name | string? | Optional press effect. |
examples
node.style = TF.pressStyle(node.style, "pop")
button(opts: { [string]: any }) →
Build a ready UI button node in the current look with the press effect applied: { id, text, icon? (text/emoji or inline "<svg ...>"), onClick (callback id, delivered to the onCallback of whatever owns the screen you put it in), style? (merged over the look's), width?, height? (min 64), press?, fontSize? }.
| arg | type | description |
|---|---|---|
| opts | { [string]: any } | Button options. |
examples
ui.registerScreen("menu", { type = "vertical", children = { TF.button({ id = "play", text = "Play", onClick = "play" }) } })stop(self: Hint) → void
| arg | type | description |
|---|---|---|
| self | Hint |
isActive(self: Hint) → boolean
| arg | type | description |
|---|---|---|
| self | Hint |
hint(kind: string, opts: { [string]: any }?) → any
Show an animated gesture hint. kind: tap, doubleTap, hold, swipe, flick, drag, pinch. opts: x, y (UI logical points, or 0..1 of the screen with frac = true), world = {x,y,z} to follow a world position, dir (swipe and flick: left/right/up/down; pinch: in/out), toX/toY (drag target, same units as x/y), caption, timeout (seconds, default 12, 0 = until stopped or performed), hand (style), scale. The hint dismisses itself when the player performs the gesture.
| arg | type | description |
|---|---|---|
| kind | string | Hint kind. |
| opts | { [string]: any }? | Hint options. |
examples
local h = TF.hint("swipe", { x = 0.5, y = 0.6, frac = true, dir = "up", caption = "Swipe up!" })conv(x: number?, y: number?) → void
| arg | type | description |
|---|---|---|
| x | number? | |
| y | number? |
store( ) → any
wasSeen(key: string) → boolean
| arg | type | description |
|---|---|---|
| key | string |
markSeen(key: string) → void
| arg | type | description |
|---|---|---|
| key | string |
hintOnce(key: string, kind: string, opts: { [string]: any }?) → any
Show a hint only the first time this player meets it (remembered in the player's saved data, falling back to this session). Returns nil when already shown.
| arg | type | description |
|---|---|---|
| key | string | Unique key for this lesson, e.g. "jump". |
| kind | string | Hint kind. |
| opts | { [string]: any }? | Hint options (as TF.hint). |
examples
TF.hintOnce("firstJump", "swipe", { x = 0.5, y = 0.7, frac = true, dir = "up", caption = "Swipe up to jump" })resetHints( ) → void
Forget which hints this player has seen, so hintOnce shows them again.
examples
TF.resetHints()
clearHints( ) → void
Remove every hint on screen now.
examples
TF.clearHints()
Config = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.