Constructor
new TipDisplay()
Parameters:
| Name | Type | Description |
|---|---|---|
initData.tipScrolling |
boolean | Whether or not to enable the player to scroll through the tips and the tip images. |
initData.isOnLoadingScreen |
boolean | Whether or not the tip display is initialized by the game loading screen. |
hotloadData.tipFilesData |
Array | undefined | Hotloaded value storing last time's tipFilesData. |
hotloadData.tipIndex |
number | undefined | Hotloaded value pointing to a specific tip. |
hotloadData.tipImageIndex |
number | undefined | Hotloaded value pointing to a specific tip image. |
Members
CaptionNextTip
CaptionPreviousTip
ImagePath
Subdirectory of art/textures/ui storing the .png images illustrating the tips.
TextPath
Directory storing .txt files containing the multi and single player tips.
TipFilesDataFile
JSON file assigning one or more tip image files (.png) to each tip text file (.txt).
TooltipNextImage
TooltipNextTip
TooltipPreviousImage
TooltipPreviousTip
currentTip
currentTip
enableTipScrolling
imageControlPanel
nextImageButton
nextTipButton
previousImageButton
previousTipButton
tipFilesData
tipFilesData
tipImage
tipImageIndex
tipImageIndex
tipImageIndex
tipImageText
tipIndex
tipIndex
tipIndex
tipText
tipTitle
tipTitleDecoration
Methods
getHotloadData()
getLoadingScreenTip() → {Array}
Returns a randomized tip from a category.
Choosing a category is randomized based on it occurrence probability.
Returns:
- An array with a single element containing a tip object.
- Type
- Array
getRandomWeightedCategory(isMultiplayer, tipFiles) → {Object}
Returns a randomized category from an array of categories based on the probability weight.
Parameters:
| Name | Type | Description |
|---|---|---|
isMultiplayer |
boolean | True if we want to include the multiplayer category. |
tipFiles |
Array | An array containing all categories from the TipFilesDataFile. |
Returns:
- A randomized category object.
- Type
- Object