Skip to content

Add XOffset and YOffset SPRTINFO Parameters / Adjust Sprite Offset Flipping Behavior

SMS Alfredo requested to merge SMS_Alfredo/SRB2:offcenter into next

This merge request adds the ability to define extra sprite offsets inside a SPRTINFO lump.

srb20074.gif

You may ask, why bother doing this if you can set offsets in SLADE? Well, this merge lets you set offsets using FRACUNITs, meaning you can create offsets for your sprites that don't align to the sprite grid. Perfect for if you have sprites that are either an odd number of pixels wide or an odd number of pixels tall.

In addition, these offsets work exactly like spritexoffset and spriteyoffset, which themselves have been adjusted. All offsets now properly account for flipping, which means when the sprite flips, the offsets will no longer flip with them. RF_FLIPOFFSETS will now revert offsets back to their old behavior if you really need it, which you can see in this gif:

srb20075.gif

This does mean, however, that RF_FLIPOFFSETS 's original behavior is no longer accessible. But personally I don't see much use in it, it was frankly just as, if not more unwieldy than this. If any of you would rather that I revert the offset flipping stuff, please let me know.

SpriteOffsetTest.wad <- Use this wad to test this merge request. It comes with a SPRTINFO lump that messes with Sonic's STND and WALK offsets, and a Lua file that binds adjusting several visual effects to different buttons. Obviously this wad is only for testing purposes, so don't expect anything fancy.

Edited by SMS Alfredo

Merge request reports

Loading