Computer Science Canada Importing a tileset |
Author: | Nitro [ Wed Jun 18, 2003 7:54 pm ] |
Post subject: | Importing a tileset |
I'm wondering what technique I could use to import a tileset into my program. What I've been able to do thus far is to load a .bmp file to the screen, and segment it into the different tiles from there. Thing is, I need to find a different way to do this. I can't have it on-screen. How can I segment one bitmap file into smaller portions, and assign each small portion to its own variable off-screen? |
Author: | Tony [ Wed Jun 18, 2003 7:58 pm ] |
Post subject: | |
you can try doing it while in "offscreenonly" mod, but I dont know if it would work or not. Pic.New might be reading from a different buffer. Another way would be to have the loader run once onscreen. Then using Pic.Save you save all the tiles into bmp images and keep them in a game folder. Now when the actual game runs, it can load tiles and wouldn't have to process them. |
Author: | JayLo [ Wed Jun 18, 2003 8:00 pm ] |
Post subject: | |
didn't darkness do his massive awesome game with a tileset? |
Author: | PaddyLong [ Wed Jun 18, 2003 8:51 pm ] |
Post subject: | |
could do it by putting the image on the screen then loading the sections of it into a 2d array using Pic.New and then just clearing the screen. something like that probably wouldn't take very long to execute and so the user would probably never notice |
Author: | Nitro [ Wed Jun 18, 2003 8:54 pm ] |
Post subject: | they'd notice. |
If your changing tilesets in the middle of something, its a safe bet people will look up and say "what the hell was that?". whats this offscreenonly mode you're talking about? |
Author: | PaddyLong [ Wed Jun 18, 2003 11:41 pm ] |
Post subject: | |
didn't realize you were switching in the middle of things setscreen("offscreenonly") this is directly from the turing help file on setscreen Quote: "nooffscreenonly", "offscreenonly" Causes or (suppresses) output from being sent to the visible window. When the offscreenonly option is active, any text and graphics output is drawn to the offscreen buffer that is maintained for every Run window but not drawn to the screen. View.Update is then used to copy the entire contents of the offscreen buffer to the Run window. By allowing numerous drawing commands to be sent to the offscreen buffer and then updating the window at one time, it is possible to get smoother animation. |
Author: | Nitro [ Thu Jun 19, 2003 5:09 pm ] |
Post subject: | it worked! Thanks |
I was able to do the whole thing off-screen. I needed this to begin making a platform game, knowing that Turing 4 doesn't yet do sprites I open up turing 3 to find out that View.Update doesn't exist in this version... |