Sha256: c450f00c73415e1bffb8486f30c433a20d24b07650d5d77d551042aa822d2af4

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

module Nuklear
  module UI
    class Label < Nuklear::UI::Base
      include Nuklear::UI::TextAlign
      
      attr_accessor :text, :color, :wrap, :align

      def initialize(text, color: nil, wrap: false, align: :left, **options)
        super(**options)
        self.text  = text
        self.color = color
        self.wrap  = wrap
        self.align = align
      end

      def to_command
        [:ui_label, text, color, wrap, align_as_flags(align)]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nuklear-0.1.3 lib/nuklear/ui/label.rb
nuklear-0.1.2 lib/nuklear/ui/label.rb
nuklear-0.1.1 lib/nuklear/ui/label.rb
nuklear-0.1.0 lib/nuklear/ui/label.rb