extend("kanvas")

win = kanvas:create([
  title:        "Kanvas",
  width:        800,
  height:       600,
  borderless:   false,
  resize:       false,
  scale:        "X1",
  scaleMode:    "UpperLeft",
  topmost:      false,
  none:         false,
  transparency: false
])

# Show the window briefly so it appears on screen
res = kanvas:display(win)

# Add items to the display list:




p1 = kanvas:pixel(win, [10,15], "#FF00FF")      # pixel at (10,15) => magenta, fully opaque


r1 = kanvas:rectangle(win, [[10,15],[100,60]], "#FF0000")   # a red rectangle
r2 = kanvas:rectangle(win, [[120,70],[200,100]], "#00FF00") # green rectangle


r3 = kanvas:rectangle(win, [[140,15],[200,60]], "#FFFF00")  # yellow rectangle
t1 = kanvas:triangle(win, [[50,50],[250,80],[120,200]], "#80FF00FF") 
# ^ 50% alpha magenta triangle => #80FF00FF => 0x80 alpha = half-translucent

# Render them all by calling refresh:
kanvas:refresh(win)

# Optionally remove an item from the display list. For example, remove r2:
kanvas:remove(win, r2)

# Refresh again => r2 is no longer drawn:
#kanvas:refresh(win)


