Re: [pygame] Fill a Rect object with color?

2009-11-08 Thread Yanom Mobis
a Rect object with color? To: pygame-users@seul.org Date: Sunday, November 8, 2009, 1:39 AM Lemme borrow Russell's method to show what I think is your missing piece: some way of getting a boom tower's rectangle onto the game's playfield (the main PyGame surface). Run it, and left-click the mouse

[pygame] Fill a Rect object with color?

2009-11-07 Thread Yanom Mobis
This is kind of embarrasing but I forgot how to fill a rect object with a certain color.

Re: [pygame] Fill a Rect object with color?

2009-11-07 Thread Ian Mallett
I don't think rect objects were meant for that. You could go: rect = a rect object pygame.draw.rect(surface,color,rect,0) Ian

Re: [pygame] Fill a Rect object with color?

2009-11-07 Thread Russell Cumins
Or you can create a surface the size of the rect and use the Surface's fill() method. E.g. position = x,y = 0,0 size = w,h = 32,32 colour = 0,255,0 rect = Rect(position, size) image = Surface(size) image.fill(colour) 2009/11/7 Ian Mallett geometr...@gmail.com I don't think rect objects were

Re: [pygame] Fill a Rect object with color?

2009-11-07 Thread Henrique Nakashima
Yes, rects are only objects that delimit a rectangular area. Areas that can be drawn onto are Surfaces, and you could draw rectangles to those surfaces the ways Ian and RusselI mentioned. On Sat, Nov 7, 2009 at 16:34, Yanom Mobis ya...@rocketmail.com wrote: This is kind of embarrasing but I

Re: [pygame] Fill a Rect object with color?

2009-11-07 Thread DR0ID
Hi even simpler: image.fill(color, rect) ~DR0ID Russell Cumins schrieb: Or you can create a surface the size of the rect and use the Surface's fill() method. E.g. position = x,y = 0,0 size = w,h = 32,32 colour = 0,255,0 rect = Rect(position, size) image = Surface(size) image.fill(colour)

Re: [pygame] Fill a Rect object with color?

2009-11-07 Thread B W
On Sat, Nov 7, 2009 at 10:34 AM, Yanom Mobis ya...@rocketmail.com wrote: This is kind of embarrasing but I forgot how to fill a rect object with a certain color. Here's everything so you can see the full context. import pygame from pygame.locals import * pygame.init()

Re: [pygame] Fill a Rect object with color?

2009-11-07 Thread Yanom Mobis
BoomTower.shoot needs to fill that BoomTower object's rangerect with a certain color does that make any sense? Not to be rude but am i confusing you? --- On Sat, 11/7/09, Ian Mallett geometr...@gmail.com wrote: From: Ian Mallett geometr...@gmail.com Subject: Re: [pygame] Fill a Rect object with color

Re: [pygame] Fill a Rect object with color?

2009-11-07 Thread Russell Cumins
that make any sense? Not to be rude but am i confusing you? --- On *Sat, 11/7/09, Ian Mallett geometr...@gmail.com* wrote: From: Ian Mallett geometr...@gmail.com Subject: Re: [pygame] Fill a Rect object with color? To: pygame-users@seul.org Date: Saturday, November 7, 2009, 12:45 PM I

Re: [pygame] Fill a Rect object with color?

2009-11-07 Thread stabbingfinger
Lemme borrow Russell's method to show what I think is your missing piece: some way of getting a boom tower's rectangle onto the game's playfield (the main PyGame surface). Run it, and left-click the mouse to change the state of the boom tower. import pygame from pygame.locals import * class