|
3 registered members (AndrewAMD, TipmyPip, 1 invisible),
8,980
guests, and 9
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Code Snippet for custom counters font?
#274226
06/26/09 07:23
06/26/09 07:23
|
Joined: Feb 2008
Posts: 69 Australia
MegaMarioDeluxe
OP
Junior Member
|
OP
Junior Member
Joined: Feb 2008
Posts: 69
Australia
|
Hey all, I'm working on a Mario 64 clone (as you possibly know) but anyway I was wondering if it's possible to make a counter display for the amount of lives remaining and coins my character is holding. The file that holds the 16x16 numbers is located in my 'resources/' folder that is in my project's root folder. This is the numbers in question: I was wondering if anyone could do me a code snippet so that I could use the said digits in my game. The purple/magenta is transparent. I use A6 (3DGS v6.x) so if it's A6 compatible, that would be great. Thanks!  ~MegaMarioDeluxe
|
|
|
Re: Code Snippet for custom counters font?
[Re: MegaMarioDeluxe]
#274229
06/26/09 07:43
06/26/09 07:43
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Add a "space" to the end of your image and you can just define it as a font. FONT* H_Digits = "filename.bmp"; (assuming PRAGMA_PATH'ed) ...The bitmap must either contain 11 characters - numbers 0..9 and space - for numerical displays...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Code Snippet for custom counters font?
[Re: MegaMarioDeluxe]
#274234
06/26/09 08:06
06/26/09 08:06
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
You know your panels? good. Make a panel (or two) that contain "digits" elements (check the manual under DIGITS). Make the digits the digits "Var" be global variables, and just tweak your player action keep updating the global vars with the current health/coins scores.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Code Snippet for custom counters font?
[Re: MegaMarioDeluxe]
#274238
06/26/09 08:19
06/26/09 08:19
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Did you add the spacing to the end of the mpldigits.bmp file? It should be 176 x 16.
(plus I have no idea on the transparency issue)
[EDIT] I noticed your PNG you posted above is oversized. You have 10 characters of 16x16, so it should by 160x16. But it is 168x16. Thats bad. Your finished font-image NEEDS to be 176x16 including the space. PS and the "transparent" color of a font is TRUE black. (RGB = 0,0,0)
Last edited by EvilSOB; 06/26/09 08:34.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|