Neborya
December 3, 2018, 9:56pm
#21
Correct.
Please, test with htmlText
too:
import openfl.display.Sprite;
import openfl.filters.GlowFilter;
import openfl.text.TextField;
import openfl.text.TextFormat;
class Main extends Sprite {
public function new () {
super ();
//var format = new TextFormat ("_sans", 40, 0xFF0000);
var textField = new TextField ();
textField.width = 600;
textField.htmlText = "<font face='_sans' size='40' color='#FFFF00'>Click<font color='#FF0000'> her</font>e please!</font>";
/*format.color = 0x4D0404;
textField.setTextFormat(format, 0, 5);
format.color = 0xCE4400;
textField.setTextFormat(format, 5, 9);
format.color = 0x4D0404;
textField.setTextFormat(format, 9, textField.length);
textField.filters = [new GlowFilter(0xFFFF00, 1)];*/
addChild (textField);
stage.addEventListener ("click", function (_) {
textField.htmlText = "Thank you!";
});
}
}
MSGhero
December 4, 2018, 2:36am
#22
Yup that works too. The fix is for text that contains multiple formats after a space, so I need to make sure that normal text after a space still works.
MSGhero
December 5, 2018, 3:32am
#23
I pushed it to dev. Hopefully it doesn’t break anything, but let me know if it does
1 Like
Neborya
December 5, 2018, 3:54am
#24
Thanks, I’ll report any suspicious behavior
Neborya
December 16, 2018, 10:03am
#25
There’s another issues with <font color>
tag for multiline texts:
MSGhero
December 31, 2018, 9:35pm
#26
I have a PR out for the second issue, just to get any feedback people might have. The change itself is pretty straightforward.
Neborya
January 5, 2019, 4:18am
#27
I have another bug to report related to texts and filters in HTML5.
When changing scrollRect
of a Sprite
which has a TextField
child with filters, it’s position is not updated properly.
I recorded 2 videos:
Scrolling of text without filter: https://youtu.be/yOsA_OdUoo4
Scrolling of text with filter (bugged): https://youtu.be/Qyas7kwc9R0
What we have is:
Sprite
containter
2nd Sprite
container as it’s child
TextField
as a child of 2nd Sprite
container
GlowFilter
which is applied to the TextField
on mouse over
For the bug to occur we change scrollRect
property of the 2nd sprite container (I use wheel scrolling in the video), while the cursor is over the TextField
(for the filter to be applied).
Would you mind trying OpenFL 8.8, which was released yesterday? It has fixes related to scrollRect
changes
Neborya
January 13, 2019, 12:15pm
#29
Tried with OpenFL 8.8 - all the same.
Yep, I see the bug. Would it be possible for someone to write a small sample that reproduces this problem? Using mouse scrolling is fine, though it would be even better if it occurred on mouse over or enter frame