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.

Dark GDK / Some Questions

Author
Message
SpaceMan Infinity
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location:
Posted: 12th Jun 2008 03:03
1. How to restart the program? Just restart and reload all files.
2. How to make texts with a sprite sheet? The Dark Invaders' code offseted the sprite sheet. (the text sprite sheet will contain all ASCII chars including invisible ones before 20.(or the InvaderText code without offsetting UV map)
For a ASCII list, http://www.cplusplus.com/doc/ascii.html
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 12th Jun 2008 03:35 Edited at: 12th Jun 2008 03:35
1. That is a little tricky if you haven't written the program with that in mind to begin with, but if you write a function that loads all of your files, and a function that deletes the resources that they use, then call dbFlushVideoMemory, and/or possibly dbSetDisplayMode.

2. You can use Paint for that, or you could also make a program that created a display using the printable characters, and grab that as a proper image to be used for a sprite sheet. I imagine that there are programs to do it, too, although getting the non-printable characters might prove a little difficult.
Bishop
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: In my favorite chair...
Posted: 12th Jun 2008 07:22
Quote: "1. How to restart the program? Just restart and reload all files."


While I have never actually done this, you could make a simple program for it. Have it as a separate executable, then call it in your code before terminating the program. For example, have both MAIN_PROGRAM.exe and MAIN_RESTART.exe, when needed to restart, have something like this;


This will run MAIN_RESTART.exe upon exiting the program. Then, once the program has exited, MAIN_RESTART.exe would fire up, doing something like;


which would execute the MAIN_PROGRAM.exe immediately as well as do any other functions you would need done.

Of course, I may be over-complicating the matter =P

Quote: "2. How to make texts with a sprite sheet? The Dark Invaders' code offseted the sprite sheet. (the text sprite sheet will contain all ASCII chars including invisible ones before 20.(or the InvaderText code without offsetting UV map)"


Like jinzai said, just use a paintlike program to offset the letters however you want. I suggest GraphicsGale free edition as it has some nice inbuilt grids.

Cheers!


Tux is my guildmaster.
SpaceMan Infinity
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location:
Posted: 13th Jun 2008 18:30
I just need a version of Dark Invader's InvaderText code without offestting UV
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 13th Jun 2008 19:39 Edited at: 13th Jun 2008 19:44
You can do that yourself....it is in the Assets folder of the DarkInvaders project...the file you want is font.png

The program does the UV offsetting internally.

It is 256x256 arranged as an 8x8 grid...each character is 32x32.

Login to post a reply

Server time is: 2024-11-20 13:38:40
Your offset time is: 2024-11-20 13:38:40