How do sprite shifts work

Place to get help with not working mods / modding interface.
GotLag
Filter Inserter
Filter Inserter
Posts: 534
Joined: Sat May 03, 2014 3:32 pm
Contact:

How do sprite shifts work

Post by GotLag »

What is the shift for a sprite/animation based on? At the moment I have to use trial and error to adjust the shift vector to correctly place the heater animations for my custom electric furnaces.
GotLag
Filter Inserter
Filter Inserter
Posts: 534
Joined: Sat May 03, 2014 3:32 pm
Contact:

Re: How do sprite shifts work

Post by GotLag »

Okay, experimenting shows shift is the number of tiles to move the sprite, independent of sprite scale. At a scale of 1, a tile is 32 pixels to a side.
YuokiTani
Smart Inserter
Smart Inserter
Posts: 1037
Joined: Thu May 08, 2014 7:57 pm
Contact:

Re: How do sprite shifts work

Post by YuokiTani »

you can use the GFX-Shift-Tool if you want it a little bit easier.

for animations use a single-frame to find the correct shift's. all shifts applys center-based (tile and image) - gfx with shadows looks off-centered until you shift to the image-center (ignore the shadow)

a 1x1 tiled image = 32x32px needs a shift -0.5, -0.5 (= -16px) to center ingame
GotLag
Filter Inserter
Filter Inserter
Posts: 534
Joined: Sat May 03, 2014 3:32 pm
Contact:

Re: How do sprite shifts work

Post by GotLag »

Thanks but I already whipped up an Excel spreadsheet to do it for me.
Post Reply

Return to “Modding help”