[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Complicated Blitting Order Issue
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Complicated Blitting Order Issue
- From: Andrew Barlow <andrew.barlow@xxxxxxxxx>
- Date: Sun, 16 Jun 2013 12:19:05 +0100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 16 Jun 2013 07:19:13 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=eSgMclh0ROIp1jx8pmXzmfwwowcaQHL+WtKbtgEe0tI=; b=Tl7VLtN1G3vcd7tNnCxpoov5AztxToeJYeOjGUbV95f7N8z2dqLlwhL4wwznVhiQ+v fqf87TX6l3hjIz15EKkXcHwu4aPyQMIpL97vX4lHFtbJXWKb+5sROAPfDVzjbM4f0D35 1Nl6jdfQsPKrEIXBFTxnzo7piqGL9JwtXl4KdaX0SvrGw/pCeknK46in/bzt83wSWPF0 ZgAFvOcavRHGLtWzZpTaDZKXZJdmUKfCpdeDTo0uiljpdsvuVt981CmpmvtV+CmYWmKg SyBOJ4UMQk0ZsxdPSracTlwO0C0+ED+adCW3OmWuA0MXtqrST5lGtot31NCkutjn+EJT VStQ==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hello,
Â
I have a fairly frustrating problem I am trying to solve. It's pretty complicated to explain, so I'll do my best.
Â
Â
Of course, I could only redraw the map when I need to, but this means that I couldn't have units of tiles animated as I'd have to draw the whole map each frame of animation (which is SLOW). I'd like to be able to simply pick a tile from the dict and call a render method on it, and it only blit that tile (or nesc. area). The problems come when trying to render just a single tile due to a unit moving onto it (or appearing and disappearing in my case).
Â
One solution may just be to blit the entire column if anything in that column has changed, but if I have a unit in every column animating, I may as well just redraw the entire map each frame, which takes AGES.
Â
At the moment I'm trying:
Â
Draw the originally rendered map with unit onto the tile and the tile below
Draw the unit onto the tile
Draw any unit onto the tile below
Â
However, this doesn't work as the first tile's head gets left behind. If I then extend the first erase to cover the head, I lose the feet of any unit standing in the tile above!
Â
I know all this sounds a bit weird, but its very hard to explain without seeing it in action.
Â
Â
I hope I've vaguely explained it - maybe its simply not possible trying to do what i'm trying to do - but some advise would be hugely welcome!
Â
Cheers,
Â
Andy