forums

TNT Basic Forums > Programming Q&A
Building Image Banks on the fly
< Last Thread     Next Thread >
Author
Thread        Post A Reply

11-22-2003 08:39

Posted by:
buddy

Location:
Champaign, IL

Click Here to Email buddy   Find more posts by buddy

I'm trying to build image banks at runtime.

For example, I have 16 different images for my player, all 46 x 74, in one PICT file, placed in a regular grid pattern.

My project has an empty bank, ID 128.

I tried having a routine that is done at startup, that:
(a) creates a canvas the same size as this player image map.
(b) draws the image map into the canvas
(c) uses the copy image command in a loop to try and copy the various player images into bank 128 at unique image numbers.

Later, as my game starts, I still do "load images 128", just as I had done before when all 16 images were just dragged into the project and then dragged over to bank 128.

However, when the game starts... my player is invisible... it acts like as if I had forgotten to load the image bank.

Am I going about this the wrong way?

Thanks.

11-23-2003 01:47

Posted by:
-wyvern

Location:
Bedroom

Find more posts by -wyvern

I've encountered this problem before as well. What you need to do is creat a lot of "placeholder images" in bank 128, basically something 3x3 imported into the bank multiple times. It seems without an image allready in the place where you are copying to no copying actually gets done.

Hope it helps.

11-23-2003 02:46

Posted by:
buddy

Location:
Champaign, IL

Click Here to Email buddy   Find more posts by buddy

Thanks!

That helps *immensely*...!

11-24-2003 23:09

Posted by:
Mark Tully

Location:
TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

If you do a 'load images' command it deletes whatever is in the image bank and then loads it fresh from disk. So if use 'copy images' to build your image bank then do a 'load images' with an empty bank you will delete all your images and hence have invisible sprites.

As far as I'm aware, placing images into the image bank to make copy image work isn't necessary. (Unless it's a bug that you've just found of course!).

Mark

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.