package effectsplayground.control;

import javafx.scene.*;
import javafx.scene.paint.*;
import javafx.scene.text.*;

/**
 * @author campbell
 */

public class Label extends CustomNode {
    public var text = "Blank";
    public var value = 0.0;
    public var fraction = true;
    var t:Text;
    override protected function create() : Node {
        Group {
            content: [
                t = Text {
                    content: bind text
                    font: Font { size: 10 }
                    fill: Color.WHITE
                },
                Text {
                    translateX: bind t.layoutBounds.maxX + 5
                    content: bind if (fraction) "{%+1.2f value}" else "{(value as Integer)}"
                    font: Font { size: 10 }
                    fill: Color.rgb(40, 40, 40)
                }
            ]
        }
    }
}