This repository has been archived by the owner. It is now read-only.
raylib-cr
raylib-cr
This repo is now archived, for an up-to-date version check out raylib-cr
at https://github.com/sol-vin/raylib-cr
Crystal Bindings for raylib
, a small and easy to use game development library.
As for now the bindings only support the raw function calls from raylib itself, a wrapper will be out shortly, I plan on making a more object-oriented wrapper around raylib.
The native libraries can be found in the native/<OSNAME>
folder of this repository.
Supported platforms
These platforms are supported out of the box and are linked statically
x86_64-linux-gnu
= 64-bit Linuxx86_64-darwin
= 64-bit OSX
Installation
- Add
raylib-cr
to yourshard.yml
:
dependencies:
raylib-cr:
github: AregevDev/raylib-cr
- Run
shards install
Usage Example
require "raylib-cr"
screen_width = 800
screen_height = 450
LibRaylib.init_window screen_width, screen_height, "Hello"
frames_counter = 0
rand_value = LibRaylib.get_random_value -8, 5
LibRaylib.set_target_fps 60
until LibRaylib.window_should_close
frames_counter += 1
if (frames_counter / 120) % 2 == 1
rand_value = LibRaylib.get_random_value -8, 5
frames_counter = 0
end
LibRaylib.begin_drawing
LibRaylib.clear_background LibRaylib::RAYWHITE
LibRaylib.draw_text "Every 2 seconds a new random value is generated:", 130, 100, 20, LibRaylib::MAROON
LibRaylib.draw_text "#{rand_value}", 360, 180, 80, LibRaylib::LIGHTGRAY
LibRaylib.end_drawing
end
LibRaylib.close_window
TODO:
These are my plans for v1.0.0
- Proper testing with
crystal spec
- Setup Travis CI
- OOP Wrapper
Contributing
- Fork it (https://github.com/AregevDev/raylib-cr)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- AregevDev - creator and maintainer
Repository
raylib-cr
Owner
Statistic
- 15
- 2
- 0
- 0
- 0
- over 2 years ago
- April 11, 2019
License
Apache License 2.0
Links
Synced at
Wed, 16 Jul 2025 06:24:04 GMT
Languages