Skip to content

@modoki/engine / index / computeEdges

Function: computeEdges()

computeEdges(frame, prev): void

Derive edges into frame.pressed/frame.released from the freshly-sampled frame.held vs the previous frame's held map. prev is mutated to become the current held snapshot for next frame. Source-agnostic — a gamepad button and a keyboard key produce identical edges.

Parameters

frame

InputFrame

prev

FlagMap

Returns

void

Built with Modoki.