gosu.cr
gosu.cr
Shard for using Gosu with Crystal
Under development: implementation is incomplete.
Status
Implemented
- Gosu
- Window
- TextInput
- Font
- Song
- Sample
- Channel
- Image
- GLTexInfo
- Color (in-progress)
- Numeric helper functions e.g.
90.degrees_to_radians
Installation
-
Add the dependency to your
shard.yml
:dependencies: gosu: github: gosu/gosu.cr
-
Run
shards install
Usage
require "gosu"
class Window < Gosu::Window
def initialize
super(512, 512)
end
end
Window.new.show
Where possible gosu.cr imitates the Ruby gem.
Development
Unix
- 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
Windows
- 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
Contributing
- 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
Contributors
- Cyberarm - creator and maintainer
Repository
gosu.cr
Owner
Statistic
- 32
- 1
- 0
- 2
- 0
- about 1 year ago
- September 13, 2019
License
MIT License
Links
Synced at
Wed, 06 Nov 2024 23:16:55 GMT
Languages