Skip to content

@modoki/engine / index / setInputPointer

Function: setInputPointer() ​

setInputPointer(world, next): void

Set the pointer on the Input singleton directly (test/tooling convenience). Derives pressed/released/dragX/dragY from the prior state like the live pipeline: on a fresh press it latches startX/startY to x,y; while down it keeps the existing start and updates the drag delta. Pass just {x,y,down} to script a gesture frame-by-frame: setPointer(world, {x:100, y:200, down:true}); // press → pressed, drag 0 setPointer(world, {x:100, y:260, down:true}); // drag → down, dragY 60 setPointer(world, {x:100, y:260, down:false}); // release→ released

Parameters ​

world ​

World

next ​

down ​

boolean

x ​

number

y ​

number

Returns ​

void

Built with Modoki.