can two pngs occupy the same space?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
Hale
Posts: 9
Joined: Sat Apr 29, 2006 4:17 pm
Location: Gainesville, FL
Contact:

can two pngs occupy the same space?

Post by Hale »

I'm a really big newb but have come up with a concept for an rpg battle system involving animations via png images of two characters (one on each side of the screen). Both will take up the entire resolution of the psp, but will be mostly transparent (where the characters aren't positioned).

I'm curious as to what ramifications one .png image overlapping another would cause or how to justify which would overlap which. This is basically how I would do it.

load up left image
Image

load up right image
Image

flip screen
Image

NOW, if I somehow manage to do this, I'm going to try to animate both sides (one at a time, depending on who's turn it is), but when I animate something like an attack, I'm going to try to make it take up the whole screen, overlapping the png image being attacked, allowing for battle effects like electricity and blood.

In my mind, it seems like it would be possible, but I'm just not experienced enough to know how to manage two images, one on top of the other. Help?
jsharrad
Posts: 100
Joined: Thu Oct 20, 2005 3:06 am

Post by jsharrad »

You can have one overlapping the other easily, just blit the one you want overlapped first, the front most sprite last, then flip the screen.
User avatar
Hale
Posts: 9
Joined: Sat Apr 29, 2006 4:17 pm
Location: Gainesville, FL
Contact:

Post by Hale »

That's pretty simple... I guess when a new turn is initiated I could blit the active character to make sure it's on top. Cool. Thanks :O)

EDIT: AH HA I got them both to show up. Awesome!
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

I'd recommend though, not to use fullscreen images to hold only the animation which happens in one half of the screen, since drawing that large (even when mostly transparent) images, is pretty slow. Try to at least make a 'bounding box' sized image sequence.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Post Reply