class Pong::CenteredItem

Attributes

height[R]
width[R]
x[RW]
y[RW]

Public Class Methods

new(x, y, width, height) click to toggle source
# File gtk2/sample/misc/cairo-pong.rb, line 24
def initialize(x, y, width, height)
  @x = x
  @y = y
  @width = width
  @height = height
end

Public Instance Methods

max_x() click to toggle source
# File gtk2/sample/misc/cairo-pong.rb, line 35
def max_x
  @x + @width / 2
end
max_y() click to toggle source
# File gtk2/sample/misc/cairo-pong.rb, line 43
def max_y
  @y + @height / 2
end
min_x() click to toggle source
# File gtk2/sample/misc/cairo-pong.rb, line 31
def min_x
  @x - @width / 2
end
min_y() click to toggle source
# File gtk2/sample/misc/cairo-pong.rb, line 39
def min_y
  @y - @height / 2
end