Skip to content

entityAt

entityAt(game, x, y): number

The topmost sprite under a point in screen pixels (Input.pointer uses them), or -1: buttons, clicking units, dragging things. Sprites on renderer.screen layers are hit in screen pixels, the rest through the camera. Hits the sprite’s box (placed by Anchor) or a Circle’s ellipse, ignoring rotation; transparent pixels count. const e = entityAt(game, input.pointer.x, input.pointer.y)

Game

number

number

number