[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] euclid.Vector2 to pygame coordinate tuple shortcut?
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] euclid.Vector2 to pygame coordinate tuple shortcut?
- From: "Charlie Nolan" <funnyman3595@xxxxxxxxx>
- Date: Thu, 25 Dec 2008 02:12:40 -0600
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 25 Dec 2008 03:12:50 -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:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=FBCV9FpboPfrmVwCduMgOPcvaJT/nhltG5FNm/Nrr0A=; b=FLElFhEvd2xq6HI1pulnNXK9hJWDLwSuETUEGccL4pZoX+qczTZxOl1WrKQvZRVEUa 7g7Xh+Gp7QvahdnS4WQcFS5GoL0rH8x/8PAIbTQOyI0Re/vsBLTHkvqwylq3mTjKurNX YoSx48sN/+Ee75N+bT4TXKwTKxSVEYTX+IZZs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Fbn4pgKUo/kGm80ylDkj8ITbXop0XVg+K91qo7NqbdnQ/ikH3SQhAgO4L1KKjteB3f Y2Q1ePQIPuRqeOYUQlscTI3qUURmjl0aYL5xrsQrY7Pcekw+ykTkWmi/6MoYAFQN7iPj j3gim/97SsVspgAVGmrQazo7L0DKfyyXh0qJU=
- In-reply-to: <dc44bb3e0812242136i2a1d1bd6h315bf6c9ec61cfdc@xxxxxxxxxxxxxx>
- References: <dc44bb3e0812242136i2a1d1bd6h315bf6c9ec61cfdc@xxxxxxxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I don't have that package, but from what I see, it looks like this should work:
pygame.draw.circle(self.game.screen, self.color, tuple(self.loc), self.radius )
-FM
On Wed, Dec 24, 2008 at 11:36 PM, Jake b <ninmonkeys@xxxxxxxxx> wrote:
> 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
>