module Loco::TextAlignable

Public Instance Methods

textAlign()
Alias for: text_align
textAlign=(alignment)
Alias for: text_align=
textAlignment=(alignment) click to toggle source
Calls superclass method
# File lib/motion-loco/text_alignable.rb, line 37
def textAlignment=(alignment)
  if alignment.is_a? String
    self.text_align = alignment
  else
    super
  end
end
text_align() click to toggle source
# File lib/motion-loco/text_alignable.rb, line 5
def text_align
  case self.textAlignment
  when NSTextAlignmentLeft
    'left'
  when NSTextAlignmentCenter
    'center'
  when NSTextAlignmentRight
    'right'
  when NSTextAlignmentJustified
    'justified'
  when NSTextAlignmentNatural
    'natural'
  end
end
Also aliased as: textAlign
text_align=(alignment) click to toggle source
# File lib/motion-loco/text_alignable.rb, line 21
def text_align=(alignment)
  case alignment
  when 'left'
    self.textAlignment = NSTextAlignmentLeft
  when 'center'
    self.textAlignment = NSTextAlignmentCenter
  when 'right'
    self.textAlignment = NSTextAlignmentRight
  when 'justified'
    self.textAlignment = NSTextAlignmentJustified
  when 'natural'
    self.textAlignment = NSTextAlignmentNatural
  end
end
Also aliased as: textAlign=