Sha256: 26997d0cdfeefa17753b585ad66408e898927b93d164eb2123007e403f3125b8

Contents?: true

Size: 1.66 KB

Versions: 6

Compression:

Stored size: 1.66 KB

Contents

require_relative 'helpers/example_window'

# Change font and labels in the schema.
Fidgit::Element.schema.merge_elements!(Element: { font_size: 24 }, Label: { background_color: "?dark_blue" })

class ExampleState < Fidgit::GuiState
  ROW_BACKGROUND = Gosu::Color.rgb(0, 100, 0)
  CELL_BACKGROUND = Gosu::Color.rgb(100, 0, 0)
  OUTER_BACKGROUND = Gosu::Color.rgb(100, 0, 100)

  def initialize
    super

    vertical align: :center, background_color: OUTER_BACKGROUND do
      label "h => align_h, v => align_v", align_h: :center

      grid num_columns: 4, align: :center, cell_background_color: CELL_BACKGROUND, background_color: ROW_BACKGROUND do
        label "xxx"
        label "h fill", align_h: :fill
        label "h right", align_h: :right
        label "h center", align_h: :center


        vertical do
          label "xxx"
          label "xxx"
        end
        label "v fill", align_v: :fill
        label "v center", align_v: :center
        label "v bottom", align_v: :bottom

        vertical align_h: :center do
          label "h center"
          label "h center"
        end
        label "top right", align: [:top, :left]
        label "bottom left", align_h: :left, align_v: :bottom
        label "h/v fill", align: :fill

        label ""
        label "bottom right", align_h: :right, align_v: :bottom
        label "bottom center", align_h: :center, align_v: :bottom
        vertical align_h: :right do
          label "h right"
          label "h right"
        end

        label "Blah, bleh!"
        label "Yada, yada, yada"
        label "Bazingo by jingo!"
      end
    end
  end
end

ExampleWindow.new.show

Version data entries

6 entries across 6 versions & 1 rubygems

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