Sha256: 0f73e2c9007b0856c562ca981caa147792fce444b1d5250568c799420524af2d

Contents?: true

Size: 937 Bytes

Versions: 6

Compression:

Stored size: 937 Bytes

Contents

require_relative 'helpers/example_window'

class ExampleState < Fidgit::GuiState
  BORDER_COLOR = Gosu::Color.rgb(255, 0, 0)
  FIXED_NUM = 5
  NUM_CELLS = 17

  def initialize
    super

    vertical do
      label "Grid with #{FIXED_NUM} columns"
      grid num_columns: FIXED_NUM, border_color: BORDER_COLOR, cell_border_color: Gosu::Color.rgba(0, 255, 0, 255), cell_border_thickness: 1 do
        NUM_CELLS.times do |i|
          label "Cell #{i}", font_size: rand(15) + 15, border_color: BORDER_COLOR, border_thickness: 1
        end
      end

      label "Grid with #{FIXED_NUM} rows"
      grid num_rows: FIXED_NUM, border_color: BORDER_COLOR, cell_background_color: Gosu::Color.rgba(0, 100, 100, 255) do
        NUM_CELLS.times do |i|
          label "Cell #{i}", font_size: rand(15) + 15, border_color: BORDER_COLOR, border_thickness: 1
        end
      end
    end
  end
end

ExampleWindow.new.show

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fidgit-0.1.5 examples/grid_packer_example.rb
fidgit-0.1.4 examples/grid_packer_example.rb
fidgit-0.1.3 examples/grid_packer_example.rb
fidgit-0.1.2 examples/grid_packer_example.rb
fidgit-0.1.1 examples/grid_packer_example.rb
fidgit-0.1.0 examples/grid_packer_example.rb