Author |
Message |
¿§¥Jåmës¥§¿
|
Posted: Fri Oct 10, 2003 1:19 pm Post subject: Raeding and Writing to a File |
|
|
IN the totorials section there is a reading and writing thig but it is an extention where is the first one?? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
hackman
|
|
|
|
|
¿§¥Jåmës¥§¿
|
Posted: Fri Oct 10, 2003 8:47 pm Post subject: (No subject) |
|
|
Yup thats the one! Thanx |
|
|
|
|
|
Blade
|
Posted: Sat Oct 11, 2003 12:19 am Post subject: (No subject) |
|
|
up at the top there's a search button... click that then you can search the tutorials section for 'reading and writing files' |
|
|
|
|
|
¿§¥Jåmës¥§¿
|
Posted: Mon Oct 13, 2003 4:58 pm Post subject: (No subject) |
|
|
That search buttun is handy thatnx but I have a question bout it. How do you store a pisture to a file? |
|
|
|
|
|
AsianSensation
|
Posted: Mon Oct 13, 2003 6:50 pm Post subject: (No subject) |
|
|
a picture to a textfile?
um.......
well, you can use whatdotcolor to store what color each pixel of the picture is, then store those values in a textfile. When you want redraw the picture, use drawdot to draw each single pixel, and Pic.Save or Pic.ScreenSave to save the picture to a newfile...
But whatdotcolor is really slow, especially if you have to use it in 2 for loops to get every single pixel of a large picture. |
|
|
|
|
|
Tony
|
|
|
|
|
¿§¥Jåmës¥§¿
|
Posted: Mon Oct 13, 2003 8:39 pm Post subject: (No subject) |
|
|
Aw yes thats the ticket 8) thanx tony |
|
|
|
|
|
Sponsor Sponsor
|
|
|
AsianSensation
|
Posted: Mon Oct 13, 2003 10:24 pm Post subject: (No subject) |
|
|
ah.........just a file, should have told me, now you forced me to fill your head with all these junk about whatdotcolor that you should never use, just because it's so slow. |
|
|
|
|
|
¿§¥Jåmës¥§¿
|
Posted: Tue Oct 14, 2003 11:41 am Post subject: (No subject) |
|
|
ok I got another question. I'm kinda confused on the Pic.ScreenSve thing.
You wrote Quote: Pic.ScreenSave (x1, y1, x2, y2 : int, fileName : string) So I got the basic consept but where do you specify witch picture you want saved??
I'll give you the problem that I'm trying to do so maybe you could tell me if there is a better way or if I'm just way off. I'm trying to make a random back ground for a horizantal space shooter kinda thing. so I can make the background come but I have to make the space ship move so I have to clear the sceen and the background disapears. So my idea was to save the background that I have just made to a file so I can keep redrawing it. Got any ideas?? |
|
|
|
|
|
naoki
|
Posted: Tue Oct 14, 2003 4:53 pm Post subject: (No subject) |
|
|
you could do what my partner and i did:
take a picture the size of your game window and duplicate it so there's 2 of the same. then position the pictures beside each other and make a program to slide them to the left to give the appearance of movement. when one picture is all the way off the viewable screen it reloads its position right beside the 2nd picture |
|
|
|
|
|
Tony
|
Posted: Tue Oct 14, 2003 8:22 pm Post subject: (No subject) |
|
|
Pic.ScreenSave saves the picture on the screen between xy1 and xy2 into a bmp file name specified.
I think you can use Pic.Save to save already existing picture from a pointer (Pic.New)
as for the game... you might want to create a datafile and then just use a tile system to recreate it. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
|