Class: Gtk::Pong::CenteredRect

Inherits:
CenteredItem show all
Defined in:
lib/games_paradise/pong/gtk/cairo_pong.rb

Direct Known Subclasses

Paddle

Constant Summary

Constants inherited from CenteredItem

Gtk::Pong::CenteredItem::NAMESPACE

Instance Attribute Summary

Attributes inherited from CenteredItem

#height, #width, #x, #y

Instance Method Summary collapse

Methods inherited from CenteredItem

#initialize, #max_x, #max_y, #min_x, #min_y

Constructor Details

This class inherits a constructor from Gtk::Pong::CenteredItem

Instance Method Details

#draw(cr) ⇒ Object

draw



63
64
65
66
67
68
# File 'lib/games_paradise/pong/gtk/cairo_pong.rb', line 63

def draw(cr)
  cr.translate(min_x, min_y)
  cr.scale(@width, @height)
  cr.rectangle(0, 0, 1, 1)
  cr.fill
end