diff --git a/sysdata/programs/render_example/src/examples/able.bmp b/sysdata/programs/render_example/src/examples/able.bmp new file mode 100644 index 000000000..7de373dd6 Binary files /dev/null and b/sysdata/programs/render_example/src/examples/able.bmp differ diff --git a/sysdata/programs/render_example/src/examples/image.hb b/sysdata/programs/render_example/src/examples/image.hb index 6546d7474..689fbb7bd 100644 --- a/sysdata/programs/render_example/src/examples/image.hb +++ b/sysdata/programs/render_example/src/examples/image.hb @@ -1,27 +1,27 @@ -.{Vec2} := @use("../../../../libraries/stn/src/lib.hb").math; +.{Vec2} := @use("../../../../libraries/stn/src/lib.hb").math render := @use("../../../../libraries/render/src/lib.hb") /* expected result: a cute image bounces around the screen */ -mini_bmp := @embed("./mini.bmp") +bmp := @embed("./able.bmp") example := fn(): void { render.init() - mini := render.image.from_bmp(@bitcast(&mini_bmp)) + image := render.image.from_bmp(@bitcast(&bmp)) vel := Vec2(int).(1, 1) pos := Vec2(int).(100, 100) width := render.width() height := render.height() loop { - render.put_image(mini, pos) + render.put_image(image, pos) render.sync() render.clear(render.black) - if pos.x == 0 | pos.x == width - mini.width { + if pos.x == 0 | pos.x == width - image.width { vel.x = -vel.x } - if pos.y == 0 | pos.y == height - mini.height { + if pos.y == 0 | pos.y == height - image.height { vel.y = -vel.y }