There is no spoon
Difference between revisions of "UE3:UTHUD (UT3)"
(Auto-generated page) |
(added descriptions) |
||
Line 6: | Line 6: | ||
| parent4 = Object | | parent4 = Object | ||
}} | }} | ||
− | + | The HUD class for Deathmatch and the base for all UT3 gametype HUDs. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
==Properties== | ==Properties== | ||
Line 20: | Line 15: | ||
'''[[Structs#Modifiers|Modifiers]]:''' native | '''[[Structs#Modifiers|Modifiers]]:''' native | ||
− | Holds | + | Holds data for directional damage indicators. |
− | ; [[float]] FadeTime : | + | ; [[float]] FadeTime : Time for fade-out. |
− | ; [[float]] FadeValue : | + | ; [[float]] FadeValue : Current fade value. |
− | ; {{cl|MaterialInstanceConstant}} MatConstant : | + | ; {{cl|MaterialInstanceConstant}} MatConstant : The MIC for this indicator. |
==Functions== | ==Functions== | ||
Line 36: | Line 31: | ||
{{code|static simulated function '''DrawBackground''' ([[float]] '''X''', [[float]] '''Y''', [[float]] '''Width''', [[float]] '''Height''', {{tl|LinearColor|Object|structs}} '''DrawColor''', {{cl|Canvas}} '''DrawCanvas''')}} | {{code|static simulated function '''DrawBackground''' ([[float]] '''X''', [[float]] '''Y''', [[float]] '''Width''', [[float]] '''Height''', {{tl|LinearColor|Object|structs}} '''DrawColor''', {{cl|Canvas}} '''DrawCanvas''')}} | ||
− | + | Draws the background of player, vehicle and objective beacons. | |
====DrawBarGraph==== | ====DrawBarGraph==== | ||
{{code|static simulated function '''DrawBarGraph''' ([[float]] '''X''', [[float]] '''Y''', [[float]] '''Width''', [[float]] '''MaxWidth''', [[float]] '''Height''', {{cl|Canvas}} '''DrawCanvas''', {{tl|Color|Object|structs}} '''BarColor''', {{tl|Color|Object|structs}} '''BackColor''')}} | {{code|static simulated function '''DrawBarGraph''' ([[float]] '''X''', [[float]] '''Y''', [[float]] '''Width''', [[float]] '''MaxWidth''', [[float]] '''Height''', {{cl|Canvas}} '''DrawCanvas''', {{tl|Color|Object|structs}} '''BarColor''', {{tl|Color|Object|structs}} '''BackColor''')}} | ||
− | + | Draws a horizontal bar graph, e.g. for player health. | |
====DrawHealth==== | ====DrawHealth==== | ||
{{code|static simulated function '''DrawHealth''' ([[float]] '''X''', [[float]] '''Y''', [[float]] '''Width''', [[float]] '''MaxWidth''', [[float]] '''Height''', {{cl|Canvas}} '''DrawCanvas''', optional [[byte]] '''Alpha''')}} | {{code|static simulated function '''DrawHealth''' ([[float]] '''X''', [[float]] '''Y''', [[float]] '''Width''', [[float]] '''MaxWidth''', [[float]] '''Height''', {{cl|Canvas}} '''DrawCanvas''', optional [[byte]] '''Alpha''')}} | ||
− | + | Wrapper function for {{tl|DrawBarGraph}}() specifically for health-like graphs. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
====FormatTime==== | ====FormatTime==== | ||
{{code|static function [[string]] '''FormatTime''' ([[int]] '''Seconds''')}} | {{code|static function [[string]] '''FormatTime''' ([[int]] '''Seconds''')}} | ||
− | + | Converts the number of seconds into a time string of the form HH:MM:SS. | |
====GetFontSizeIndex==== | ====GetFontSizeIndex==== | ||
Line 62: | Line 53: | ||
'''Overrides:''' {{tl|GetFontSizeIndex|HUD}} | '''Overrides:''' {{tl|GetFontSizeIndex|HUD}} | ||
− | + | Returns a font from the default {{tl|HudFonts||UTHUD properties}} array. Valid font sizes range from 0 to 3, values outside the range are clamped to the nearest valid value. | |
====GetTeamColor==== | ====GetTeamColor==== | ||
{{code|static simulated function '''GetTeamColor''' ([[int]] '''TeamIndex''', optional out {{tl|LinearColor|Object|structs}} '''ImageColor''', optional out {{tl|Color|Object|structs}} '''TextColor''')}} | {{code|static simulated function '''GetTeamColor''' ([[int]] '''TeamIndex''', optional out {{tl|LinearColor|Object|structs}} '''ImageColor''', optional out {{tl|Color|Object|structs}} '''TextColor''')}} | ||
− | + | Returns image color red for team 0, blue for team 1 and white for any other team index. Always returns "light gold" (a pale yellow) as the text color. | |
===Exec functions=== | ===Exec functions=== | ||
Line 73: | Line 64: | ||
{{code|exec function '''GrowHUD''' ()}} | {{code|exec function '''GrowHUD''' ()}} | ||
− | + | Adds missing elements to HUD. | |
====ReleaseShowScores==== | ====ReleaseShowScores==== | ||
{{code|exec function '''ReleaseShowScores''' ()}} | {{code|exec function '''ReleaseShowScores''' ()}} | ||
− | + | Hides the scoreboard. | |
====SetShowScores==== | ====SetShowScores==== | ||
Line 85: | Line 76: | ||
'''Overrides:''' {{tl|SetShowScores|HUD}} | '''Overrides:''' {{tl|SetShowScores|HUD}} | ||
− | + | Shows or hides the scoreboard according to the parameter value. | |
====ShowAllAI==== | ====ShowAllAI==== | ||
{{code|exec function '''ShowAllAI''' ()}} | {{code|exec function '''ShowAllAI''' ()}} | ||
− | + | Toggles whether AI information should be drawn for each bot {{cl|Pawn}}. | |
====ShowQuickPickMenu==== | ====ShowQuickPickMenu==== | ||
{{code|exec function '''ShowQuickPickMenu''' ([[bool]] '''bShow''')}} | {{code|exec function '''ShowQuickPickMenu''' ([[bool]] '''bShow''')}} | ||
− | + | Shows or hides the Quick Pick Menu according to the parameter value. | |
====ShowSquadRoutes==== | ====ShowSquadRoutes==== | ||
{{code|exec function '''ShowSquadRoutes''' ()}} | {{code|exec function '''ShowSquadRoutes''' ()}} | ||
− | + | Renders all squad routes of the currently spectated bot as persistent lines in the level. Each route gets a random color. | |
====ShrinkHUD==== | ====ShrinkHUD==== | ||
{{code|exec function '''ShrinkHUD''' ()}} | {{code|exec function '''ShrinkHUD''' ()}} | ||
− | + | Removes elements from HUD. | |
====StartMusic==== | ====StartMusic==== | ||
{{code|exec function '''StartMusic''' ()}} | {{code|exec function '''StartMusic''' ()}} | ||
− | + | Creates a {{cl|UTMusicManager}} for the player, unless there already is a music manager for that player. | |
====ToggleHUD==== | ====ToggleHUD==== | ||
Line 117: | Line 108: | ||
'''Overrides:''' {{tl|ToggleHUD|HUD}} | '''Overrides:''' {{tl|ToggleHUD|HUD}} | ||
− | + | Toggles the entire HUD on/off. | |
===Native functions=== | ===Native functions=== | ||
Line 123: | Line 114: | ||
{{code|native function '''DisplayWeaponBar''' ()}} | {{code|native function '''DisplayWeaponBar''' ()}} | ||
− | + | Draws the weapon bar. | |
+ | |||
+ | There doesn't seem to be any easy way to customize the behavior of this function. It's not declared as ''final'', so [[creating a custom weapon bar in UT3]] is possible by overriding it and completely reimplementing its functionality in [[UnrealScript]]. | ||
====DrawActorOverlays==== | ====DrawActorOverlays==== | ||
Line 147: | Line 140: | ||
'''Overrides:''' {{tl|PostBeginPlay|HUD}} | '''Overrides:''' {{tl|PostBeginPlay|HUD}} | ||
− | Create a list of actors needing | + | Create a list of actors needing {{tl|PostRenderFor||Actor events}}() calls. (That would be all {{cl|Pawn}}s that are neither {{cl|UTPawn}}s nor {{cl|UTVehicle}}s, all {{cl|UTGameObjective}}s, all {{cl|UTOnslaughtNodeTeleporter}}s, all {{cl|UTDeployableNodeLocker}}s and all {{cl|UTOnslaughtFlag}}s.) Other actors are free to register themselves via the {{tl|AddPostRenderedActor|UTHUD|instance functions}}() function. |
====PostRender==== | ====PostRender==== | ||
Line 154: | Line 147: | ||
'''Overrides:''' {{tl|PostRender|HUD}} | '''Overrides:''' {{tl|PostRender|HUD}} | ||
− | + | Updates drawing-related HUD properties, then calls {{tl|DrawHUD||UTHUD instance functions}}() unless {{tl|bShowHUD|HUD}} is ''False''. | |
− | + | ||
− | + | ||
====Timer==== | ====Timer==== | ||
Line 163: | Line 154: | ||
'''Overrides:''' {{tl|Timer|Actor|events}} | '''Overrides:''' {{tl|Timer|Actor|events}} | ||
− | + | Sorts the list of {{cl|PlayerReplicationInfo}}s via {{tl|SortPRIArray|GameReplicationInfo}}(). | |
===Other instance functions=== | ===Other instance functions=== | ||
See {{cl|UTHUD instance functions}}. | See {{cl|UTHUD instance functions}}. |
Revision as of 23:47, 25 July 2009
- Package:
- UTGame
- Direct subclasses:
- UTTeamHUD, UTBetrayalHUD
- This class in other games:
- UDK
The HUD class for Deathmatch and the base for all UT3 gametype HUDs.
Properties
See UTHUD properties.
Structs
DamageInfo
Modifiers: native
Holds data for directional damage indicators.
- float FadeTime
- Time for fade-out.
- float FadeValue
- Current fade value.
- MaterialInstanceConstant MatConstant
- The MIC for this indicator.
Functions
Static native functions
TranslateBindToFont
Convert a string with potential escape sequenced data in it to a font and the string that should be displayed
Other static functions
DrawBackground
Draws the background of player, vehicle and objective beacons.
DrawBarGraph
Draws a horizontal bar graph, e.g. for player health.
DrawHealth
Wrapper function for DrawBarGraph() specifically for health-like graphs.
FormatTime
Converts the number of seconds into a time string of the form HH:MM:SS.
GetFontSizeIndex
Overrides: HUD.GetFontSizeIndex
Returns a font from the default HudFonts array. Valid font sizes range from 0 to 3, values outside the range are clamped to the nearest valid value.
GetTeamColor
Returns image color red for team 0, blue for team 1 and white for any other team index. Always returns "light gold" (a pale yellow) as the text color.
Exec functions
GrowHUD
Adds missing elements to HUD.
ReleaseShowScores
Hides the scoreboard.
SetShowScores
Overrides: HUD.SetShowScores
Shows or hides the scoreboard according to the parameter value.
ShowAllAI
Toggles whether AI information should be drawn for each bot Pawn.
ShowQuickPickMenu
Shows or hides the Quick Pick Menu according to the parameter value.
ShowSquadRoutes
Renders all squad routes of the currently spectated bot as persistent lines in the level. Each route gets a random color.
ShrinkHUD
Removes elements from HUD.
StartMusic
Creates a UTMusicManager for the player, unless there already is a music manager for that player.
ToggleHUD
Overrides: HUD.ToggleHUD
Toggles the entire HUD on/off.
Native functions
DisplayWeaponBar
Draws the weapon bar.
There doesn't seem to be any easy way to customize the behavior of this function. It's not declared as final, so creating a custom weapon bar in UT3 is possible by overriding it and completely reimplementing its functionality in UnrealScript.
DrawActorOverlays
DrawGlowText
Draw a glowing string
LinkToHudScene
This function will attempt to auto-link up HudWidgets to their associated transient property here in the hud.
Events
PostBeginPlay
Overrides: HUD.PostBeginPlay
Create a list of actors needing PostRenderFor() calls. (That would be all Pawns that are neither UTPawns nor UTVehicles, all UTGameObjectives, all UTOnslaughtNodeTeleporters, all UTDeployableNodeLockers and all UTOnslaughtFlags.) Other actors are free to register themselves via the UTHUD.AddPostRenderedActor() function.
PostRender
Overrides: HUD.PostRender
Updates drawing-related HUD properties, then calls DrawHUD() unless HUD.bShowHUD is False.
Timer
Overrides: Actor.Timer
Sorts the list of PlayerReplicationInfos via GameReplicationInfo.SortPRIArray().