[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] euclid.Vector2 to pygame coordinate tuple shortcut?
- To: pygame-users@xxxxxxxx
- Subject: [pygame] euclid.Vector2 to pygame coordinate tuple shortcut?
- From: "Jake b" <ninmonkeys@xxxxxxxxx>
- Date: Wed, 24 Dec 2008 23:36:47 -0600
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 25 Dec 2008 00:37:01 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=iVJGOK39BrooEoEjVYzO11S1L22Muq3W7dbOt9TzoXw=; b=Ebg9TlYu1I/dRso1TKIzrrfzBAjGjaGa9uDJbZeWkzPsimh87bfbrO2A8+IKO1Icig d7Mft/M0Lxod1vC8olNBkxw+uJ1XLyNl0JMmD8EejSz+rMm7snNUeDBq4FG4j+KEiKLq oQoSP7/p8dxDb6UMSwQ7MuBXDxMCPc+Kh2aM0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=P7LFABrd4L83Zpxze4E/n7n5y3txeFoeBfrtWMOWJuoZT1L5n4qjZ6w1233es7NUBP /0hdk60PRBDWTU4kOj6o3Lczyj8iF7QZmJdeMU/JbZ2SE8m1c96Ttjx0pAPfDGyLPPdO 3htcudWCYaSIjDUdAfHbDnSRoGh14Ih70SRVs=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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