Padding support in BlackPawnTextureBuilder

  ... the case you feel the need for a new feature or want to submit one.

Padding support in BlackPawnTextureBuilder

Postby valentin.milea » Wed Aug 25, 2010 11:53 am

Getting artifacts, need padding.

Quick & dirty patch:
BlackPawnTextureBuilder.zip
padding patch
(1.32 KiB) Downloaded 288 times
valentin.milea
 
Posts: 17
Joined: Fri Jul 30, 2010 4:35 pm

Re: Padding support in BlackPawnTextureBuilder

Postby valentin.milea » Wed Aug 25, 2010 4:01 pm

This is a Bug, but I'm posting it here since it's related:

Font class also produces artifacts, sometimes you get spillover from adjacent letters.
Another dirty patch:
font.zip
(1.36 KiB) Downloaded 188 times


Suggestion:
Make an abstract GreedyTextureBuilder that allows packing textures incrementally, via abstract public TextureRegion pack(ITextureSource pSource). Font could use it to pack Letters.
valentin.milea
 
Posts: 17
Joined: Fri Jul 30, 2010 4:35 pm

Re: Padding support in BlackPawnTextureBuilder

Postby Nicolas Gramlich » Wed Aug 25, 2010 7:38 pm

@ Spacing for BlackPawnTextureBuilder:

Worked excellent :) There was one problem though. Imagine you have a BuildableTexture of 256x256 and try to add a 256x128 TextureSource to it, while having 1px padding. :arrow: The TextureSource wouldn't fit :!:

So I changed the algorithm that it has a special case once the TextureSource would perfectly fit to the right and/or bottom edge of the BuildableTexture - if there was no padding.

And, as with your example I decided not to provide a default constructor, for two reasons: 1. Developers know sth has changed. 2. Developers learn why padding should be used.

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany


Return to Features

Who is online

Users browsing this forum: No registered users and 8 guests