Shard for using Gosu with Crystal
Under development: implementation is incomplete.
Implemented
- Gosu
- Window
- TextInput
- Font
- Song
- Sample
- Channel
- Image
- GLTexInfo
- Color (in-progress)
- Numeric helper functions e.g.
90.degrees_to_radians
-
Add the dependency to your
shard.yml
:dependencies: gosu: github: gosu/gosu.cr
-
Run
shards install
require "gosu"
class Window < Gosu::Window
def initialize
super(512, 512)
end
end
Window.new.show
Where possible gosu.cr imitates the Ruby gem.
- Install gosu as a system library, see wiki.
(Note: may need to edit
gosu/cmake/build/cmake_install.cmake
to changeset(CMAKE_INSTALL_PREFIX "/usr/local")
toset(CMAKE_INSTALL_PREFIX "/usr")
) - Run your project:
crystal run --link-flags -lgosu-ffi YOU_PROGRAM.cr
- Build gosu using Visual Studio or MSBuild (GosuFFI project)
- Copy
Gosu.lib
andgosu-ffi.lib
into the /lib directory of your crystal-lang install - Copy
SDL2.dll
andgosu-ffi.dll
into your project directory - Run your project:
crystal run YOUR_PROGRAM.cr
- Fork it (https://github.com/gosu/gosu.cr/fork)
- 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
- Cyberarm - creator and maintainer