var buttonCaster:FlxUIButton = cast this._ui.getAsset("butt_0");
buttonCaster.label.text = "Changing the label!";
--
HaxeFlixel Development Community
See our github https://github.com/haxeflixel/ and our documentation http://haxeflixel.com/documentation/
---
You received this message because you are subscribed to the Google Groups "HaxeFlixel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haxeflixel+...@googlegroups.com.
Visit this group at https://groups.google.com/group/haxeflixel.
To view this discussion on the web visit https://groups.google.com/d/msgid/haxeflixel/b82def4d-6956-4557-8b7c-82a73543213e%40googlegroups.com.
Safe casts have a runtime overhead. [...] The intended usage is to try the safe cast and catch the String
exception.
You're using an unsafe cast. According to the Haxe manual, this should be avoided: http://haxe.org/manual/expression-cast-unsafe.html
You should use a safe cast instead: http://haxe.org/manual/expression-cast-safe.htmlvar buttonCaster:FlxUIButton = cast (this._ui.getAsset("butt_0"), FlxUIButton)
On Fri, Jan 8, 2016 at 7:05 PM, LuFe_Mas <maschi...@gmail.com> wrote:
I get it!Using the Demo source code, if we want to change do something with the button_0:
var buttonCaster:FlxUIButton = cast this._ui.getAsset("butt_0");
buttonCaster.label.text = "Changing the label!";I didn't knew this cast operator, it's amazing.
Em quarta-feira, 6 de janeiro de 2016 21:33:18 UTC-2, LuFe_Mas escreveu:Hi guys,I really dont get how to use it. I saw the Demo. Is exactly what i want. Because i do not want the mouse arrow on my game, just keyboard.But the demo uses FlxUIState. Actually, its not the big problem. The problem is because this way, i need a xml file. Is very simple to do.But my game have a level select menu where the level are being unlocked only after finishing the previous one. Also on the title screen, there is a New Game button that just appears if you have a saved data already.What I mean, is that the buttons graphics ou visible, etc, change by the code, uses logic.So I cant do that on the XML file.There is a way to do that keyboard select effect withou the FlxUIState, or i way to put logic on xml file, like change the graphics and events.
--
HaxeFlixel Development Community
See our github https://github.com/haxeflixel/ and our documentation http://haxeflixel.com/documentation/
---
You received this message because you are subscribed to the Google Groups "HaxeFlixel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haxeflixel+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/haxeflixel.
To unsubscribe from this group and stop receiving emails from it, send an email to haxeflixel+...@googlegroups.com.
Visit this group at https://groups.google.com/group/haxeflixel.
To view this discussion on the web visit https://groups.google.com/d/msgid/haxeflixel/b82def4d-6956-4557-8b7c-82a73543213e%40googlegroups.com.
--
HaxeFlixel Development Community
See our github https://github.com/haxeflixel/ and our documentation http://haxeflixel.com/documentation/
---
You received this message because you are subscribed to the Google Groups "HaxeFlixel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haxeflixel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haxeflixel/988132dd-bbe5-4e8b-a070-1818db685f29%40googlegroups.com.