Game Development Community

dev|Pro Game Development Curriculum

Bitmap Based GUI Scoring System

by Griffin Milsap · 11/13/2006 (4:42 pm) · 2 comments

Download Code File

Download the rar, and extract it. Install instructions in scorekeeper.gui have been pasted here too. Enjoy.

INSTALLATION:
----------------------------------
1. Add this to the bottom of client/ui/playgui.gui
new GuiControl(scorekeeper) {
      Profile = "GuiDefaultProfile";
      HorizSizing = "relative";
      VertSizing = "bottom";
      position = "371 10";
      Extent = "138 60";
      MinExtent = "8 2";
      Visible = "1";
         scoretens = "6";
         scoreones = "6";
         scorehuns = "9";

      new GuiBitmapCtrl(huns) {
         Profile = "GuiDefaultProfile";
         HorizSizing = "right";
         VertSizing = "bottom";
         position = "5 0";
         Extent = "40 60";
         MinExtent = "8 2";
         Visible = "1";
         bitmap = "";
         wrap = "0";
      };
      new GuiBitmapCtrl(tens) {
         Profile = "GuiDefaultProfile";
         HorizSizing = "right";
         VertSizing = "bottom";
         position = "49 0";
         Extent = "40 60";
         MinExtent = "8 2";
         Visible = "1";
         bitmap = "";
         wrap = "0";
      };
      new GuiBitmapCtrl(ones) {
         Profile = "GuiDefaultProfile";
         HorizSizing = "right";
         VertSizing = "bottom";
         position = "93 0";
         Extent = "40 60";
         MinExtent = "8 2";
         Visible = "1";
         bitmap = "";
         wrap = "0";
      };
   };


2. Set up numbers folder.

Create custom numbers graphics and edit this variable
to point to your numbers. They should be 1.png, 2.png, etc.
*/
$numbersfolder = "starter.fps/client/ui/numbers/";
/*
Or, use my numbers folder and put it in client/scripts/ui.


3. Execute the script

In client/init.cs, in the function initClient(), after:

// Load up the shell GUIs
exec("./ui/mainMenuGui.gui");
exec("./ui/QuitGui.gui");
exec("./ui/aboutDlg.gui");
exec("./ui/startMissionGui.gui");
exec("./ui/joinServerGui.gui");
exec("./ui/loadingGui.gui");
exec("./ui/endGameGui.gui");
exec("./ui/optionsDlg.gui");
exec("./ui/remapDlg.gui");
exec("./ui/StartupGui.gui");

Add:

exec("./ui/scorekeeper.gui");

------------------------------------

USAGE:
------------------------------------
Call initscorekeeper() to initialize the scorekeeper
Call incrimentscorekeeper() to incriment the scorekeeper
Call deincremintscorekeeper() to deincriment the scorekeeper
Call setscorekeeper(hundreds, tens, ones) to set the scorekeeper
------------------------------------

LISCENCE:
------------------------------------
Give me a small credit in the game :P.
If you're feeling generous, send me a copy.

#1
10/27/2006 (6:10 pm)
I searched GG and couldn't find any resource like this. I did this for a friend and decided to post it here for other people.

If you want more than three digits, the code is easily extendable with just a little know-how.

-Griff
#2
11/15/2006 (6:48 pm)
You can check the following resource too 3D Text