I cannot seem to find a way to render text to a texture using drawTo. Everything else seems to render fine, but regardless of if I use bitmap font or a ttf, no text will show. See example below...of course when changing last line to s2d.addChild(holder); it will work, but I need to render text and graphics to a single texture to split it up to a bunch of small fragments.
var holder = new h2d.Sprite();
var text = new Text(Res.rubik_black.build(30));
text.text = 'Hello';
holder.addChild(text);
var texture = new h3d.mat.Texture(600, 600, [h3d.mat.Data.TextureFlags.Target]);
holder.drawTo(texture);
var tile = h2d.Tile.fromTexture(texture);
s2d.addChild(new h2d.Bitmap(tile));
Works if I add holder to scene before calling drawTo. Cannot figure out why that is the case for text specifically, but at least I have a workaround for now.
I cannot seem to find a way to render text to a texture using drawTo. Everything else seems to render fine, but regardless of if I use bitmap font or a ttf, no text will show. See example below...of course when changing last line to
s2d.addChild(holder);
it will work, but I need to render text and graphics to a single texture to split it up to a bunch of small fragments.