SFML community forums
Bindings - other languages => Python => Topic started by: Tank on February 11, 2010, 03:07:58 pm
-
Hey,
currently PySFML uses tuples for representing sf::Vector* objects. I discussed that with someone (pekuja) some weeks before (sorry for that, got less time ;)) and we came up with the idea to implement sf::Vector* classes in PySFML, too. There're mainly two reasons:
- Tuples are immutable, meaning you just can't change its elements. This is unfavorable because you often want to change only the x or y component of a vector without creating new tuples.
- Naming conventions would be better. Instead of pos[0] and pos[1] you'd have pos.x and pos.y
Open for comments. :)
-
Okay, so if nobody has something to complain about, I'll implement it. ;)
-
That's a great idea.
I wanted to do it but never had enough motivation. I think the constructor should be able to take any object that has x and y attributes and tuples of length 2.
-
For virtualising the template class? I agree. :) I'll create a draft and see if it works out.