Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Is there any way to...

Author
Message
Lightwar siX
20
Years of Service
User Offline
Joined: 24th Jun 2004
Location:
Posted: 27th Jun 2004 20:25
paste one image over another pasted image?

Bah
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Jun 2004 23:30
Images paste over each other. Seems fairly obvious.

zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 30th Jun 2004 06:58
Images will automatically paste over each other, the key is get the order straight. You have to paste the 'lowest' image and then paste other images on top of it before you call SYNC.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
Lightwar siX
20
Years of Service
User Offline
Joined: 24th Jun 2004
Location:
Posted: 30th Jun 2004 10:19
Well its not obvious, thanks zircher for the insight.

Bah
JHA
21
Years of Service
User Offline
Joined: 30th Dec 2003
Location: Massachusetts, USA
Posted: 1st Jul 2004 02:37
Hello Lightwar siX,

If you need to basically combine the two images into the same location, such as pasting a grass image and then a tree image over the top, so that they are merged, then you will also want to set the transparency of the images too. Any part of your image that you want to be transparent should be black. You can change this, but black is the default transparency color. (Set Image Colorkey)

You would paste the grass image first and then the tree image over it. Any black portions of the tree image will not be drawn and allow the grass image to show through.

I am at work now, so I don't have the exact code to do this, but I use it in my 2D Level Editor program.

I can post some code that shows this later, unless Zenassem beats me to it.

Let me kow if this is what you are trying to do.

Thanks
JHA
zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 1st Jul 2004 09:49
Nah JHA, I will leave this one to you. I know that you have this down now, and someone else at one time expalined it to me. It's good to see the torch being passed sometimes.

~zen


SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 2nd Jul 2004 04:49
I would also point out that if you need a "visual black" in the image (for say, shadows and the like) they should have a pixel index of 1, 1, 1, or rgb(1, 1, 1) in the image... Otherwise, you can "see through" the black parts of the image, like a window if it's 0, 0, 0.

Use paintshop or whatever to make sure that visual black and transparent black are different. (The color changer tool is great for this.)

S.

Any truly great code should be indisguishable from magic.
JHA
21
Years of Service
User Offline
Joined: 30th Dec 2003
Location: Massachusetts, USA
Posted: 2nd Jul 2004 08:56
Ok, I'm a little late, but here is a quick snippet that pastes two images to the same location with the second image looking as if it is merged with the first.

You will need to create your own images and make sure that at least image2 has black portions in it.



Thanks
JHA
Lightwar siX
20
Years of Service
User Offline
Joined: 24th Jun 2004
Location:
Posted: 2nd Jul 2004 16:14 Edited at: 2nd Jul 2004 16:23
Excellent, thanks alot guys

What im trying to achieve is a grid map with characters on the grid, and when you select a character the 'squares' around the character should light up like they do the Shining Force games. I tryed doing it with sprites but it actually slowed it down quite a bit, i then tryed the image pasting but for some reason the grid map was hiding the pasted highlight selection images. Ill give this a whirl tonight and run a few expirements. Thanks again to all those who posted.

By any chance are any of you math wizards?

Bah

Login to post a reply

Server time is: 2025-05-16 15:46:08
Your offset time is: 2025-05-16 15:46:08