[solved] weird sprite clipping

Place to get help with not working mods / modding interface.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

[solved] weird sprite clipping

Post by aubergine18 »

tl;dr: crop images to remove emoty whitespace

I have two 90x90 px images, which if overlaid one on top of the other perfectly match for the planks and main structure of the wooden bridge:
vert2.png
vert2.png (11.48 KiB) Viewed 1377 times
-- vert2.png is being clipped
vert1.png
vert1.png (13.24 KiB) Viewed 1377 times
-- vert1.png is fine

The prototype tables defining the sprites in my simple-entity are consistent, the only difference being the file name. The simple-entity chooses a picture at random each time it's placed.

Weirdly, the result looks like this:
wut
The vert2.png is getting clipped on the left side for some reason.
prototypes
Any ideas what might be causing this?
Last edited by aubergine18 on Thu Oct 27, 2016 8:22 am, edited 1 time in total.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15997
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: weird sprite clipping

Post by Rseding91 »

Transparency along image edges are clipped before they're loaded as that's just wasted space. Trim your images so they don't contain transparent sections on the edges and it should resolve your issue.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: weird sprite clipping

Post by aubergine18 »

That worked! Many thanks! :D
Region capture 3.png
Region capture 3.png (89.7 KiB) Viewed 1366 times
Out of interest, what is the level of alpha transparency that clipping starts? (I assume 0.5?)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15997
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: weird sprite clipping

Post by Rseding91 »

100% transparent.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Modding help”