Hello all,
I’ve done a bit of searching around the forum to see how to do this, and I’ve scraped together a few things but am still unsure on how to proceed.
So from what I’ve gathered on the forum this is the process to do it:
- create text field. (enable cache as bitmap?)
- create bitmap data var.
- do a bitmapDataVar.draw(textFieldName, null, null, null, null, true);
- assign new bitmap data to a material.
- apply material to a plane or something.
This leads to nothing but a black texture with no text. So here is my actual code:
bitText = new TextField();
bitText.name = "mtfsdfd";
bitText.text = "tessssssssssssssssssssssssssssst";
bitText.autoSize = TextFieldAutoSize.CENTER
bitText.x = stage.width/2-37 ;
bitText.y = 170;
bitText.selectable = false;
bitText.border = false;
bitText.mouseEnabled = false;
bitForm = new TextFormat();
bitForm.color = 0xffffff;
bitForm.size = 23;
bitForm.font = "helvetica";
bitForm.bold = true;
bitText.setTextFormat(bitForm);
var btmd:BitmapData = new BitmapData(256,256,true,0xffffff);
btmd.draw(bitText,null,null,null,null, true);
var erthMat : BitmapMaterial = new BitmapMaterial(btmd,true,false,true);
Any help would be fantastic!
Thanks,
Alex