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