dxruby_sdl
dxruby_sdl copied to clipboard
DXRuby on SDL/Ruby ( Official repository is https://github.com/smalruby/dxruby_sdl )
## HomebrewによるSGEのインストールエラー Homebrewを用い、動作に必要なライブラリであるSGE (SDL Graphics Extension)がインストールできない問題 #### 原因 手順書に記載されているリンクが切れている。また、他サイトで提供されているgistも、Forumulaの参照先が更新されているため、正常に動作しない。 #### 対応方法 revisionを指定しているgistを用いて、インストールを行う。コマンドは以下の通りである。 ``` brew install https://gist.githubusercontent.com/ymmtmdk/5b15f2b06aef5549eb5a/raw/ebf4c9758b1f772f0f6073e7b2bdbb5e9665ee74/libsge.rb ```
- Issue #3: 色定数の追加 - Issue #4: 4要素で色指定[alpha, R, G, B] をした際の挙動の修正 および、テスト color_spec.rb の修正です。 テストは Rspec の書き方がよく分からず、エラーが出なくなる最小限しか書けませんでした。
Image#load で .bmp、.png の画像を読み込んだ Imageデータは、Image#set_color_key( color ) を実行すると以下のようなエラーが出ます。 ``` /Users/username/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/dxruby_sdl-0.0.10/lib/dxruby_sdl/image.rb:54:in `displayFormatAlpha': Couldn't convert surface format: No video mode has been set (SDL::Error) from /Users/username/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/dxruby_sdl-0.0.10/lib/dxruby_sdl/image.rb:54:in `set_color_key' from sample1.rb:4:in `' ``` -...
DXRuby の4要素での色指定 [alpha, R, G, B]をすると、[R, G, B] の色ではなく、[alpha, R, G] の数値の色が表示されてしまいます。 (DXRubyリファレンスマニュアル; http://dxruby.sourceforge.jp/DXRubyReference/2009713223038250.htm ) Ruby/SDL の4要素での色指定 [R, G, B, alpha] との指定順序の違いのせいかと思い、lib/dxruby_sdl/color.rb を書き換えてみたのですが、うまく行きませんでした。 (Ruby/SDLリファレンスマニュアル; http://www.kmc.gr.jp/~ohai/rubysdl_ref_2.html ) 環境; dxruby_sdl 0.0.10 Ruby...
DXRuby のリファレンスマニュアルで定義されている色定数の追加を要望します。 http://dxruby.sourceforge.jp/DXRubyReference/2009713223038250.htm DXRubyのソースコードから数値は抜き出しましたが、PRまでたどり着けないのでここに書きました。 http://sourceforge.jp/projects/dxruby/scm/svn/blobs/head/branches/1.4.1/dxruby.c ``` ruby # preset constant color names. [alpha, R, G, B] # C_DEFAULT is transparent color. C_BLACK = [255, 0, 0, 0] C_RED = [255,...
衝突判定の === で、 右側に配列を指定するとエラーが出ます。 ``` /Users/user_name/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/dxruby_sdl-0.0.10/lib/dxruby_sdl/sprite.rb:132:in `===': undefined method `collision_enable' for # (NoMethodError) ``` 左右を入れ替えて、配列を左側に指定するとエラーは出ませんが、衝突判定しません。 環境; dxruby_sdl 0.0.10 Ruby 1.9.3-p448、2.1.2 ともに Mac OS X 10.9.3 サンプルコード; ``` ruby require 'dxruby'...