Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: pysfml-cython overriding draw method  (Read 3974 times)

0 Members and 1 Guest are viewing this topic.

HuFlungDu

  • Newbie
  • *
  • Posts: 1
    • View Profile
pysfml-cython overriding draw method
« on: March 05, 2013, 07:14:25 pm »
Hello everyone. After some time I am returning to sfml using pysfml-cython and am trying to get my bearings, not doing anything special. I'm trying to write a simple class that extends RectangleShape to draw another object inside of it. Judging from the documentation I should be able to write a class the extends Transformable (RectangleShape eventually does) and just override the draw function like normal, but making a class like this:
Code: [Select]
class DrawingRect(sfml.RectangleShape):
    def __init__(self):
        sfml.RectangleShape.__init__(self,(100,100))

    def draw(self, target, states):
        print "here"
Instead of drawing nothing when I call window.draw(myrect) and printing "here", it just draws the rectangle like normal and prints nothing, meaning it's not calling my new draw function. Am I missing something? Is there another class I need to inherit? Thanks.

 

anything