Class: Fox::Canvas::TextShape
- Inherits:
-
RectangleShape
- Object
- Shape
- RectangleShape
- Fox::Canvas::TextShape
- Defined in:
- lib/fox16/canvas.rb
Instance Attribute Summary collapse
-
#font ⇒ Object
readonly
Returns the value of attribute font.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from RectangleShape
Attributes inherited from Shape
#foreground, #selector, #target, #x, #y
Instance Method Summary collapse
- #draw(dc) ⇒ Object
-
#initialize(x, y, w, h, text = nil) ⇒ TextShape
constructor
A new instance of TextShape.
Methods inherited from Shape
#bounds, #deselect, #disable, #draggable=, #draggable?, #drawOutline, #enable, #enabled?, #hide, #hit?, #makeControlPoints, #move, #position, #resize, #select, #selected?, #show, #visible?
Constructor Details
Instance Attribute Details
#font ⇒ Object (readonly)
Returns the value of attribute font.
240 241 242 |
# File 'lib/fox16/canvas.rb', line 240 def font @font end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
240 241 242 |
# File 'lib/fox16/canvas.rb', line 240 def text @text end |
Instance Method Details
#draw(dc) ⇒ Object
248 249 250 251 252 253 254 255 256 |
# File 'lib/fox16/canvas.rb', line 248 def draw(dc) super(dc) oldForeground = dc.foreground oldTextFont = dc.font dc.font = @font dc.drawImageText(x, y, text) dc.font = oldTextFont if oldTextFont dc.foreground = oldForeground end |