diff options
author | Cristhofer Travieso <cristhofert97@gmail.com> | 2013-04-30 22:06:18 (GMT) |
---|---|---|
committer | Cristhofer Travieso <cristhofert97@gmail.com> | 2013-04-30 22:06:18 (GMT) |
commit | 081ca9948febebce225a7169715d9bbcc13831b2 (patch) | |
tree | 18cea91abaaa4a1ce042712b1f226b3dd82b3a98 | |
parent | 7fd01035aa50782291356ede33c493263d8960fe (diff) |
Add the fuction _get_route
Signed-off-by: Cristhofer Travieso <cristhofert97@gmail.com>
-rw-r--r-- | game.py | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -35,11 +35,6 @@ LINE_WIDTH = 12 BACKGROUND_COLOR = (0, 1, 0) class Canvas(Gtk.DrawingArea): - - __gsignals__ = {'cross-added': (GObject.SignalFlags.RUN_FIRST, None, [int]), - 'circle-added': (GObject.SignalFlags.RUN_FIRST, - None, [int])} - def __init__(self): GObject.GObject.__init__(self) @@ -57,4 +52,13 @@ class Canvas(Gtk.DrawingArea): context.set_source_rgb(*BACKGROUND_COLOR) context.fill() + def _get_route(self, direction, pos_x, pos_y): + if direction == 'horizontal': + x = alloc.width + else: + x = alloc.height + + context.rectangle(pos_x, pos_y, x, 50) + context.set_source_rgb(0.803921569, 0.788235294, 0.788235294) + context.fill() |