forums

TNT Basic Forums > Programming Q&A
Is there a way to have your compiled app import images into an image bank?
< Last Thread     Next Thread >
Author
Thread        Post A Reply

10-20-2006 07:51

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

is there?

10-20-2006 17:31

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

do you mean image files on your hard disk? then, no

10-21-2006 12:54

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Well technically....

Er, with the bundle format it is technically possible to built a 'compiled' app's resources at run time. With the rsrc files it's not.

The app's data is held in a folder structure, so you should be able to write to it. I've not tried this myself, but haven't you done some work editing tbproj files? Same difference really, just get the app to look in the same directory for a bundle file with the same name as itself, and an extension that is it's creator code. That's the complied data. Then just try writing to it...

Should work.

Danny (nods)

10-21-2006 14:00

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

yes, with the .tbproj it should be possible, but only through a third-party app (with TNT code only, i don't reckon you could convert an image file to PICT, copy it into the bundle and modify the bytes in the image bank file)

10-22-2006 12:02

Posted by:
Orteil

Location:
Somewhere in France

Find more posts by Orteil

I know it's a silly, too-simple, big-sized idea but what if you created a text file with the color of each pixel, i.e "255;100;150255;150;150200;150;125" and so on ? In the first letters of the file you may put the size of the pic, like 256*256 or something...
Then another TNT program could open it by reading each pixel and drawing it on a hidden canvas then copy the canvas into a special bank to use it later in the game...
My, my english sucks a lot. I hope you understand it though. Pretty stupid, eh ?

10-22-2006 15:56

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

yes orteil, you can do that, it just may be very slow to load

10-23-2006 11:16

Posted by:
appleide

Click Here to Email appleide   Find more posts by appleide

You might be better off using a limited range of colours...

Selected any color you want (within the max supported by TNT basic, i.e 16bit), up to 50 colours, draw your picture with those colours...

Then, make a variable for each of your colours, in each colour, assign a list of pixels for TNT Basic to draw.

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.