HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.99k stars 438 forks source link

Multiple outlines, shadows and gradients for FlxText #1165

Open JoeCreates opened 10 years ago

JoeCreates commented 10 years ago

Presently, it is very difficult to make a FlxText look distinct. I wish to improve FlxText to make it possible to have multiple outlines, multiple shadows, gradients, and perhaps other effects. What I would like would be a breaking change, so before I go ahead and try it, I'd like some feedback.

I would like to change the following:-

Note that effects would be applied cumulatively. This would make text significantly more customizable. Instead of just having a single border or outline, you could have outlined text with a shadow, or shadowed text with an outline around the shadow etc..

larsiusprime commented 10 years ago

How do you plan to implement this? Filters? Will it work cross-platform?

JoeCreates commented 10 years ago

@larsiusprime The implementation would likely be a modified version of the existing implementation (i.e. draws stuff onto the FlxText's cachedGraphics bitmapData). It has to be cross-platform. If there is a more efficient cross-platform way of doing certain effects with filters, then that could be changed in the implementation of that specific FlxTextEffect, but for now I wasn't planning on looking into that much. Abstracting it like this would make it easy enough to change the implementation of specific effects later without causing anything to break.

Tiago-Ling commented 10 years ago

This would be great, but i assume making it work seamlessly across all platforms would be hard to do also.

Tiago Ling Alexandre Tel: +55 41 8819-3191

2014-06-10 19:47 GMT-03:00 Joe Williamson notifications@github.com:

Turns out this is a lot harder than I anticipated, largely due to the fact that formats can be applied to subsections of the text.

— Reply to this email directly or view it on GitHub https://github.com/HaxeFlixel/flixel/issues/1165#issuecomment-45681972.

adrianulima commented 8 years ago

Seeing this issue now. What if this new class FlxEffectText extends the newly released FlxEffectSprite and use the IFlxEffects? The missing effects could added and would work for every FlxEffectSprite as well, and I'm sure you guys could also help to improve existing effects.

Gama11 commented 8 years ago

Using a separate FlxText class for this doesn't sound good.

adrianulima commented 8 years ago

Right, not a new class so. Passing current FlxText as target to FlxEffectSprite would work?