What I want to achieve:
- Position the mods on my gun in the right places. Specifically,
- use the
offsetfield in the animation parts' properties to offset the image locally (e.g. nudging the image upward from the supposed part's position)
What I'm doing:
- Each mod is an animation part
- The points where the mod animation parts are supposed to be positioned on the gun are specified in the gun's config file (e.g.
"sightsOffset": [1, 1.125], - In the buildscript, I've been setting the animation part offsets to
base offset + mod offsetto position the sprites
Issues:
- My above approach allows oversized sprites to clip into the weapon; I thus want to use the
offsetfield to reposition the sprite locally - Since the buildscript recalculates the sprite offset accordingly, anything written in the respective mod animation part's
offsetfield (in the config) is overwritten, - but anything written in the parameters overrides the offsets written by the buildscript, returning the part to the hand's position
Approaches:
- I tried recalculating the mod offsets so that it inteprets the animation part offsets as image offsets but I got nowhere with this approach. Will try this approach again but I'm afraid I may be reinventing the wheel.
- I attempted to use transformation groups to move the sprites around the weapon, but all
animatorfunctions that involve transformation groups don't move the animation parts at all
I'm pretty sure I'm doing something wrong. I hope someone can guide me to the right direction - I can provide any and all relevant pieces of code if needed