UMSHud
Class DialogueHUD

source: e:\games\UnrealTournament\UMSHud\Classes\DialogueHUD.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.HUD
         |
         +--UMS1_6.MovieHUD
            |
            +--UMSHud.MovieHUD2
               |
               +--UMSHud.DialogueHUD
Direct Known Subclasses:None

class DialogueHUD
extends UMSHud.MovieHUD2

//============================================================================= // MovieHUD. // Created by Stephen 'Nemesis' Deaver, Yoda and Hugh Macdonald. //=============================================================================
Variables
 int DialogueFontSize
           Current font size for dialogue.
 string Lines
           Dialogue Line.
 color TextColor
           Current font color for dialogue.
 bool bDialogue
           Is the HUD in Dialogue mode?


Function Summary
 void Dialogue(Canvas C)
     
// Draw Dialogue to the screen.
 void PostRender(Canvas C)
 void SetUpDialogue(string Dialogue, int NewSize, color NewColor)
     
// Set up HUD for Dialogue.



Source Code


00001	//=============================================================================
00002	// MovieHUD.
00003	// Created by Stephen 'Nemesis' Deaver, Yoda and Hugh Macdonald.
00004	//=============================================================================
00005	class DialogueHUD expands MovieHUD2;
00006	
00007	var() string Lines;			// Dialogue Line.
00008	var() color TextColor;			// Current font color for dialogue.
00009	var() int DialogueFontSize;		// Current font size for dialogue.
00010	var() bool bDialogue;			// Is the HUD in Dialogue mode?
00011	
00012	function PostRender(Canvas C)
00013	{    
00014	
00015	    DrawHUDOverlay(C);
00016	
00017	    // Dialogue mode.
00018	    if(bDialogue)
00019	    {
00020	        Dialogue(C);
00021	    }
00022	}
00023	
00024	// Set up HUD for Dialogue.
00025	function SetUpDialogue(string Dialogue, int NewSize, color NewColor)
00026	{
00027	    Lines = Dialogue;
00028	        
00029	    if(NewSize > 0 && NewSize <= 7)
00030	        DialogueFontSize = NewSize;
00031	        
00032	    TextColor = NewColor;
00033	    
00034	    bDialogue = true;
00035	}
00036	
00037	// Draw Dialogue to the screen.
00038	function Dialogue(canvas C)
00039	{
00040	    local float XOffset, YOffset;
00041	    local int LinesLength;
00042	
00043	    LinesLength = len(Lines);
00044	    
00045	    XOffset = C.ClipX * 0.1;
00046	    YOffset = C.ClipY * 0.9;
00047	    C.SetPos(XOffset, YOffset);
00048	
00049	    SetFontSize (DialogueFontSize, C);
00050	
00051	    C.DrawColor = TextColor;
00052	    C.DrawText(Lines, False);
00053	}
00054	
00055	defaultproperties
00056	{
00057	     TextColor=(R=255)
00058	     DialogueFontSize=3
00059	}

End Source Code