TombEngine/Documentation/doc/5 lua utility modules/Diary.html
2025-03-28 23:39:49 +01:00

989 lines
36 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.8.1 Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>&nbsp;TombEngine</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>1 Modules</h2>
<ul class="nowrap">
<li> <a href="../1 modules/Effects.html">Effects</a></li>
<li> <a href="../1 modules/Flow.html">Flow</a></li>
<li> <a href="../1 modules/Input.html">Input</a></li>
<li> <a href="../1 modules/Inventory.html">Inventory</a></li>
<li> <a href="../1 modules/Logic.html">Logic</a></li>
<li> <a href="../1 modules/Objects.html">Objects</a></li>
<li> <a href="../1 modules/Sound.html">Sound</a></li>
<li> <a href="../1 modules/Strings.html">Strings</a></li>
<li> <a href="../1 modules/Util.html">Util</a></li>
<li> <a href="../1 modules/View.html">View</a></li>
</ul>
<h2>2 Classes</h2>
<ul class="nowrap">
<li> <a href="../2 classes/Collision.Probe.html">Collision.Probe</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.Statistics.html">Flow.Statistics</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>
<li> <a href="../2 classes/Objects.Moveable.html">Objects.Moveable</a></li>
<li> <a href="../2 classes/Objects.Room.html">Objects.Room</a></li>
<li> <a href="../2 classes/Objects.Sink.html">Objects.Sink</a></li>
<li> <a href="../2 classes/Objects.SoundSource.html">Objects.SoundSource</a></li>
<li> <a href="../2 classes/Objects.Static.html">Objects.Static</a></li>
<li> <a href="../2 classes/Objects.Volume.html">Objects.Volume</a></li>
<li> <a href="../2 classes/Strings.DisplayString.html">Strings.DisplayString</a></li>
<li> <a href="../2 classes/View.DisplaySprite.html">View.DisplaySprite</a></li>
</ul>
<h2>3 Primitive Classes</h2>
<ul class="nowrap">
<li> <a href="../3 primitive classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../3 primitive classes/Flow.Horizon.html">Flow.Horizon</a></li>
<li> <a href="../3 primitive classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../3 primitive classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../3 primitive classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../3 primitive classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../3 primitive classes/Color.html">Color</a></li>
<li> <a href="../3 primitive classes/Rotation.html">Rotation</a></li>
<li> <a href="../3 primitive classes/Time.html">Time</a></li>
<li> <a href="../3 primitive classes/Vec2.html">Vec2</a></li>
<li> <a href="../3 primitive classes/Vec3.html">Vec3</a></li>
</ul>
<h2>4 Enums</h2>
<ul class="nowrap">
<li> <a href="../4 enums/Collision.MaterialType.html">Collision.MaterialType</a></li>
<li> <a href="../4 enums/Effects.BlendID.html">Effects.BlendID</a></li>
<li> <a href="../4 enums/Effects.EffectID.html">Effects.EffectID</a></li>
<li> <a href="../4 enums/Effects.StreamerFeatherMode.html">Effects.StreamerFeatherMode</a></li>
<li> <a href="../4 enums/Effects.ParticleAnimationType.html">Effects.ParticleAnimationType</a></li>
<li> <a href="../4 enums/Flow.ErrorMode.html">Flow.ErrorMode</a></li>
<li> <a href="../4 enums/Flow.FreezeMode.html">Flow.FreezeMode</a></li>
<li> <a href="../4 enums/Flow.GameStatus.html">Flow.GameStatus</a></li>
<li> <a href="../4 enums/Input.ActionID.html">Input.ActionID</a></li>
<li> <a href="../4 enums/Objects.AmmoType.html">Objects.AmmoType</a></li>
<li> <a href="../4 enums/Objects.HandStatus.html">Objects.HandStatus</a></li>
<li> <a href="../4 enums/Objects.WeaponType.html">Objects.WeaponType</a></li>
<li> <a href="../4 enums/Objects.MoveableStatus.html">Objects.MoveableStatus</a></li>
<li> <a href="../4 enums/Objects.ObjID.html">Objects.ObjID</a></li>
<li> <a href="../4 enums/Objects.RoomFlagID.html">Objects.RoomFlagID</a></li>
<li> <a href="../4 enums/Objects.RoomReverb.html">Objects.RoomReverb</a></li>
<li> <a href="../4 enums/Sound.SoundTrackType.html">Sound.SoundTrackType</a></li>
<li> <a href="../4 enums/Strings.DisplayStringOption.html">Strings.DisplayStringOption</a></li>
<li> <a href="../4 enums/Util.LogLevel.html">Util.LogLevel</a></li>
<li> <a href="../4 enums/View.AlignMode.html">View.AlignMode</a></li>
<li> <a href="../4 enums/View.CameraType.html">View.CameraType</a></li>
<li> <a href="../4 enums/View.PostProcessMode.html">View.PostProcessMode</a></li>
<li> <a href="../4 enums/View.ScaleMode.html">View.ScaleMode</a></li>
</ul>
<h2>5 Lua utility modules</h2>
<ul class="nowrap">
<li> <a href="../5 lua utility modules/CustomBar.html">CustomBar</a></li>
<li> <here>Diary</here></li>
<li> <a href="../5 lua utility modules/EventSequence.html">EventSequence</a></li>
<li> <a href="../5 lua utility modules/Timer.html">Timer</a></li>
<li> <a href="../5 lua utility modules/Type.html">Type</a></li>
</ul>
</div>
<div id="content">
<h1>Lua utility module <code>Diary</code></h1>
<p>This module provides functions to create and manage diaries.</p>
<p>
<p> It maintains diary definitions and entries through all levels and hubs.
Each diary is accessed by the object that was used to create it. </p>
<p> Example usage:</p>
<pre>
<span class="keyword">local</span> CustomDiary = <span class="global">require</span>(<span class="string">"Engine.CustomDiary"</span>)
<span class="comment">--This function creates a diary from the DiarySetup.lua template file in script folder
</span>CustomDiary.ImportDiary(<span class="string">"DiarySetup"</span>)
<span class="comment">--This method gets the diary that was created with the DIARY_ITEM object and stores it in variable diary.
</span><span class="keyword">local</span> diary = CustomDiary.Get(TEN.Objects.ObjID.DIARY_ITEM)
<span class="comment">--This method opens the diary on the 3rd page
</span>diary:showDiary(<span class="number">3</span>)
</pre>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" ><a href="#CustomDiary.ImportDiary">CustomDiary.ImportDiary(fileName)</a></td>
<td class="summary">Imports diary from an external file.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary.Create">CustomDiary.Create(object, objectIdBg, spriteIdBg, colorBg, pos, rot, scale, alignMode, scaleMode, blendMode, alpha, pageSound, exitSound)</a></td>
<td class="summary">Creates a diary with extensive configuration options.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary.Get">CustomDiary.Get(object)</a></td>
<td class="summary">The function retrieves a diary by its unique object.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary.Delete">CustomDiary.Delete(object)</a></td>
<td class="summary">The function removes a custom diary and its associated data from the system.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary.Status">CustomDiary.Status(value)</a></td>
<td class="summary">The function adds the callback to enable diaries in levels.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:IsVisible">CustomDiary:IsVisible()</a></td>
<td class="summary">The function checks whether the specified diary is currently visible.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:ShowDiary">CustomDiary:ShowDiary(pageIndex)</a></td>
<td class="summary">The function displays the specified diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:GetUnlockedPageCount">CustomDiary:GetUnlockedPageCount()</a></td>
<td class="summary">The function returns the number of unlocked pages in the diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:UnlockPages">CustomDiary:UnlockPages(pageIndex, notification)</a></td>
<td class="summary">The function unlocks the specified diary up to the given page number.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:ClearPage">CustomDiary:ClearPage(pageIndex)</a></td>
<td class="summary">The function clears the page for the diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:AddTextEntry">CustomDiary:AddTextEntry(pageIndex, text, textPos, textOptions, textScale, textColor)</a></td>
<td class="summary">Adds a text entry to the specified page for the diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:AddImageEntry">CustomDiary:AddImageEntry(pageIndex, objectId, spriteId, color, pos, rot, scale, alignMode, scaleMode, blendMode)</a></td>
<td class="summary">Adds an image entry to the specified page for the diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:AddNarration">CustomDiary:AddNarration(pageIndex, trackName)</a></td>
<td class="summary">Add a narration track in the voice channel to the page.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:RemoveNarration">CustomDiary:RemoveNarration(pageIndex)</a></td>
<td class="summary">Remove the narration track from the page of the specified diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:AddBackground">CustomDiary:AddBackground(objectId, spriteId, color, pos, rot, scale, alignMode, scaleMode, blendMode, alpha)</a></td>
<td class="summary">Add a background image for the diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:ClearBackground">CustomDiary:ClearBackground()</a></td>
<td class="summary">Clears settings for the background for the specified diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:CustomizeNotification">CustomDiary:CustomizeNotification(notificationTime, objectId, spriteId, color, pos, rot, scale, alignMode, scaleMode, blendMode, notificationSound)</a></td>
<td class="summary">Customizes the notification icon and sound for the diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:ClearNotification">CustomDiary:ClearNotification()</a></td>
<td class="summary">Clears settings for the notification system for the specified diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:CustomizePageNumbers">CustomDiary:CustomizePageNumbers(pageNoType, prefix, separator, textPos, textOptions, textScale, textColor)</a></td>
<td class="summary">Customizes the page numbers for the diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:ClearPageNumbers">CustomDiary:ClearPageNumbers()</a></td>
<td class="summary">Clears settings for the page numbers for the specified diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:CustomizeControls">CustomDiary:CustomizeControls(textPos, textOptions, textScale, textColor)</a></td>
<td class="summary">Customizes the controls text for the diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:CustomizeControlsText">CustomDiary:CustomizeControlsText(string1, string2, string3, string4, separator)</a></td>
<td class="summary">Customizes the display text for controls for specified diary.</td>
</tr>
<tr>
<td class="name" ><a href="#CustomDiary:ClearControls">CustomDiary:ClearControls()</a></td>
<td class="summary">Clears settings for the specified diary's controls text.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "CustomDiary.ImportDiary"></a>
<strong>CustomDiary.ImportDiary(fileName)</strong>
</dt>
<dd>
Imports diary from an external file. There are different types that must be defined. (diary, background, controls, pageNumbers, notification, image, text, narration). Each of the section's arguements are the same as the functions described in this documentation.
Refer to DiarySetup.lua file for a sample script.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">fileName</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Name of file in the script folder without extension to import the diary from.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary.Create"></a>
<strong>CustomDiary.Create(object, objectIdBg, spriteIdBg, colorBg, pos, rot, scale, alignMode, scaleMode, blendMode, alpha, pageSound, exitSound)</strong>
</dt>
<dd>
Creates a diary with extensive configuration options.
Parameters:
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">object</span>
<span class="types"><a class="type" href="../4 enums/Objects.ObjID.html#">ObjID</a></span>
The pickup object that will be used to create the diary. The diary can be created using PICKUP<em>ITEMX (596-611) or DIARY</em>ITEM (986). Access the diary by selecting the item in the inventory.
</li>
<li><span class="parameter">objectIdBg</span>
<span class="types"><a class="type" href="../4 enums/Objects.ObjID.html#">ObjID</a></span>
Object ID for the diary's sprite.
</li>
<li><span class="parameter">spriteIdBg</span>
<span class="types"><span class="type">int</span></span>
SpriteID from the specified object for the diary's sprite.
</li>
<li><span class="parameter">colorBg</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
Color of diary's sprite.
</li>
<li><span class="parameter">pos</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y position of the bar's background in screen percent (0-100).
</li>
<li><span class="parameter">rot</span>
<span class="types"><span class="type">float</span></span>
rotation of the diary's sprite (0-360).
</li>
<li><span class="parameter">scale</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y Scaling factor for the bar's background sprite.
</li>
<li><span class="parameter">alignMode</span>
<span class="types"><a class="type" href="../4 enums/View.AlignMode.html#">AlignMode</a></span>
Alignment for the diary's sprite.
</li>
<li><span class="parameter">scaleMode</span>
<span class="types"><a class="type" href="../4 enums/View.ScaleMode.html#">ScaleMode</a></span>
Scaling for the diary's sprite.
</li>
<li><span class="parameter">blendMode</span>
<span class="types"><a class="type" href="../4 enums/Effects.BlendID.html#">BlendID</a></span>
Blending modes for the diary's sprite.
</li>
<li><span class="parameter">alpha</span>
<span class="types"><span class="type">number</span></span>
alpha value for the diary's sprite (0-255).
</li>
<li><span class="parameter">pageSound</span>
<span class="types"><a class="type" href="../1 modules/Sound.html#">Sound</a></span>
Sound to play with page turn.
</li>
<li><span class="parameter">exitSound</span>
<span class="types"><a class="type" href="../1 modules/Sound.html#">Sound</a></span>
Sound to play when existing the diary.
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">CustomDiary</span></span>
</ol>
</dd>
<dt>
<a name = "CustomDiary.Get"></a>
<strong>CustomDiary.Get(object)</strong>
</dt>
<dd>
The function retrieves a diary by its unique object. This function is useful when you need to access or manipulate a diary that has already been created .
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">object</span>
<span class="types"><a class="type" href="../4 enums/Objects.ObjID.html#">ObjID</a></span>
The pickup object that was used to create the diary (596-611,986).
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">CustomDiary</span></span>
The diary created using the object.
</ol>
</dd>
<dt>
<a name = "CustomDiary.Delete"></a>
<strong>CustomDiary.Delete(object)</strong>
</dt>
<dd>
The function removes a custom diary and its associated data from the system. It ensures that the diary is no longer tracked or accessible in the LevelVars.Engine.Diaries.
Please call this once a diary has served its purpose. It helps reduce the savegame size.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">object</span>
<span class="types"><a class="type" href="../4 enums/Objects.ObjID.html#">ObjID</a></span>
The pickup object that was used to create the diary (596-611,986).
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary.Status"></a>
<strong>CustomDiary.Status(value)</strong>
</dt>
<dd>
The function adds the callback to enable diaries in levels. This needs to be added to every level preferably in the LevelFuncs.OnStart.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">value</span>
<span class="types"><span class="type">bool</span></span>
True enables the diaries to be activated. False would disable the diaries.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:IsVisible"></a>
<strong>CustomDiary:IsVisible()</strong>
</dt>
<dd>
The function checks whether the specified diary is currently visible.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
true if the diary is visible and false if it is not.
</ol>
</dd>
<dt>
<a name = "CustomDiary:ShowDiary"></a>
<strong>CustomDiary:ShowDiary(pageIndex)</strong>
</dt>
<dd>
The function displays the specified diary. Can be used to call the diary directly using volume or classic triggers.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pageIndex</span>
<span class="types"><span class="type">int</span></span>
The page number at which diary should be opened.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:GetUnlockedPageCount"></a>
<strong>CustomDiary:GetUnlockedPageCount()</strong>
</dt>
<dd>
The function returns the number of unlocked pages in the diary.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
total number of unlocked pages in the diary.
</ol>
</dd>
<dt>
<a name = "CustomDiary:UnlockPages"></a>
<strong>CustomDiary:UnlockPages(pageIndex, notification)</strong>
</dt>
<dd>
The function unlocks the specified diary up to the given page number. <br/>
This value can be overridden to lock or unlock pages as needed.
A lower number can be set to restrict access to previously unlocked pages.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pageIndex</span>
<span class="types"><span class="type">int</span></span>
The page number up to which the diary should be unlocked.
</li>
<li><span class="parameter">notification</span>
<span class="types"><span class="type">bool</span></span>
If true, and notification has been defined, a notification icon and sound will be played.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:ClearPage"></a>
<strong>CustomDiary:ClearPage(pageIndex)</strong>
</dt>
<dd>
The function clears the page for the diary.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pageIndex</span>
<span class="types"><span class="type">int</span></span>
The page number to be cleared.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:AddTextEntry"></a>
<strong>CustomDiary:AddTextEntry(pageIndex, text, textPos, textOptions, textScale, textColor)</strong>
</dt>
<dd>
Adds a text entry to the specified page for the diary.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pageIndex</span>
<span class="types"><span class="type">int</span></span>
page number to add the text entry to.
</li>
<li><span class="parameter">text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Text entry to be added to the page.
</li>
<li><span class="parameter">textPos</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y position of the text.
</li>
<li><span class="parameter">textOptions</span>
<span class="types"><a class="type" href="../4 enums/Strings.DisplayStringOption.html#">DisplayStringOption</a></span>
alignment and effects for the text. Default: None. Please note text is automatically aligned to the LEFT
</li>
<li><span class="parameter">textScale</span>
<span class="types"><span class="type">number</span></span>
Scale factor for the text.
</li>
<li><span class="parameter">textColor</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
Color of the text.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:AddImageEntry"></a>
<strong>CustomDiary:AddImageEntry(pageIndex, objectId, spriteId, color, pos, rot, scale, alignMode, scaleMode, blendMode)</strong>
</dt>
<dd>
Adds an image entry to the specified page for the diary.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pageIndex</span>
<span class="types"><span class="type">int</span></span>
page number to add the image entry to.
</li>
<li><span class="parameter">objectId</span>
<span class="types"><a class="type" href="../4 enums/Objects.ObjID.html#">ObjID</a></span>
Object ID for the image entry sprite.
</li>
<li><span class="parameter">spriteId</span>
<span class="types"><span class="type">number</span></span>
SpriteID from the specified object for the image entry.
</li>
<li><span class="parameter">color</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
Color of image entry.
</li>
<li><span class="parameter">pos</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y position of the image entry in screen percent (0-100).
</li>
<li><span class="parameter">rot</span>
<span class="types"><span class="type">number</span></span>
rotation of the image entry (0-360).
</li>
<li><span class="parameter">scale</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y Scaling factor for the image entry.
</li>
<li><span class="parameter">alignMode</span>
<span class="types"><a class="type" href="../4 enums/View.AlignMode.html#">AlignMode</a></span>
Alignment for the image entry.
</li>
<li><span class="parameter">scaleMode</span>
<span class="types"><a class="type" href="../4 enums/View.ScaleMode.html#">ScaleMode</a></span>
Scaling for the image entry.
</li>
<li><span class="parameter">blendMode</span>
<span class="types"><a class="type" href="../4 enums/Effects.BlendID.html#">BlendID</a></span>
Blending modes for the image entry.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:AddNarration"></a>
<strong>CustomDiary:AddNarration(pageIndex, trackName)</strong>
</dt>
<dd>
Add a narration track in the voice channel to the page. Track is played with the draw button.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pageIndex</span>
<span class="types"><span class="type">int</span></span>
page number to add the narration track to.
</li>
<li><span class="parameter">trackName</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
of track (without file extension) to play.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:RemoveNarration"></a>
<strong>CustomDiary:RemoveNarration(pageIndex)</strong>
</dt>
<dd>
Remove the narration track from the page of the specified diary.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pageIndex</span>
<span class="types"><span class="type">int</span></span>
page number to remove the narration track from.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:AddBackground"></a>
<strong>CustomDiary:AddBackground(objectId, spriteId, color, pos, rot, scale, alignMode, scaleMode, blendMode, alpha)</strong>
</dt>
<dd>
Add a background image for the diary.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">objectId</span>
<span class="types"><a class="type" href="../4 enums/Objects.ObjID.html#">ObjID</a></span>
Object ID for the diary's background.
</li>
<li><span class="parameter">spriteId</span>
<span class="types"><span class="type">number</span></span>
SpriteID from the specified object for the diary's background.
</li>
<li><span class="parameter">color</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
Color of diary's background.
</li>
<li><span class="parameter">pos</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y position of the diary's background in screen percent (0-100).
</li>
<li><span class="parameter">rot</span>
<span class="types"><span class="type">float</span></span>
rotation of the diary's background sprite (0-360).
</li>
<li><span class="parameter">scale</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y Scaling factor for the diary's background.
</li>
<li><span class="parameter">alignMode</span>
<span class="types"><a class="type" href="../4 enums/View.AlignMode.html#">AlignMode</a></span>
Alignment for the diary's background.
</li>
<li><span class="parameter">scaleMode</span>
<span class="types"><a class="type" href="../4 enums/View.ScaleMode.html#">ScaleMode</a></span>
Scaling for the diary's background.
</li>
<li><span class="parameter">blendMode</span>
<span class="types"><a class="type" href="../4 enums/Effects.BlendID.html#">BlendID</a></span>
Blending modes for the diary's background.
</li>
<li><span class="parameter">alpha</span>
<span class="types"><span class="type">number</span></span>
alpha value for the diary's background (0-255).
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:ClearBackground"></a>
<strong>CustomDiary:ClearBackground()</strong>
</dt>
<dd>
Clears settings for the background for the specified diary.
</dd>
<dt>
<a name = "CustomDiary:CustomizeNotification"></a>
<strong>CustomDiary:CustomizeNotification(notificationTime, objectId, spriteId, color, pos, rot, scale, alignMode, scaleMode, blendMode, notificationSound)</strong>
</dt>
<dd>
Customizes the notification icon and sound for the diary.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">notificationTime</span>
<span class="types"><span class="type">number</span></span>
Time in seconds the notification icon will show on screen.
</li>
<li><span class="parameter">objectId</span>
<span class="types"><a class="type" href="../4 enums/Objects.ObjID.html#">ObjID</a></span>
Object ID for the notification icon.
</li>
<li><span class="parameter">spriteId</span>
<span class="types"><span class="type">number</span></span>
SpriteID from the specified object for the notification icon.
</li>
<li><span class="parameter">color</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
Color of notification icon.
</li>
<li><span class="parameter">pos</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y position of the notification icon in screen percent (0-100).
</li>
<li><span class="parameter">rot</span>
<span class="types"><span class="type">number</span></span>
rotation of the notification icon (0-360).
</li>
<li><span class="parameter">scale</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y Scaling factor for the notification icon.
</li>
<li><span class="parameter">alignMode</span>
<span class="types"><a class="type" href="../4 enums/View.AlignMode.html#">AlignMode</a></span>
Alignment for the notification icon.
</li>
<li><span class="parameter">scaleMode</span>
<span class="types"><a class="type" href="../4 enums/View.ScaleMode.html#">ScaleMode</a></span>
Scaling for the notification icon.
</li>
<li><span class="parameter">blendMode</span>
<span class="types"><a class="type" href="../4 enums/Effects.BlendID.html#">BlendID</a></span>
Blending modes for the notification icon.
</li>
<li><span class="parameter">notificationSound</span>
<span class="types"><a class="type" href="../1 modules/Sound.html#">Sound</a></span>
Sound to play with notification icon.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:ClearNotification"></a>
<strong>CustomDiary:ClearNotification()</strong>
</dt>
<dd>
Clears settings for the notification system for the specified diary.
</dd>
<dt>
<a name = "CustomDiary:CustomizePageNumbers"></a>
<strong>CustomDiary:CustomizePageNumbers(pageNoType, prefix, separator, textPos, textOptions, textScale, textColor)</strong>
</dt>
<dd>
Customizes the page numbers for the diary.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pageNoType</span>
<span class="types"><span class="type">int</span></span>
Specifies the format for page numbers (1 or 2). 1: Displays only the current page number. 2: Formats the page number as: [Prefix][CurrentPage][Separator][UnlockedPages].
</li>
<li><span class="parameter">prefix</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Prefix to be added for type 2 of page numbers.
</li>
<li><span class="parameter">separator</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Separator to be added for type 2 of page numbers.
</li>
<li><span class="parameter">textPos</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y position of the page numbers.
</li>
<li><span class="parameter">textOptions</span>
<span class="types"><a class="type" href="../4 enums/Strings.DisplayStringOption.html#">DisplayStringOption</a></span>
alignment and effects for the text. Default: None. Please note text is automatically aligned to the LEFT
</li>
<li><span class="parameter">textScale</span>
<span class="types"><span class="type">number</span></span>
Scale factor for the page numbers.
</li>
<li><span class="parameter">textColor</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
Color of the page numbers.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:ClearPageNumbers"></a>
<strong>CustomDiary:ClearPageNumbers()</strong>
</dt>
<dd>
Clears settings for the page numbers for the specified diary.
</dd>
<dt>
<a name = "CustomDiary:CustomizeControls"></a>
<strong>CustomDiary:CustomizeControls(textPos, textOptions, textScale, textColor)</strong>
</dt>
<dd>
Customizes the controls text for the diary.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">textPos</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
X,Y position of the controls text.
</li>
<li><span class="parameter">textOptions</span>
<span class="types"><a class="type" href="../4 enums/Strings.DisplayStringOption.html#">DisplayStringOption</a></span>
alignment and effects for the text. Default: None. Please note text is automatically aligned to the LEFT.
</li>
<li><span class="parameter">textScale</span>
<span class="types"><span class="type">number</span></span>
Scale factor for the controls.
</li>
<li><span class="parameter">textColor</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
Color of the page controls.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:CustomizeControlsText"></a>
<strong>CustomDiary:CustomizeControlsText(string1, string2, string3, string4, separator)</strong>
</dt>
<dd>
Customizes the display text for controls for specified diary.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">string1</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Text for Space key controls text.
</li>
<li><span class="parameter">string2</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Text for Left key controls text.
</li>
<li><span class="parameter">string3</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Text for Right key controls text.
</li>
<li><span class="parameter">string4</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Text for Esc key controls text.
</li>
<li><span class="parameter">separator</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Text for separator between controls text.
</li>
</ul>
</dd>
<dt>
<a name = "CustomDiary:ClearControls"></a>
<strong>CustomDiary:ClearControls()</strong>
</dt>
<dd>
Clears settings for the specified diary's controls text.
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="https://github.com/hispidence/TEN-LDoc">TEN-LDoc</a> (a fork of <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a>)</i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>