OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Functions
ItemGrid.h File Reference

Functions

int itemOffset (int dimension)
 itemOffset Calculate offsets for placing items on a grid. More...
 

Function Documentation

◆ itemOffset()

int itemOffset ( int  dimension)

itemOffset Calculate offsets for placing items on a grid.

Parameters
dimensionwidth or height of the item

Inventory grid have 32x32 cells. Items don't exactly fit into the grid, but are slightly smaller or larger. The function calculates offsets for the item to be centered. Calculations are the same for length and width.

Returns
offset in pixels