CabinGame/Luxe/blocks/debug.wren
2020-08-16 15:59:43 +02:00

41 lines
No EOL
788 B
Text

import "luxe: world" for World
import "luxe: draw" for Draw, PathStyle
import "luxe: io" for IO
class DrawDebug{
static Context{ __context }
static setup(world){
__context = Draw.create(World.render_set(world))
}
static commit(){
Draw.commit(__context)
}
static rect(x, y, w, h){
rect(x, y, w, h, [1, 0, 0, 1])
}
static rect_centered(x, y, w, h, col){
rect(x - w/2, y - h/2, w, h, col)
}
static rect(x, y, w, h, col){
var style = PathStyle.new()
style.color = col
Draw.quad(__context, x, y, 0, w, h, 0, col)
}
}
class Holder{
static x{
System.print("%(__value) was taken from me")
return __value
}
static x=(val){
System.print("I was given %(val)")
__value = val
}
}