Iven been reading the info at udn and wikipedia, but I cant figure out what part actually prints the info onscreen. For example in the myfirst example classes theres one called: ExampleHud.uc
This .uc file has:
class ExampleHUD extends HUD;
var PlayerController PlayerOwner;
var Material HUDScoreBox;
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
PlayerOwner = PlayerController(Owner);
}
function DrawHUD(canvas Canvas)
{
local Pawn PawnOwner;
local PlayerReplicationInfo PawnOwnerPRI;
local int FontSize;
local float HUDScoreScaleX, HUDScoreScaleY;
local float HUDScorePosX, HUDScorePosY;
local int Score;
local string ScoreString;
local float XL,YL;
// Get PlayerOwner
if (PlayerOwner.ViewTarget == PlayerOwner)
{
PawnOwner = PlayerOwner.Pawn;
}
else if (PlayerOwner.ViewTarget.IsA('Pawn') && Pawn(PlayerOwner.ViewTarget).Controller != None)
{
PawnOwner = Pawn(PlayerOwner.ViewTarget);
}
else if ( PlayerOwner.Pawn != None )
{
PawnOwner = PlayerOwner.Pawn;
}
else
{
PawnOwner = None;
}
// Get PlayerReplication
if ((PawnOwner != None) && (PawnOwner.Controller != None))
PawnOwnerPRI = PawnOwner.PlayerReplicationInfo;
else
PawnOwnerPRI = PlayerOwner.PlayerReplicationInfo;
//Get Font Size - (larger numbers are smaller fonts)
if ( Canvas.ClipX <= 640 )
FontSize=2;
else if ( Canvas.ClipX <= 800 )
FontSize=3;
else if ( Canvas.ClipX <= 1024 )
FontSize=2;
else if ( Canvas.ClipX <= 1280 )
FontSize=1;
else if ( Canvas.ClipX <= 1600 )
FontSize=0;
else
FontSize=0;
Canvas.Font = LoadFontStatic(FontSize);
// Draw Hud
Right now if I run it, theres a score at the right side of the screen that increases when I do the DoDance thing. What If I want to print a second score thing on the screen ? that increases when I do the fly for example ? Of all the code presented which part is actually displaying the score to the screen? Im new to this and I just need to get started, this will help me a lot thanks.
This .uc file has:
class ExampleHUD extends HUD;
var PlayerController PlayerOwner;
var Material HUDScoreBox;
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
PlayerOwner = PlayerController(Owner);
}
function DrawHUD(canvas Canvas)
{
local Pawn PawnOwner;
local PlayerReplicationInfo PawnOwnerPRI;
local int FontSize;
local float HUDScoreScaleX, HUDScoreScaleY;
local float HUDScorePosX, HUDScorePosY;
local int Score;
local string ScoreString;
local float XL,YL;
// Get PlayerOwner
if (PlayerOwner.ViewTarget == PlayerOwner)
{
PawnOwner = PlayerOwner.Pawn;
}
else if (PlayerOwner.ViewTarget.IsA('Pawn') && Pawn(PlayerOwner.ViewTarget).Controller != None)
{
PawnOwner = Pawn(PlayerOwner.ViewTarget);
}
else if ( PlayerOwner.Pawn != None )
{
PawnOwner = PlayerOwner.Pawn;
}
else
{
PawnOwner = None;
}
// Get PlayerReplication
if ((PawnOwner != None) && (PawnOwner.Controller != None))
PawnOwnerPRI = PawnOwner.PlayerReplicationInfo;
else
PawnOwnerPRI = PlayerOwner.PlayerReplicationInfo;
//Get Font Size - (larger numbers are smaller fonts)
if ( Canvas.ClipX <= 640 )
FontSize=2;
else if ( Canvas.ClipX <= 800 )
FontSize=3;
else if ( Canvas.ClipX <= 1024 )
FontSize=2;
else if ( Canvas.ClipX <= 1280 )
FontSize=1;
else if ( Canvas.ClipX <= 1600 )
FontSize=0;
else
FontSize=0;
Canvas.Font = LoadFontStatic(FontSize);
// Draw Hud
Right now if I run it, theres a score at the right side of the screen that increases when I do the DoDance thing. What If I want to print a second score thing on the screen ? that increases when I do the fly for example ? Of all the code presented which part is actually displaying the score to the screen? Im new to this and I just need to get started, this will help me a lot thanks.