rem HUD and UI: a button - OpenDBC tutorial (DarkBASIC Classic) sync on : sync rate 60 autocam off color backdrop rgb(20, 24, 40) make object cube 1, 10 color object 1, rgb(90, 200, 255) position camera 0, 8, -30 point camera 0, 0, 0 do yrotate object 1, wrapvalue(object angle y(1) + 1) score = score + 7 bx = screen width() / 2 - 80 : by = screen height() - 70 over = mousex() > bx and mousex() < bx + 160 and mousey() > by and mousey() < by + 40 if over = 1 and mouseclick() = 1 then score = 0 rem Draw the button lighter while the mouse is over it if over = 1 then ink rgb(90, 140, 255), 0 else ink rgb(50, 70, 140), 0 box bx, by, bx + 160, by + 40 ink rgb(255, 255, 255), 0 center text bx + 80, by + 10, "RESET" text 20, 16, "SCORE " + str$(score) sync loop