[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] euclid.Vector2 to pygame coordinate tuple shortcut?



I lost this shortcut, and can't find it googling. example: you have
function that gets called like so:

    f2(1, (2,3), 3)

( like pygame.draw.circle() has a tuple for coordinates ). you can either do:

pygame.draw.circle(self.game.screen, self.color, (self.loc.x,
self.loc.y), self.radius )

Or, what is the syntax to expand as tuple? it was something like: (
where self.loc is a euclid.Vector2 )

    pygame.draw.circle(self.game.screen, self.color, *self.loc, self.radius )

Messing with IDLE, trying to figure it out, I'm able to get it to work
if there is *only* one argument, the tuple:

    f(*v) maps to f(v.x, v.y)

thanks,
-- 
Jake