Interface
From Wiki001
Interfaces are the players HUD, or Heads Up Display. An interface is anything that is displayed on screen that is not part of the environment, such as the players health bar or the speedometer of their car. Since version 1.5, interfaces can be interactive. Now they can also act like menus, where the player can navigate using the arrow keys.
Contents |
Tools
Specific Notes
Since interfaces share some features from maps, the following outlines specifics when they are used in interfaces instead.
Dynamic Object
Dynamic objects are used to give the custom characteristic to the HUD. Also, they're often used along with fields to orient the player on what the field is determining. For example, a simple rotating dial doesn't mean anything to the player, but if a speedometer picture is added beneath the dial, then the player will be able to see that it is, in fact, a speedometer.
Timer/Spawn
Timers, on interfaces, are used mostly to add and remove the dynamic objects and fields on the screen. For example, if you're not in a car, there's no reason to keep seeing a gas meter all the time, so an event is added on the HUD timer to check if you're inside a car. If you are, show the gas meter, if you're not, hide it.
Also, you can use HUD timers as global timers. Since the interface is activated during the whole game (if not deactivated), these timers will keep running everywhere you go, anytime during the game. So for example, if you wanted to add a hunger bar, you could use a variable (hunger) being subtracted through the timer and also adding the hunger effects via the same timer.
IMPORTANT: Timers can be dangerous. Since they're being run all the time, they might lag the game if they have too little an interval along with a large script, so be careful when using them.



