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.

DarkBASIC Discussion / Need advice on how to blend matrix tiles...

Author
Message
AzureZeal
22
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 5th Jul 2003 01:57
I just got this idea for my map editor which uses a very matedit like interface. Apon building/saving the matrix, I want to write a program that checks all the tiles, and creates new textures via blending adjacent textures. If the program detects that all adjacent textures are the same, nothing is done.

Has this been done before in any other matrix editors? Anyone have any advice as to how i should go about doing it? Im thinking its going to wither be something with checking the rgb for each pixle, or somehow ghosting/fading multiple images on top of each other... My brain is in for a world of hurtn...

THanks in advance for any input
AzureZeal
22
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 5th Jul 2003 03:07
Hmm the gods have moved me to the classic forum? Hmm.. well crap.

I think i can get what im looking for if I can find a way to use the get image command on sprites. By overlapping sprites and using the set sprite alpha command, I can blend textures just fine. However, everytime I try and get a image of the blending sprites, I end up capturing empty space. Ive tryed on bitmap 0 and bitmap 1. I suppose I could take a screenshot... but that seems like overkill.

Is it even possible to capture sprites via get image? if so what am i doing wrong?

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Jul 2003 03:27
You can paste a sprite to the screen:

PASTE SPRITE Sprite Number, XPos, YPos

You'll probably have to make a bitmap to image converter inside, using memblocks, because you'll need a lot of space and get image is dodgy for grabbing areas bigger than the screen.


Van-B

My cats breath smells of cat food.
AzureZeal
22
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 5th Jul 2003 03:57
Wohoo thanks pastesprite was what I needed. Here is the code I made up if anyone wants to use it. blends 2 textures together


Now whats this about needing a bitmap to image converter? And youre saying ill need to use memblocks because get image wont get images bigger than the screen? hmm sounds complex.

Btw - My plan for this little program is this...

Create a matrix (using my matedit like matrix editor) using regular, non blended textures. Apon saving the matrix, take the image file with all the tile textures, and add to it blended textures. Then run a program that looks for adjacent textures, and applys the new blended textures where its appropriate.

The only thing im worried about now is you said ill have trouble using the get image command to get the final matrix texture (im sure with the new blended textures it will be larger than the screen).

AzureZeal
22
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 5th Jul 2003 05:17
Hmm the more I work on this the more I wonder... How much memory does a matrix texture take up? Is it equal to a same sized bitmap in mbytes? If I blend all the tiles on a matrix ill need to make 50, maybe even 100+ textures. Is a matrix texture that large going to slow things down too much?

Also still unsure about what yu meant vanb. How would I use memblocks, and how would i not have to use the get image command?

AzureZeal
22
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 5th Jul 2003 18:31
Oh I think I see what you mean. Something like this...

make memblock from bitmap 1,bitmapnum
make image from memblock 1,matrixtexture

Right? That way I dont have to use the get image command, im instead passing the image through a memblock

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Jul 2003 07:05
Yep that's the ticket.

I think that should work, I'm not familiar with the memblock format for images, but I'm guessing bitmaps and images are the same format.


Van-B

My cats breath smells of cat food.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 7th Jul 2003 04:41 Edited at: 7th Jul 2003 04:45
AzureZeal:

Don't make it too much like MatEdit... or I'll sue!!! (lol)

TDK_Man

Login to post a reply

Server time is: 2025-05-20 01:42:18
Your offset time is: 2025-05-20 01:42:18