Class: GamesAndRpgParadise::GUI::Gtk::Wall

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, width, height, color) ⇒ Wall

#

initialize

#


26
27
28
29
30
31
32
33
34
35
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/wall.rb', line 26

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

Instance Attribute Details

#widthObject

Returns the value of attribute width.



21
22
23
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/wall.rb', line 21

def width
  @width
end

#xObject

Returns the value of attribute x.



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

def x
  @x
end

#yObject

Returns the value of attribute y.



20
21
22
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/wall.rb', line 20

def y
  @y
end

Instance Method Details

#drawObject

#

draw

#


56
57
58
59
60
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/wall.rb', line 56

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

#height=(i) ⇒ Object

#

height=

#


72
73
74
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/wall.rb', line 72

def height=(i)
  @height = i
end

#height?Boolean Also known as: height

#

height?

#

Returns:

  • (Boolean)


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

def height?
  @height
end

#resetObject

#

reset

#


40
41
42
43
44
45
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/wall.rb', line 40

def reset
  # ======================================================================= #
  # === @configuration
  # ======================================================================= #
  @configuration = [true, __dir__, inspect]
end

#updateObject

#

update

#


50
51
# File 'lib/games_and_rpg_paradise/gui/gtk3/block/wall.rb', line 50

def update
end