Sha256: afffb7a6cb3c037cc6641e67a49a9e0b9cd8ad22510419ce3f2b40f16926ee45

Contents?: true

Size: 1007 Bytes

Versions: 16

Compression:

Stored size: 1007 Bytes

Contents

require_relative 'helpers/example_window'

# Labels can have text and/or icons.
class ExampleState < Fidgit::GuiState
  def initialize
    super

    vertical background_color: Gosu::Color.rgb(255, 0, 0) do
      label "Hello!", tip: 'A label with text'
      label "Hello!", icon: Gosu::Image["head_icon.png"], tip: 'A label with text & icon'
      label '', icon: Gosu::Image["head_icon.png"], tip: 'A label with just icon'
      label '', background_color: Gosu::Color.rgb(0, 255, 0), tip: 'No text or icon'
    end

    vertical do
      label ":left justification", width: 400, background_color: Gosu::Color.rgb(0, 100, 0), justify: :left, tip: 'A label with text'
      label ":right justification", width: 400, background_color: Gosu::Color.rgb(0, 100, 0), justify: :right, tip: 'A label with text'
      label ":center justification", width: 400, background_color: Gosu::Color.rgb(0, 100, 0), justify: :center, tip: 'A label with text'
    end
  end
end

ExampleWindow.new.show

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fidgit-0.2.4 examples/label_example.rb
fidgit-0.2.3 examples/label_example.rb
fidgit-0.2.2 examples/label_example.rb
fidgit-0.2.1 examples/label_example.rb
fidgit-0.2.0 examples/label_example.rb
fidgit-0.1.10 examples/label_example.rb
fidgit-0.1.9 examples/label_example.rb
fidgit-0.1.8 examples/label_example.rb
fidgit-0.1.7 examples/label_example.rb
fidgit-0.1.6 examples/label_example.rb
fidgit-0.1.5 examples/label_example.rb
fidgit-0.1.4 examples/label_example.rb
fidgit-0.1.3 examples/label_example.rb
fidgit-0.1.2 examples/label_example.rb
fidgit-0.1.1 examples/label_example.rb
fidgit-0.1.0 examples/label_example.rb