Class: GamesParadise::GUI::Gtk::Block
- Inherits:
-
Object
- Object
- GamesParadise::GUI::Gtk::Block
- Defined in:
- lib/games_paradise/gui/gtk3/block/block.rb
Constant Summary collapse
- NAMESPACE =
#
NAMESPACE
#
inspect
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#draw ⇒ Object
# === draw ========================================================================= #.
-
#initialize(x, y, color) ⇒ Block
constructor
# === initialize ========================================================================= #.
-
#reset ⇒ Object
# === reset ========================================================================= #.
-
#update ⇒ Object
# === update ========================================================================= #.
Constructor Details
#initialize(x, y, color) ⇒ Block
#
initialize
#
28 29 30 31 32 33 |
# File 'lib/games_paradise/gui/gtk3/block/block.rb', line 28 def initialize(x, y, color) reset @x = x @y = y @color = color end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
18 19 20 |
# File 'lib/games_paradise/gui/gtk3/block/block.rb', line 18 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
17 18 19 |
# File 'lib/games_paradise/gui/gtk3/block/block.rb', line 17 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
15 16 17 |
# File 'lib/games_paradise/gui/gtk3/block/block.rb', line 15 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
16 17 18 |
# File 'lib/games_paradise/gui/gtk3/block/block.rb', line 16 def y @y end |
Instance Method Details
#draw ⇒ Object
#
draw
#
63 64 65 66 67 |
# File 'lib/games_paradise/gui/gtk3/block/block.rb', line 63 def draw Nyle.draw_rect( @x, @y, @width, @height, **{color: @color, fill: true, round: 2} ) end |
#reset ⇒ Object
#
reset
#
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/games_paradise/gui/gtk3/block/block.rb', line 38 def reset # reset_the_internal_variables # ======================================================================= # # === @configuration # ======================================================================= # @configuration = [true, __dir__, NAMESPACE] # ======================================================================= # # === @width # ======================================================================= # @width = 58 # ======================================================================= # # === @height # ======================================================================= # @height = 18 end |
#update ⇒ Object
#
update
#
57 58 |
# File 'lib/games_paradise/gui/gtk3/block/block.rb', line 57 def update end |