Sha256: 81457784a15921745e072f41b2ee832970661910f30103769b54365584205283

Contents?: true

Size: 501 Bytes

Versions: 4

Compression:

Stored size: 501 Bytes

Contents

$:.unshift File.expand_path(File.dirname(__FILE__) + "/../../lib")
$:.unshift File.expand_path(File.dirname(__FILE__) + "/../../ext")

require 'ray'

Ray.game "Resize window" do
  register { add_hook :quit, method(:exit!) }

  scene :main do
    on :key_press, key(:a) do |text|
      window.size = [100, 100]
    end

    on :key_press, key(:b) do |text|
      window.size = [640, 480]
    end

    on :window_resize do |size|
      puts "my size is now #{size}"
    end
  end

  scenes << :main
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ray-0.2.1 samples/window/resize.rb
ray-0.2.0 samples/window/resize.rb
ray-0.1.1 samples/window/resize.rb
ray-0.1.0 samples/window/resize.rb