Class: GamesAndRpgParadise::GUI::Gtk::Block

Inherits:
Object
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/gui/gtk3/block/block.rb

Constant Summary collapse

NAMESPACE =
#

NAMESPACE

#
inspect

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, color) ⇒ Block

#

initialize

#


28
29
30
31
32
33
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/block.rb', line 28

def initialize(x, y, color)
  reset
  @x = x
  @y = y
  @color = color
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



18
19
20
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/block.rb', line 18

def height
  @height
end

#widthObject

Returns the value of attribute width.



17
18
19
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/block.rb', line 17

def width
  @width
end

#xObject

Returns the value of attribute x.



15
16
17
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/block.rb', line 15

def x
  @x
end

#yObject

Returns the value of attribute y.



16
17
18
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/block.rb', line 16

def y
  @y
end

Instance Method Details

#drawObject

#

draw

#


63
64
65
66
67
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/block.rb', line 63

def draw
  Nyle.draw_rect(
    @x, @y, @width, @height, **{color: @color, fill: true, round: 2}
  )
end

#resetObject

#

reset

#


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/games_and_rpg_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

#updateObject

#

update

#


57
58
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/block.rb', line 57

def update
end