Tick (BaseStatusBar)

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


native virtual void Tick()

Usage

BaseStatusBar utilizes this function in the same way as Actor: it's called every 1/35th of a second. Internally this function handles messages, resetting the crosshair size, and inventory item flash durations. This can be used to handle variables and functionality you want to make sure is called at set intervals instead of tied to the frame rate.

Examples

A simple example of a custom statusbar with a custom integer field that gets counted down every tic:

class CustomStatusBar : BaseStatusBar
{
	int customTimer;

	override void Tick()
	{
		Super.Tick();
		if (customTimer)
		{
			customTimer--;
		}
	}
}