haxeui / haxeui-raylib

RayLib backend for HaxeUI
MIT License
6 stars 1 forks source link

Timer doesnt work?? #2

Closed hoseyjoe closed 3 years ago

hoseyjoe commented 3 years ago

It never says hi??

import haxe.Timer;
import haxe.ui.Toolkit;
import haxe.ui.HaxeUIApp;

class Main {
    public static function main() {
        Toolkit.theme = "dark";
        var app = new HaxeUIApp();
        app.ready(function() {
            app.addComponent(new MainView());
            app.start();
        });
        var timer = new Timer(Math.floor(1000));
        timer.run = () -> {
            trace("hi");
        }
    }
}
ianharrigan commented 3 years ago

the in built haxe timer wont work, no. It requires an event loop, you can however use the haxeui Timer class (haxe.ui.util.Timer)... these are cross framework timers

hoseyjoe commented 3 years ago

you are so right