I need to add a png file in a TextField using the “htmlText” property of the TextField class.
This is a little example:
tf.htmlText = ‘< img src=“image.png” width=“100” height=“100”/ >’;
Actually, it doen’t work for me.
My fault or the img tag is not implemented in Openfl?
(I’m using the -Dcanvas export property)
Thanks a lot.
I just checked openfl._internal.text.HtmlParser and apparently the img tag
isn’t recognized by the HTML5 target.
<img /> in
htmlText is not yet supported
What is the current status of in htmlText ? Is it already supported ?
I think it’s still not supported. But that’s a poor feature. Even in full as3, I would use my own rendering system that would create textefields and Bitmap for each parts, I can share my as3 code if you really need a quick way to add img tags.
It will be cool if you can share your code . I tried to add emoji in textfield ( for chat ) , but using utf codes ( at example ) is not consistent ( i.e wrong space between characters and emoji and overlapping)