Class: GGLib::Label

Inherits:
Widget show all
Defined in:
lib/ext/widgets.rb

Instance Attribute Summary collapse

Attributes inherited from Widget

#buttonId, #defimage, #id, #name, #sleeping, #theme, #window, #zfocus

Attributes inherited from Tile

#id, #inclusive, #x1, #x2, #y1, #y2

Instance Method Summary collapse

Methods inherited from Widget

#blur, #button, #clicked?, #del, #downevent, #event, #feedText, #focus, #hasFocus?, #hasStickyFocus?, #intDraw, #onClick, #onDelete, #onDrag, #onInitialize, #onKeyPress, #onMouseDown, #onMouseOut, #onMouseOver, #onRightClick, #onRightDrag, #onRightMouseDown, #onStickyBlur, #onStickyFocus, #over?, #sleep, #sleeping?, #stickFocus, #unstickFocus, #wakeUp

Methods inherited from Tile

#centerOn, #del, deleteAllInstances, deleteById, #each, #eachBorder, getAllInstances, getById, #height, #iTile, #intersect?, intersect?, #isInTile?, #move, setAllInstances, #setCoordinates, #setTile, #width, #xTile

Constructor Details

#initialize(name, x, y, text = "", theme = Themes::blank) ⇒ Label

Returns a new instance of Label.


348
349
350
351
# File 'lib/ext/widgets.rb', line 348

def initialize(name, x, y, text="", theme = Themes::blank)
  @text = text
  super(name, x, y, x+100,y+30,theme)
end

Instance Attribute Details

#textObject

Returns the value of attribute text.


347
348
349
# File 'lib/ext/widgets.rb', line 347

def text
  @text
end

Instance Method Details

#drawObject


352
353
354
# File 'lib/ext/widgets.rb', line 352

def draw
  @theme.font.default.draw(@text, x, y, ZOrder::Text, 1, 1, @theme.font.color)
end