Files
Leenkx_Examples/script_camera_lerp/Sources/lnx/MyTrait.hx
2026-05-06 17:52:45 -07:00

24 lines
456 B
Haxe

package lnx;
import iron.system.Input;
import iron.math.Vec4;
import iron.system.Time;
class MyTrait extends iron.Trait {
public function new() {
super();
notifyOnUpdate(function() {
var kb = Input.getKeyboard();
if(kb.down("a") || kb.down("left")){
object.transform.rotate(new Vec4(0,0,1), -3 * Time.delta);
} else if(kb.down("d") || kb.down("right")){
object.transform.rotate(new Vec4(0,0,1), 3 * Time.delta);
}
});
}
}