Page 1 of 1

[solved] weird sprite clipping

Posted: Thu Oct 27, 2016 7:20 am
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 1380 times
-- vert2.png is being clipped
vert1.png
vert1.png (13.24 KiB) Viewed 1380 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?

Re: weird sprite clipping

Posted: Thu Oct 27, 2016 7:40 am
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.

Re: weird sprite clipping

Posted: Thu Oct 27, 2016 8:04 am
by aubergine18
That worked! Many thanks! :D
Region capture 3.png
Region capture 3.png (89.7 KiB) Viewed 1369 times
Out of interest, what is the level of alpha transparency that clipping starts? (I assume 0.5?)

Re: weird sprite clipping

Posted: Thu Oct 27, 2016 8:15 am
by Rseding91
100% transparent.