A_Print

From ZDoom Wiki
Jump to: navigation, search

A_Print (string text[, float time[, string fontname]])

Usage

Prints a text to the caller's screen. This means the caller has to either be a player or be used as a camera by a player.

It can also be used from inventory items or weapons. In these cases the text will be printed to the screen of the player using this item.

The text can be formatted text.

Optionally, a duration for how long the message must be displayed can be passed. The default value of 0 means to use con_midtime.

Also optionally, a different font can be selected. By default, or if the font name given is invalid, it will use SmallFont.

Examples

This inventory item prints a message to the player when it is picked up.

actor goldenticket : CustomInventory
{
  Inventory.Amount 1
  Inventory.MaxAmount 1
  +INVBAR
  States
  {
  Spawn:
    GTIK ABCD 4
    Loop
  Pickup:
    GTIK A 0 A_Print("You got the golden ticket! Escape to the chocolate factory!")
    Stop
  }
}

See also