Difference between revisions of "Lua:AddHudTimerToAll"

From Fortress Forever Wiki
Jump to navigationJump to search
(New page: {{Infobox manual/Header}} ==AddHudTimerToAll== Puts a countdown timer on a the screen of each player. ===Usage=== <pre>AddHudTimerToAll(hudID, timer, interval, x, y, align)</pre> ===Inp...)
 
m (2.42)
 
Line 1: Line 1:
 
{{Infobox manual/Header}}
 
{{Infobox manual/Header}}
 +
{{Infobox_mapping}}
 
==AddHudTimerToAll==
 
==AddHudTimerToAll==
  
Puts a countdown timer on a the screen of each player.
+
Puts a countdown timer on the screens of all players.
  
 
===Usage===
 
===Usage===
<pre>AddHudTimerToAll(hudID, timer, interval, x, y, align)</pre>
+
<pre>
 +
AddHudTimerToAll(huditemname, timer, interval, x, y, align)
 +
 
 +
AddHudTimerToAll(huditemname, timername, x, y )
 +
AddHudTimerToAll(huditemname, timername, x, y, align )
 +
AddHudTimerToAll(huditemname, timername, x, y, alignx, aligny )</pre>
  
 
===Input===
 
===Input===
* hudID(string) the name of this timer (so we can remove it later)
+
* huditemname(string) the name of this timer (so we can remove it later)
* timer(integer?) the inital number of seconds on the timer
+
 
* interval(integer?) amount of time to add to the timer per second?
+
* timer(integer) the inital number of seconds on the timer
 +
* interval(integer) amount of time to add to the timer per second
 +
OR:
 +
* timername(string) the name of a [[Lua:Timer]] object
 +
 
 
* x(integer) horizontal position
 
* x(integer) horizontal position
 
* y(integer) vertical position
 
* y(integer) vertical position
Line 23: Line 33:
  
 
===Example===
 
===Example===
<pre>local text_align = 4
+
 
local text_x = 40
+
AddHudTimerToAll("timer", 300, -1, 0, 70, 4)</pre>
local text_line1y = 84
 
local text_line2y = text_line1y + 8
 
local text_line3y = text_line2y + 8
 
AddHudTimerToAll( "gates_open_timer", current_timer, -1, text_x, text_line3y, text_align )</pre>
 
  
 
==Note==
 
==Note==

Latest revision as of 20:22, 25 June 2011


Mapping for FF
The Basics

Setting up Hammer
Getting Started With Lua
Releasing a map

FF-specific Entities

Lua location system

Map Templates
FF Lua Documentation

Entity Typing
Entity Collections

Commands
Callbacks

AddHudTimerToAll

Puts a countdown timer on the screens of all players.

Usage

AddHudTimerToAll(huditemname, timer, interval, x, y, align)

AddHudTimerToAll(huditemname, timername, x, y )
AddHudTimerToAll(huditemname, timername, x, y, align )
AddHudTimerToAll(huditemname, timername, x, y, alignx, aligny )

Input

  • huditemname(string) the name of this timer (so we can remove it later)
  • timer(integer) the inital number of seconds on the timer
  • interval(integer) amount of time to add to the timer per second

OR:

  • timername(string) the name of a Lua:Timer object
  • x(integer) horizontal position
  • y(integer) vertical position
  • align(integer) x alignment options:
    • 0: align to left
    • 1: align to right
    • 2: align to left of center
    • 3: align to right of center

Output

Returns noting

Example

AddHudTimerToAll("timer", 300, -1, 0, 70, 4)

Note

The timer is strictly a visual aid. To time actual game events, Use the Scheduling System