forked from LeenkxTeam/Leenkx_Examples
update
This commit is contained in:
24
debug_draw/Sources/lnx/MyTrait.hx
Normal file
24
debug_draw/Sources/lnx/MyTrait.hx
Normal file
@ -0,0 +1,24 @@
|
||||
package lnx;
|
||||
|
||||
#if lnx_debug
|
||||
import leenkx.trait.internal.DebugDraw;
|
||||
#end
|
||||
|
||||
class MyTrait extends iron.Trait {
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
notifyOnInit( () -> {
|
||||
var plane = iron.Scene.active.getChild("Plane");
|
||||
var suzanne = iron.Scene.active.getChild("Suzanne");
|
||||
// To see debug drawing, `Leenkx Project - Debug Console` option has to be enabled
|
||||
#if lnx_debug
|
||||
DebugDraw.notifyOnRender( (draw:DebugDraw) -> {
|
||||
if(plane != null) draw.bounds(plane.transform);
|
||||
if(suzanne != null) draw.bounds(suzanne.transform);
|
||||
// draw.line();
|
||||
});
|
||||
#end
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user