Class: GamesAndRpgParadise::Gtk::Pong::CenteredItem
- Inherits:
-
Object
- Object
- GamesAndRpgParadise::Gtk::Pong::CenteredItem
show all
- Defined in:
- lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb
Constant Summary
collapse
- NAMESPACE =
inspect
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(x, y, width, height) ⇒ CenteredItem
26
27
28
29
30
31
|
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 26
def initialize(x, y, width, height)
@x = x
@y = y
@width = width
@height = height
end
|
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
21
22
23
|
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 21
def height
@height
end
|
#width ⇒ Object
Returns the value of attribute width.
21
22
23
|
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 21
def width
@width
end
|
#x ⇒ Object
Returns the value of attribute x.
20
21
22
|
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 20
def x
@x
end
|
#y ⇒ Object
Returns the value of attribute y.
20
21
22
|
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 20
def y
@y
end
|
Instance Method Details
#max_x ⇒ Object
43
44
45
|
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 43
def max_x
@x + @width / 2
end
|
#max_y ⇒ Object
54
55
56
|
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 54
def max_y
@y + @height / 2
end
|
#min_x ⇒ Object
36
37
38
|
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 36
def min_x
@x - @width / 2
end
|
#min_y ⇒ Object
50
51
52
|
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 50
def min_y
@y - @height / 2
end
|