sprite_change_offset

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:

ArgumentTypeDescription
sprite:stringThe name of the sprite to change the offset of
xoff:realThe x position of the origin
yoff:realThe 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 );