Changes the x and y offset (origin) of the sprite asset loaded from the /sprites folder. Coordinates are relative to the (0,0) position being the upper left corner of the sprite. The following image illustrates this:
Argument | Type | Description |
---|---|---|
sprite | :string | The name of the sprite to change the offset of |
xoff | :real | The x position of the origin |
yoff | :real | The y position of the origin |
Example, called from init.gml:
// changing offset of the jump sprite to [94, 138]:
sprite_change_offset( "jump", 94, 138 );
// making it precise:
sprite_change_collision_mask( "jump", true, 0, 0, 0, 0, 0, 0 );