Display HUD

This is used to create a HUD display which lists objects, such as for an on-HUD inventory. When you add an new object, it will start in the corner which you define and every new object you add to the HUD will be added to that row, either progressively left or right depending on where your start corner is, until the row is full and then it will either move up or down a column and fill in another row. When the entire box that you've defined is full, you will not be able to add more objects to the display.

The start_x and start_y values represent the corner where objects will start being added first - typically the top-left, but this is up to user preference. The end_x and end_y values should be the opposite corner, so if your start corner is the top-left, then your ending corner should be the bottom-right. Assign the coordinates for where you want the start and ending corners to be located.

If your HUD uses pixel offsets, you can offset the display HUD's objects using the pixel_offset_x and pixel_offset_y values.

Step 2:

You need to create the display HUD for the client that will be using it. If this is something which will be used for all players, then you might use something like this:

client
var/display_hud/backpack/backpack = new()

Make sure you have a list to store objects in, since that is not included as part of this library.

Step 3:

As an example, if each player has their own backpack display HUD which is going to display the player's contents list, then we can add new items to the display HUD like this:

The display_hud.Add() function will add the object to the contents list, but it will NOT call the Move() proc. If you want to use Move() to check whether an item can be added to the list, you'll have to do that yourself.

If you want to remove an item from the list, you can do that like this: