Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text in Rooms documentation #127

Merged
merged 16 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
567c971
docs(feature): text in rooms IDE side
gurpreetsinghmatharoo May 18, 2024
00f7463
docs(feature): created placeholder pages for main text element functions
gurpreetsinghmatharoo May 18, 2024
6d2aa18
docs(feature): Created placeholder pages for text element setters
gurpreetsinghmatharoo May 18, 2024
90eac7b
docs(feature): Created placeholder pages for text element getter func…
gurpreetsinghmatharoo May 18, 2024
40eee37
docs(feature): Added Text Element functions to ToC
gurpreetsinghmatharoo May 20, 2024
1dfb6cf
docs(feature): Text in rooms image
gurpreetsinghmatharoo May 20, 2024
cf9cbc1
docs(feature): Finished documenting main Text Element functions (crea…
gurpreetsinghmatharoo May 20, 2024
3045db9
docs(feature): Finish basic documentation for text element setter fun…
gurpreetsinghmatharoo May 21, 2024
3c232a1
docs(feature): Finish basic documentation for text element getter fun…
gurpreetsinghmatharoo May 21, 2024
c0c8c15
docs(feature): Replaced sequence seqtextkey_ constants with new texta…
gurpreetsinghmatharoo May 22, 2024
5b213e2
docs(feature): finish examples for all text element functions
gurpreetsinghmatharoo May 23, 2024
bea5aae
docs(feature): minor fixes for Text Element pages
gurpreetsinghmatharoo May 23, 2024
943ef50
docs(feature): Mention text under Layer Toolbox
gurpreetsinghmatharoo May 23, 2024
fef392e
docs(feature): Improve text in sequences note
gurpreetsinghmatharoo May 23, 2024
db41c4c
Merge branch 'develop.gurpreet' into develop.gurpreet.text-in-rooms
gurpreetsinghmatharoo May 23, 2024
11a3bf3
docs(feature): Text in Rooms fixes after review
gurpreetsinghmatharoo May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Manual/_page_generation/Template_Code_Page.htm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1><span data-field="title" data-format="default">INSERT_TITLE</span></h1>
<p>Additional Information Goes Here.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">keyword_name(arguments);</p>
<p class="code"><span data-field="title" data-format="default"></span>(arguments);</p>
<table>
<colgroup>
<col />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ <h3 id="room_layers_elements">Layers and Elements</h3>
<li><a data-xref="{title}" href="Background_Layers/Background_Layers.htm">Background Elements</a></li>
<li><a data-xref="{title}" href="Sprite_Layers/Sprite_Layers.htm">Sprite Elements</a></li>
<li><a data-xref="{title}" href="Sequence_Layers/Sequence_Layers.htm">Sequence Elements</a></li>
<li><a data-xref="{title}" href="Text_Functions/Text_Elements.htm">Text Elements</a></li>
<li>Particle System Elements: <a data-xref="{title}" href="../../Drawing/Particles/Particle_Systems/part_system_create_layer.htm">part_system_create_layer</a></li>
</ul>
<h3>Filters and Effects</h3>
Expand All @@ -91,7 +92,7 @@ <h3>Filters and Effects</h3>
<div style="float:right">Next: <a data-xref="{title}" href="../Extensions/Extensions.htm">Extensions</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
Rooms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">Sequence Layers</span></h1>
<h1><span data-field="title" data-format="default">Sequence Elements</span></h1>
<p>In this section we have the functions that are used for adding, removing and editing how <a href="../../../../../The_Asset_Editors/Sequences.htm">Sequences</a> behave in a game room in relation to the <i>layer</i> they are on. It should be noted that sequences are similar to objects, in that when one is created on a layer in a room, it is considered an <i>instance</i> of the main sequence <i>object</i> from the <a href="../../../../../Introduction/The_Asset_Browser.htm">Asset Browser</a>. So, when you add a sequence to a layer in a room, you are creating an <i>instance</i> of the base sequence object, and this sequence instance is added as an <i>element</i> within a room layer. The sequence instance is what controls things like playback speed and direction, and will itself contain another sequence data <i>struct</i> which is what contains the actual sequence track data. This is important, as the functions listed below will reference the sequence <strong>element ID</strong> (the ID of the sequence <i>on the layer</i>) as well as the sequence <strong>instance ID</strong> (the actual ID of the sequence that is being referenced by the element) and the sequence data <a href="../../../../GML_Overview/Structs.htm">struct</a> (which contains all the sequence data).</p>
<p>Below is a list of all the functions that can be used for creating new sequence instances or editing existing ones:</p>
<ul class="colour">
Expand Down Expand Up @@ -57,10 +57,10 @@ <h1><span data-field="title" data-format="default">Sequence Layers</span></h1>
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="../Rooms.htm">Rooms</a></div>
<div style="float:right">Next: <a href="../Filter_Effect_Layers/Filter_Effect_Functions.htm">Filter and Effect Functions</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="../Text_Functions/Text_Elements.htm">Text Elements</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
Sequence Layers
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Text Elements</title>
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Gurpreet S. Matharoo" />
<meta name="topic-comment" content="Page outlining the different functions and variables associated with Text Elements in layers" />
<meta name="rh-index-keywords" content="" />
<meta name="search-keywords" content="Sprite Layers" />
</head>
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">Text Elements</span></h1>
<p>The functions listed here allow you to create and modify Text Elements in room layers.</p>
<p><img class="center" src="../../../../../assets/Images/Asset_Editors/Room_Text/Room_text_element.png" />You can place text in <a data-xref="{title}" href="../../../../../The_Asset_Editors/Rooms.htm">The Room Editor</a> by creating an <a href="../../../../../The_Asset_Editors/Room_Properties/Layer_Properties.htm">Asset Layer</a>, and then dragging in a font asset or using the <img class="icon" src="../../../../../assets/Images/Icons/Icon_TextButton.png" /> tool from the Layer Toolbox. The default text that appears on a new text element can be changed from the <a data-xref="{title}" href="../../../../../Setting_Up_And_Version_Information/IDE_Preferences/Room_Editor_Preferences.htm">Room Editor Preferences</a>.</p>
<h3>Text Element Functions</h3>
<p>These functions let you create/destroy text elements, check if one exists, and get the ID of an element for use in functions.</p>
<ul class="colour">
<li><a data-xref="{title}" href="layer_text_create.htm">layer_text_create</a></li>
<li><a data-xref="{title}" href="layer_text_destroy.htm">layer_text_destroy</a></li>
<li><a data-xref="{title}" href="layer_text_exists.htm">layer_text_exists</a></li>
<li><a data-xref="{title}" href="layer_text_get_id.htm">layer_text_get_id</a></li>
</ul>
<h3>Text Element Property Setters</h3>
<p>These functions let you modify any property of a text element, by providing its <a href="layer_text_get_id.htm">ID</a>.</p>
<ul class="colour">
<li><a data-xref="{title}" href="layer_text_text.htm">layer_text_text</a></li>
<li><a data-xref="{title}" href="layer_text_font.htm">layer_text_font</a></li>
<li><a data-xref="{title}" href="layer_text_x.htm">layer_text_x</a></li>
<li><a data-xref="{title}" href="layer_text_y.htm">layer_text_y</a></li>
<li><a data-xref="{title}" href="layer_text_angle.htm">layer_text_angle</a></li>
<li><a data-xref="{title}" href="layer_text_xscale.htm">layer_text_xscale</a></li>
<li><a data-xref="{title}" href="layer_text_yscale.htm">layer_text_yscale</a></li>
<li><a data-xref="{title}" href="layer_text_blend.htm">layer_text_blend</a></li>
<li><a data-xref="{title}" href="layer_text_alpha.htm">layer_text_alpha</a></li>
<li><a data-xref="{title}" href="layer_text_xorigin.htm">layer_text_xorigin</a></li>
<li><a data-xref="{title}" href="layer_text_yorigin.htm">layer_text_yorigin</a></li>
<li><a data-xref="{title}" href="layer_text_halign.htm">layer_text_halign</a></li>
<li><a data-xref="{title}" href="layer_text_valign.htm">layer_text_valign</a></li>
<li><a data-xref="{title}" href="layer_text_charspacing.htm">layer_text_charspacing</a></li>
<li><a data-xref="{title}" href="layer_text_linespacing.htm">layer_text_linespacing</a></li>
<li><a data-xref="{title}" href="layer_text_framew.htm">layer_text_framew</a></li>
<li><a data-xref="{title}" href="layer_text_frameh.htm">layer_text_frameh</a></li>
<li><a data-xref="{title}" href="layer_text_wrap.htm">layer_text_wrap</a></li>
</ul>
<h3>Text Element Property Getters</h3>
<p>These functions let you read any property from a text element, by providing its <a href="layer_text_get_id.htm">ID</a>.</p>
<ul class="colour">
<li><a data-xref="{title}" href="layer_text_get_text.htm">layer_text_get_text</a></li>
<li><a data-xref="{title}" href="layer_text_get_font.htm">layer_text_get_font</a></li>
<li><a data-xref="{title}" href="layer_text_get_x.htm">layer_text_get_x</a></li>
<li><a data-xref="{title}" href="layer_text_get_y.htm">layer_text_get_y</a></li>
<li><a data-xref="{title}" href="layer_text_get_angle.htm">layer_text_get_angle</a></li>
<li><a data-xref="{title}" href="layer_text_get_xscale.htm">layer_text_get_xscale</a></li>
<li><a data-xref="{title}" href="layer_text_get_yscale.htm">layer_text_get_yscale</a></li>
<li><a data-xref="{title}" href="layer_text_get_blend.htm">layer_text_get_blend</a></li>
<li><a data-xref="{title}" href="layer_text_get_alpha.htm">layer_text_get_alpha</a></li>
<li><a data-xref="{title}" href="layer_text_get_xorigin.htm">layer_text_get_xorigin</a></li>
<li><a data-xref="{title}" href="layer_text_get_yorigin.htm">layer_text_get_yorigin</a></li>
<li><a data-xref="{title}" href="layer_text_get_halign.htm">layer_text_get_halign</a></li>
<li><a data-xref="{title}" href="layer_text_get_valign.htm">layer_text_get_valign</a></li>
<li><a data-xref="{title}" href="layer_text_get_charspacing.htm">layer_text_get_charspacing</a></li>
<li><a data-xref="{title}" href="layer_text_get_linespacing.htm">layer_text_get_linespacing</a></li>
<li><a data-xref="{title}" href="layer_text_get_framew.htm">layer_text_get_framew</a></li>
<li><a data-xref="{title}" href="layer_text_get_frameh.htm">layer_text_get_frameh</a></li>
<li><a data-xref="{title}" href="layer_text_get_wrap.htm">layer_text_get_wrap</a></li>
</ul>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="../Rooms.htm">Rooms</a></div>
<div style="float:right">Next: <a data-xref="{title}" href="../Filter_Effect_Layers/Filter_Effect_Functions.htm">Filter and Effect Functions</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
Text Layers
Text Elements
Text in Rooms
-->
<!-- TAGS
text_layer_functions
-->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_text_alpha</title>
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" type="text/css" href="../../../../../assets/css/default.css" />
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="" />
<meta name="topic-comment" content="" />
<meta name="rh-index-keywords" content="layer_text_alpha" />
<meta name="search-keywords" content="layer_text_alpha" />
<meta name="template" content="assets/masterpages/Manual_Keyword_Page.htt" />
</head>
<body>
<h1><span data-field="title" data-format="default">layer_text_alpha</span></h1>
<p>This function changes the alpha (opacity) of the given Text Element. This is a value between 0 (invisible) and 1 (fully visible).</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">layer_text_alpha</span>(text_element_id, alpha);</p>
<table>
<colgroup>
<col />
<col />
<col />
</colgroup>
<tbody>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>text_element_id</td>
<td><span data-keyref="Type_ID_Element_Text"><a href="layer_text_get_id.htm" target="_blank">Text Element ID</a></span></td>
<td>The text element ID, retrieved from <span class="inline3_func"><a data-xref="{title}" href="layer_text_create.htm">layer_text_create</a></span> or <span class="inline3_func"><a data-xref="{title}" href="layer_text_get_id.htm">layer_text_get_id</a></span>.</td>
</tr>
<tr>
<td>alpha</td>
<td><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td>The new alpha of the element</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">var _text1_id = layer_text_get_id(&quot;Assets&quot;, &quot;text1&quot;);<br />
<br />
var _text1_alpha = layer_text_get_alpha(_text1_id);<br />
<br />
var _target_alpha = keyboard_check(vk_space) ? 1 : 0;<br />
<br />
var _new_alpha = lerp(_text1_alpha, _target_alpha, 0.1);<br />
<br />
layer_text_alpha(_text1_id, _new_alpha);
</p>
<p>This gets the ID of the Text Element <span class="inline2">text1</span> from the layer <span class="inline2">Assets</span>, and gets its alpha. It sets the target alpha based on input, being <span class="inline2">1</span> (visible) when space is held, and <span class="inline2">0</span> (invisible) otherwise.</p>
<p>It calculates a value between the current and the target alpha, moving the current alpha 10% (<span class="inline2">0.1</span>) towards the target.</p>
<p>Finally it applies the new alpha to the element. Each frame it moves closer to the target alpha.</p>
<p>Since this code is for a Step event, you should initialise the <span class="inline2">_text1_id</span> variable in the Create event.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div>Back: <a data-xref="{title}" href="Text_Elements.htm">Text Elements</a></div>
<div>Next: <a data-xref="{title}" href="layer_text_xorigin.htm">layer_text_xorigin</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
layer_text_alpha
-->
<!-- TAGS
layer_text_alpha
-->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_text_angle</title>
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" type="text/css" href="../../../../../assets/css/default.css" />
<script src="../../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="" />
<meta name="topic-comment" content="" />
<meta name="rh-index-keywords" content="layer_text_angle" />
<meta name="search-keywords" content="layer_text_angle" />
<meta name="template" content="assets/masterpages/Manual_Keyword_Page.htt" />
</head>
<body>
<h1><span data-field="title" data-format="default">layer_text_angle</span></h1>
<p>This function changes the angle (rotation) of the given Text Element.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">layer_text_angle</span>(text_element_id, angle);</p>
<table>
<colgroup>
<col />
<col />
<col />
</colgroup>
<tbody>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>text_element_id</td>
<td><span data-keyref="Type_ID_Element_Text"><a href="layer_text_get_id.htm" target="_blank">Text Element ID</a></span></td>
<td>The text element ID, retrieved from <span class="inline3_func"><a data-xref="{title}" href="layer_text_create.htm">layer_text_create</a></span> or <span class="inline3_func"><a data-xref="{title}" href="layer_text_get_id.htm">layer_text_get_id</a></span>.</td>
</tr>
<tr>
<td>angle</td>
<td><span data-keyref="Type_Real"><a href="../../../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td>The new angle of the Text Element</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Void">N/A</span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">var _text1_id = layer_text_get_id(&quot;Assets&quot;, &quot;text1&quot;);<br />
<br />
var _text1_angle = layer_text_get_angle(_text1_id);<br />
<br />
layer_text_angle(_text1_id, _text1_angle + 5);
</p>
<p>This gets the ID of the Text Element <span class="inline2">text1</span> from the layer <span class="inline2">Assets</span>, and then gets its angle. It applies the angle back with 5 added to it, so the element rotates 5 degrees every frame.</p>
<p>Since this code is for a Step event, you should initialise the <span class="inline2">_text1_id</span> variable in the Create event.</p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div>Back: <a data-xref="{title}" href="Text_Elements.htm">Text Elements</a></div>
<div>Next: <a data-xref="{title}" href="layer_text_xscale.htm">layer_text_xscale</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
layer_text_angle
-->
<!-- TAGS
layer_text_angle
-->
</body>
</html>
Loading
Loading