1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

live: use mostly pure V code for reloading, eases customization

This commit is contained in:
Delyan Angelov
2020-05-03 18:59:11 +03:00
parent b4e4e6bb21
commit 845ffb59a6
13 changed files with 282 additions and 210 deletions

View File

@@ -79,8 +79,8 @@ const (
[live]
fn (game &Game) draw() {
game.gg.draw_rect(game.x, game.y, width, width, blue)
game.gg.draw_rect(550 - game.x + 10, 200 - game.y + 50, width, width, gx.rgb(128, 10, 255))
game.gg.draw_rect(game.x - 20, 250 - game.y, width, width, gx.rgb(128, 240, 155))
game.gg.draw_rect(550 - game.x + 10, 200 - game.y + 50, width, width, gx.rgb(228, 10, 55))
game.gg.draw_rect(game.x - 25, 250 - game.y, width, width, gx.rgb(28, 240, 55))
}
[live]

View File

@@ -1,13 +1,13 @@
module main
// Build this example with
// v -live message.v
// Build this example with `v -live message.v`
import time
import live
[live]
fn print_message() {
println('Hello! Modify this message while the program is running.')
info := live.info()
println('OK reloads: ${info.reloads_ok:4d} | Total reloads: ${info.reloads:4d} | Hello! Modify this message while the program is running.')
}
fn main() {