Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (dr_panther, Ayumi, 1 invisible), 877 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Code Snippet for custom counters font? #274226
06/26/09 07:23
06/26/09 07:23
Joined: Feb 2008
Posts: 69
Australia
M
MegaMarioDeluxe Offline OP
Junior Member
MegaMarioDeluxe  Offline OP
Junior Member
M

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! smile
~MegaMarioDeluxe


----
MegaMario
Regular 3D Game Studio User
http://www.krystalgaming.net
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 Offline
Expert
EvilSOB  Offline
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)

Originally Posted By: from the manual FONT entry
...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: EvilSOB] #274232
06/26/09 07:49
06/26/09 07:49
Joined: Feb 2008
Posts: 69
Australia
M
MegaMarioDeluxe Offline OP
Junior Member
MegaMarioDeluxe  Offline OP
Junior Member
M

Joined: Feb 2008
Posts: 69
Australia
Alright. So, how would you define a counter? I'm good with panels, but a rookie with counters. Sorry! :P


----
MegaMario
Regular 3D Game Studio User
http://www.krystalgaming.net
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 Offline
Expert
EvilSOB  Offline
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: EvilSOB] #274237
06/26/09 08:14
06/26/09 08:14
Joined: Feb 2008
Posts: 69
Australia
M
MegaMarioDeluxe Offline OP
Junior Member
MegaMarioDeluxe  Offline OP
Junior Member
M

Joined: Feb 2008
Posts: 69
Australia
Well, I did define the font (I took the * out after the FONT) like so:

FONT NormDigits = <resources\mpldigits.bmp>,16,16;

But now it says: Error (164) Range over/underrun odd font size.

Did I do something wrong? I added a 1x16 pixels at the end of the image, but that seemed to have no effect...


----
MegaMario
Regular 3D Game Studio User
http://www.krystalgaming.net
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 Offline
Expert
EvilSOB  Offline
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
Re: Code Snippet for custom counters font? [Re: EvilSOB] #274267
06/26/09 10:43
06/26/09 10:43
Joined: Feb 2008
Posts: 69
Australia
M
MegaMarioDeluxe Offline OP
Junior Member
MegaMarioDeluxe  Offline OP
Junior Member
M

Joined: Feb 2008
Posts: 69
Australia
OK, I'll try that. Thanks! smile


----
MegaMario
Regular 3D Game Studio User
http://www.krystalgaming.net
Re: Code Snippet for custom counters font? [Re: MegaMarioDeluxe] #274502
06/27/09 00:45
06/27/09 00:45
Joined: Feb 2008
Posts: 69
Australia
M
MegaMarioDeluxe Offline OP
Junior Member
MegaMarioDeluxe  Offline OP
Junior Member
M

Joined: Feb 2008
Posts: 69
Australia
Got it working now for my coins and lives display! I just modded the example in the manual under "PANEL { name... }", now it's working fine.

Thanks again, EvilSOB! smile


----
MegaMario
Regular 3D Game Studio User
http://www.krystalgaming.net
Re: Code Snippet for custom counters font? [Re: MegaMarioDeluxe] #274538
06/27/09 07:30
06/27/09 07:30
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Anytime.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1