extend("kanvas")


win = kanvas:create([
  title:        "Hello, Lava + minifb",
  width:        800,
  height:       600,
  borderless:   false,
  resize:       false,
  scale:        "X1",         # recognized => X1, X2, X4, X8
  scaleMode:    "UpperLeft",  # recognized => "Stretch", "Center", "UpperLeft"
  topmost:      false,
  none:         false,
  transparency: false
])

res = kanvas:display(win)

kanvas:pixel(win, [10,15], "#FF00FF")   # sets pixel at (10,15) to magenta

kanvas:rectangle(win, [[10,15],[100,60]], "#FF0000")  # draws red rectangle
kanvas:rectangle(win, [[120,70],[200,100]], "#00FF00") # draws green rectangle
kanvas:rectangle(win, [[140,15],[200,60]], "#FFFF00")  # draws yellow rectangle

kanvas:line(win, [[10,10],[100,80]], "#FF0000");
kanvas:line(win, [[50,180],[200,20]], "#00FF00");
kanvas:line(win, [[0,0],[319,199]], "#800000FF");



kanvas:triangle(
  win,
  [[50,50], [250,80], [120,200]],
  "#FF00FF"
)

kanvas:refresh(win)
