Z-index of TexField

50 views
Skip to first unread message

Grouuu

unread,
Dec 17, 2015, 6:20:34 AM12/17/15
to haxef...@googlegroups.com
Hello,

Actually I test HaxeFlixel, and I have a question :

how can I add a FlxTextField under graphics ?

Short example :

var txt:FlxTextField = new FlxTextField(120, 120, 0, "TEST");
txt
.setFormat(null, 20, FlxColor.WHITE);


add
(txt);


var sprite:FlxSprite = new FlxSprite(100, 100);
sprite
.makeGraphic(100, 100, FlxColor.RED, false);


add
(sprite);

In my project (flash, cpp), many texts are added in different FlxSpriteGroup, and they are always show on the top off all graphics, it's a problem for me  :(

Haxe 3.2.1
HaxeFlixel 3.3.11
OpenFL 3.4.0
Lime 2.7.0
FlashDevelop


(sorry for my very poor english)

Grouuu

unread,
Dec 17, 2015, 8:55:33 AM12/17/15
to HaxeFlixel
With PxBitmapFont, no problem, so it's good :)

Jeru Sanders

unread,
Dec 17, 2015, 3:40:59 PM12/17/15
to HaxeFlixel
TextFields are rendered using openfl.test.TextField on the stage because of how complicated a text engine is to make from the ground up. You'll have to use FlxBitmapFont textfields.

Gama11

unread,
Dec 17, 2015, 5:01:16 PM12/17/15
to HaxeFlixel
You could also use a regular FlxText, depending on what you're trying to do.

Grouuu

unread,
Dec 18, 2015, 4:39:43 AM12/18/15
to HaxeFlixel
Oh, ok, I understant now ! Thx !

I use FlxBitmapTextField now, and it's work fine :)
Reply all
Reply to author
Forward
0 new messages