v2 / examples / gg / cursor.v
24 lines · 20 sloc · 384 bytes · efc8f7fb3ef7e90a088db64ad2c68dd0698b90d5
Raw
1module main
2
3import gg
4import sokol.sapp
5
6fn main() {
7 mut ctx := gg.new_context(
8 bg_color: gg.white
9 window_title: 'Cursor'
10 frame_fn: frame
11 init_fn: init
12 )
13 ctx.run()
14}
15
16fn init(mut _ctx gg.Context) {
17 sapp.set_mouse_cursor(.ibeam)
18}
19
20fn frame(mut ctx gg.Context) {
21 ctx.begin()
22 ctx.draw_text_def(10, 25, 'Your cursor should be an I shaped beam.')
23 ctx.end()
24}
25