When using hardware=false and filters in textfield it’s not possible to change the text or color after that i.e. the value is changed , but display not show the new value.
I try to call explicitly __setRenderDirty() and also invalidate() , but nothing change. If not use filters everything works.
For what I saw cacheAsBitmap() is always true, when use filters . I also tried to return false, but then filters just stop working.
So mine idea is to call some render ( who will recreate filter after set_text) , but couldn’t find where in the code this happened. Anyone with idea where to look ?
Is this a CPP goal? I have encountered in CPP goals.
No, it’s HTML5 target
I remember this being fixed in the development branch on GIT but I am struggling to find the commit responsible
I tried with latest git version on Lime and OpenFL, but problem still exist with them.
I just realized this was hardware false
let me look
Okay try this one:
It’s works ! Thank you.
@singmajesty Maybe this is similiar problem ( not showing the text when apply dropshadow filter and switch visible - false/true) .
If you click on ‘Click me’ nothing show, but if you comment the row txt.filters = [new DropShadowFilter...
, it works.
Here is the code:
class Main extends Sprite
{
var txt:TextField;
public function new()
{
super();
stage.color = 0xffffff;
var btn = new TextField();
this.addChild(btn);
btn.border = true;
btn.textColor = 0x0;
btn.text = "Click me";
btn.width = 100;
btn.height = 30;
btn.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
txt = new TextField();
txt.y = 40;
txt.width = 100;
txt.height = 30;
txt.textColor = 0x0;
txt.filters = [new DropShadowFilter(1, 90, 0, 1, 0, 0)];
txt.text = "Some Text";
txt.visible = false;
addChild(txt);
}
private function mouseUpHandler(event : MouseEvent) : Void
{
txt.visible = true;
}
}