Module crit.pick

Sprite picking.

One-function module that tells you if a point falls inside of a sprite or not.

Functions

pick_sprite (sprite_url, x, y[, padding]) Pick a sprite.

Tables

PickPadding Padding table


Functions

pick_sprite (sprite_url, x, y[, padding])

Pick a sprite.

Limitations:

  • The sprite must be positioned at the origin of its parent game object.
  • The sprite must not be rotated inside of its parent game object.
  • The sprite must not be scaled inside of its parent game object.

Parameters:

  • sprite_url url or string An URL identifying the sprite component.
  • x number The x position of the point (in world space) to do the check on.
  • y number The y position of the point (in world space) to do the check on.
  • padding PickPadding By how much should the hitbox of the sprite be expanded or constricted. (optional)

Returns:

    boolean Returns true if the point hits inside the sprite and false otherwise.

Tables

PickPadding
Padding table

Fields:

  • left number Left padding.
  • right number Right padding.
  • top number Top padding.
  • bottom number Bottom padding.
generated by LDoc 1.4.6 Last updated 2022-05-04 10:01:11