aduros / flambe

Rapidly cook up games for HTML5, Flash, Android, and iOS.
https://github.com/aduros/flambe/wiki
MIT License
744 stars 118 forks source link

Drop shadow simulation? #303

Closed SavedByZero closed 9 years ago

SavedByZero commented 9 years ago

I tried to add drop shadows to the .pngs that the BMFont generator tool produces, and the files themselves look great,but the shadows look mashed during the actual implementation. Are baked in drop shadows harder to get right than other filters, due to the pixel offsets or something? Is there something that could be done to add to the glyph positions to get it right? Because right now it seems like the only thing to do is create a whole second version of the font as the color of the shadow, add a second text sprite underneath the main text, and position it as if it were a shadow.

Also would be interested to know the best way to simulate gradients for individual lines of text (baking them into the png files from the Flash IDE will encompass the whole file, I think).

markknol commented 9 years ago

Make sure you use padding (not spacing) in the BMFont export options. If the padding size matches the size of the dropshadow, it should look alright and glyphs should render as expected.

Otherwise it would be nice to have a simple testcase with the font file (and BMFont-configurations file) that goes wrong.

For the gradients, Its not simple to do with photoshop, unless you use the "equalize the cell heights" in the export options. Then all chars have the same height and is a bit easier to add the gradients. Ofcouse the texture will be a bit bigger in that case, since there is a bit more whitespace.

SavedByZero commented 9 years ago

Oh yeah, that makes sense. That worked. Thanks!

markknol commented 9 years ago

Cool, let me know how it looks when the project finished!