famous-alarm-22563
11/29/2022, 9:22 PMbright-gpu-74537
11/29/2022, 9:22 PMfamous-alarm-22563
11/29/2022, 9:24 PM<label ttext="alive"></label>
how do I change the text from the Player class when the player dies.bright-gpu-74537
11/29/2022, 9:25 PMmyPlayerUI.aliveLabel.text = ...
famous-alarm-22563
11/29/2022, 9:26 PMbright-gpu-74537
11/29/2022, 9:27 PMbright-gpu-74537
11/29/2022, 9:27 PMbright-gpu-74537
11/29/2022, 9:27 PMfamous-alarm-22563
11/29/2022, 9:28 PMfamous-alarm-22563
11/29/2022, 9:28 PMbright-gpu-74537
11/29/2022, 9:34 PMbright-gpu-74537
11/29/2022, 9:34 PM@:xml('
<vbox>
<switch id="playerAliveSwitch" />
</vbox>
')
class MyPlayerUI extends VBox {
@:bind(playerAliveSwitch.value) public var isAlive:Bool;
}
bright-gpu-74537
11/29/2022, 9:35 PMbright-gpu-74537
11/29/2022, 9:36 PMelegant-twilight-61392
11/29/2022, 11:56 PM<label value="Whatever.alive" ifTrue="alive" ifFalse="dead">
and then it automatically changes the text based on the value of Whatever.alive
elegant-twilight-61392
11/29/2022, 11:57 PMambitious-knife-25690
11/30/2022, 12:02 AMambitious-knife-25690
11/30/2022, 12:02 AMambitious-knife-25690
11/30/2022, 12:03 AMambitious-knife-25690
11/30/2022, 12:03 AMhallowed-ocean-84954
11/30/2022, 3:18 AM// Scene
rubiks = true;
Now rubiks is an optionbox and I meant to assign rubiks.selected = true.
In my UI.hx file the error was reported several lines away from the field which was binding to this field:
@:bind(diffuse.value) <-------------------error flagged here
public var diffuseColor(default, null):Color;
@:bind(specular.value)
public var specularColor(default, null):Color;
@:bind(shininess.pos)
public var specularShininess(default, null):Float = 5;
// Scene properties
@:bind(rubiks.selected)
public var sceneRubiks(default, null):Bool; <----- Bool bound here
error: Source/UI.hx:56: characters 3-16 : Bool should be haxe.ui.components.OptionBoxhallowed-ocean-84954
11/30/2022, 3:18 AMbright-gpu-74537
11/30/2022, 6:52 AMrefined-cat-44047
11/30/2022, 7:12 AMbright-gpu-74537
11/30/2022, 7:44 AMrefined-cat-44047
11/30/2022, 8:09 AMcontentArea
as hidden, by setting hidden to true in the main-view.xml
, then it doesn't toggle with the button anymorefuture-iron-61487
11/30/2022, 10:04 AMfuture-iron-61487
11/30/2022, 10:08 AM