Add search box

This commit is contained in:
Joey Yakimowich-Payne 2020-05-07 20:00:08 -06:00
commit 142d74cebb
2 changed files with 37 additions and 5 deletions

View file

@ -90,10 +90,11 @@ proc main() =
let vg = nanovg.newContext()
discard sdl.glSetSwapInterval(0)
vg.loadFont(currentSourceDir()/"resources/umeboshi.ttf", "sans")
vg.loadFont(currentSourceDir()/"resources/Roboto-Bold.ttf", "sans-bold")
vg.loadFont(currentSourceDir()/"resources/fa.ttf", "fa")
vg.loadFont(currentSourceDir()/"resources/entypo.ttf", "icons")
vg.loadFont(currentSourceDir()/"resources"/"Roboto-Regular.ttf", "sans")
vg.loadFont(currentSourceDir()/"resources"/"umeboshi.ttf", "umeboshi")
vg.loadFont(currentSourceDir()/"resources"/"Roboto-Bold.ttf", "sans-bold")
vg.loadFont(currentSourceDir()/"resources"/"fa.ttf", "fa")
vg.loadFont(currentSourceDir()/"resources"/"entypo.ttf", "icons")
var done = false
var prevt: float = sdl.getTicks().float/1000.0
@ -120,12 +121,14 @@ proc main() =
gpu.flushBlitBuffer()
withFrame(vg, window):
vg.setFont("umeboshi")
vg.text("Some仮名thing is up", 100, 100, 100)
vg.drawWindow("Title", 50, 50, 300, 400)
vg.drawLabel("Hello!", 10, 10, 500, 20)
vg.drawButton(ICON_TRASH, "Delete", 100, 200, 160, 28, rgba(128, 16, 8, 255))
vg.drawButton(ICON_TRASH, "Deleter", 100, 250, 160, 28, rgba(12, 130, 80, 255))
vg.drawButton("Testing", 100, 300, 160, 28)
vg.drawSearchBox("Search...", 60, 400, 280, 25)
gpu.resetRendererState()