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

26 lines
380 B
V

module main
import gg
import gx
import sokol.sapp
fn main() {
mut ctx := gg.new_context(
bg_color: gx.white
window_title: 'Cursor'
frame_fn: frame
init_fn: init
)
ctx.run()
}
fn init(mut ctx gg.Context) {
sapp.set_mouse_cursor(.ibeam)
}
fn frame(mut ctx gg.Context) {
ctx.begin()
ctx.draw_text_def(10, 25, 'Your cursor should be an I shaped beam.')
ctx.end()
}