Class: GamesAndRpgParadise::Gtk::Pong::CenteredCircle

Inherits:
CenteredItem
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb

Direct Known Subclasses

Ball

Constant Summary

Constants inherited from CenteredItem

GamesAndRpgParadise::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 GamesAndRpgParadise::Gtk::Pong::CenteredItem

Instance Method Details

#draw(cr) ⇒ Object

#

draw

#


64
65
66
67
68
69
# File 'lib/games_and_rpg_paradise/games/pong/gtk/cairo_pong.rb', line 64

def draw(cr)
  cr.translate(min_x, min_y)
  cr.scale(@width, @height)
  cr.arc(0.5, 0.5, 0.5, 0, 2 * Math::PI)
  cr.fill
end