diff --git a/Manual/_page_generation/Template_Code_Page.htm b/Manual/_page_generation/Template_Code_Page.htm index d7ab33939..4873d181b 100644 --- a/Manual/_page_generation/Template_Code_Page.htm +++ b/Manual/_page_generation/Template_Code_Page.htm @@ -19,7 +19,7 @@

INSERT_TITLE

Additional Information Goes Here.

 

Syntax:

-

keyword_name(arguments);

+

(arguments);

diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Rooms.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Rooms.htm index 253f63043..144c82410 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Rooms.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Rooms.htm @@ -75,6 +75,7 @@

Layers and Elements

  • Background Elements
  • Sprite Elements
  • Sequence Elements
  • +
  • Text Elements
  • Particle System Elements: part_system_create_layer
  • Filters and Effects

    @@ -91,7 +92,7 @@

    Filters and Effects

    Next: Extensions
    -
    © Copyright YoYo Games Ltd. 2023 All Rights Reserved
    +
    © Copyright YoYo Games Ltd. 2024 All Rights Reserved
    -

    Sequence Layers

    +

    Sequence Elements

    In this section we have the functions that are used for adding, removing and editing how Sequences behave in a game room in relation to the layer 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 instance of the main sequence object from the Asset Browser. So, when you add a sequence to a layer in a room, you are creating an instance of the base sequence object, and this sequence instance is added as an element within a room layer. The sequence instance is what controls things like playback speed and direction, and will itself contain another sequence data struct which is what contains the actual sequence track data. This is important, as the functions listed below will reference the sequence element ID (the ID of the sequence on the layer) as well as the sequence instance ID (the actual ID of the sequence that is being referenced by the element) and the sequence data struct (which contains all the sequence data).

    Below is a list of all the functions that can be used for creating new sequence instances or editing existing ones:

    + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    alphaRealThe new alpha of the element
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_alpha = layer_text_get_alpha(_text1_id);
    +
    + var _target_alpha = keyboard_check(vk_space) ? 1 : 0;
    +
    + var _new_alpha = lerp(_text1_alpha, _target_alpha, 0.1);
    +
    + layer_text_alpha(_text1_id, _new_alpha); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and gets its alpha. It sets the target alpha based on input, being 1 (visible) when space is held, and 0 (invisible) otherwise.

    +

    It calculates a value between the current and the target alpha, moving the current alpha 10% (0.1) towards the target.

    +

    Finally it applies the new alpha to the element. Each frame it moves closer to the target alpha.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_angle.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_angle.htm new file mode 100644 index 000000000..33c64b5d7 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_angle.htm @@ -0,0 +1,77 @@ + + + + + + layer_text_angle + + + + + + + + + + +

    layer_text_angle

    +

    This function changes the angle (rotation) of the given Text Element.

    +

     

    +

    Syntax:

    +

    layer_text_angle(text_element_id, angle);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    angleRealThe new angle of the Text Element
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_angle = layer_text_get_angle(_text1_id);
    +
    + layer_text_angle(_text1_id, _text1_angle + 5); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then gets its angle. It applies the angle back with 5 added to it, so the element rotates 5 degrees every frame.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_blend.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_blend.htm new file mode 100644 index 000000000..55e8bf437 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_blend.htm @@ -0,0 +1,83 @@ + + + + + + layer_text_blend + + + + + + + + + + +

    layer_text_blend

    +

    This function changes the blend colour of the given Text Element, similar to image_blend for an Object Instance.

    +

     

    +

    Syntax:

    +

    layer_text_blend(text_element_id, colour);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    colourColourThe new blend colour of the element
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_blend = layer_text_get_blend(_text1_id);
    +
    + var _target_colour = keyboard_check(vk_space) ? c_red : c_white;
    +
    + var _new_colour = merge_colour(_text1_blend, _target_colour, 0.1);
    +
    + layer_text_blend(_text1_id, _new_colour); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and gets its blend colour. It sets the target colour based on input, being red when space is held, and white otherwise.

    +

    It calculates a colour between the current and the target colour, moving the current colour 10% (0.1) towards the target.

    +

    Finally it applies the new colour to the element. Each frame it moves closer to the target colour.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_charspacing.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_charspacing.htm new file mode 100644 index 000000000..23ec8a6bf --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_charspacing.htm @@ -0,0 +1,76 @@ + + + + + + layer_text_charspacing + + + + + + + + + + +

    layer_text_charspacing

    +

    This function changes the character spacing of the given Text Element. This is the space (in pixels) added between each character in the displayed string.

    +

     

    +

    Syntax:

    +

    layer_text_charspacing(text_element_id, charspacing);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    charspacingRealThe new character spacing for the element.
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_charsp = layer_text_get_charspacing(_text1_id);
    +
    + layer_text_charspacing(_text1_id, _text1_charsp + 2); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, gets its character spacing value and applies it back, increased by 2.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_create.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_create.htm new file mode 100644 index 000000000..8681c4718 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_create.htm @@ -0,0 +1,87 @@ + + + + + + layer_text_create + + + + + + + + + + +

    layer_text_create

    +

    This function creates a new Text Element in a room layer, and returns its element ID.

    +

    The function will return -1 if the given layer does not exist.

    +

     

    +

    Syntax:

    +

    layer_text_create(layer_name_or_id, x, y, font, text);

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    layer_name_or_idString or LayerThe layer where you want to create the element. 
    xRealThe X position in the room where the text element should be created. Note that the actual X position where the text appears will be negatively offset by its xorigin value.
    yRealThe Y position in the room where the text element should be created. Note that the actual Y position where the text appears will be negatively offset by its yorigin value.
    fontFont AssetThe font asset to use for rendering the text.
    textStringThe actual text string that appears on this element.
    +

     

    +

    Returns:

    +

    Text Element ID

    +

     

    +

    Example:

    +

    text = layer_text_create("Assets", x, y, Font1, "Place the key here.");

    +

    This creates a new Text Element in the Assets layer, at the instance's position, using the Font1 font asset.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_destroy.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_destroy.htm new file mode 100644 index 000000000..69cc5979c --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_destroy.htm @@ -0,0 +1,72 @@ + + + + + + layer_text_destroy + + + + + + + + + + +

    layer_text_destroy

    +

    This function destroys the given Text Element.

    +

     

    +

    Syntax:

    +

    layer_text_destroy(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + if (layer_text_exists("Assets", _text1_id))
    + {
    +     layer_text_destroy(_text1_id);
    + } +

    +

    This gets the ID of the Text Element text1 from the Assets layer. It then checks whether that element exists, and if it does, it destroys it.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_exists.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_exists.htm new file mode 100644 index 000000000..39e019061 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_exists.htm @@ -0,0 +1,77 @@ + + + + + + layer_text_exists + + + + + + + + + + +

    layer_text_exists

    +

    This function checks whether the given Text Element exists on the given layer, and returns true or false.

    +

     

    +

    Syntax:

    +

    layer_text_exists(layer_name_or_id, text_element_id);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    layer_name_or_idString or LayerThe layer to check. 
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Boolean

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + if (layer_text_exists("Assets", _text1_id))
    + {
    +     layer_text_destroy(_text1_id);
    + } +

    +

    This gets the ID of the Text Element text1 from the Assets layer. It then checks whether that element exists, and if it does, it destroys it.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_font.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_font.htm new file mode 100644 index 000000000..3a6e088c1 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_font.htm @@ -0,0 +1,79 @@ + + + + + + layer_text_font + + + + + + + + + + +

    layer_text_font

    +

    This function changes the font used by the given Text Element.

    +

     

    +

    Syntax:

    +

    layer_text_font(text_element_id, font);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    fontFont AssetThe Font to use to render the element's text.
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_font = layer_text_get_font(_text1_id);
    +
    + if (!font_exists(_text1_font))
    + {
    +     layer_text_font(_text1_id, Font2);
    + } +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then gets its font. If the font does not exist, it applies the font Font2 to the element.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_frameh.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_frameh.htm new file mode 100644 index 000000000..14f9d618d --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_frameh.htm @@ -0,0 +1,75 @@ + + + + + + layer_text_frameh + + + + + + + + + + +

    layer_text_frameh

    +

    This function changes the frame height of the given Text Element.

    +

     

    +

    Syntax:

    +

    layer_text_frameh(text_element_id, height);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    heightRealThe new frame height of the element.
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + layer_text_framew(_text1_id, room_width * 0.5);
    + layer_text_frameh(_text1_id, 64); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, then sets its frame width to half the room's size, and the frame height to 64.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_framew.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_framew.htm new file mode 100644 index 000000000..44d463ab1 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_framew.htm @@ -0,0 +1,75 @@ + + + + + + layer_text_framew + + + + + + + + + + +

    layer_text_framew

    +

    This function changes the frame width of the given Text Element. This affects wrapping and the justified alignment.

    +

     

    +

    Syntax:

    +

    layer_text_framew(text_element_id, width);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    widthRealThe new frame width of the element.
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + layer_text_framew(_text1_id, room_width * 0.5);
    + layer_text_frameh(_text1_id, 64); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, then sets its frame width to half the room's size, and the frame height to 64.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_alpha.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_alpha.htm new file mode 100644 index 000000000..1a49b46be --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_alpha.htm @@ -0,0 +1,78 @@ + + + + + + layer_text_get_alpha + + + + + + + + + + +

    layer_text_get_alpha

    +

    This function returns the alpha (opacity) of the given Text Element. This can be changed with layer_text_alpha.

    +

     

    +

    Syntax:

    +

    layer_text_get_alpha(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_alpha = layer_text_get_alpha(_text1_id);
    +
    + var _target_alpha = keyboard_check(vk_space) ? 1 : 0;
    +
    + var _new_alpha = lerp(_text1_alpha, _target_alpha, 0.1);
    +
    + layer_text_alpha(_text1_id, _new_alpha); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and gets its alpha. It sets the target alpha based on input, being 1 (visible) when space is held, and 0 (invisible) otherwise.

    +

    It calculates a value between the current and the target alpha, moving the current alpha 10% (0.1) towards the target.

    +

    Finally it applies the new alpha to the element. Each frame it moves closer to the target alpha.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_angle.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_angle.htm new file mode 100644 index 000000000..215cc6ac1 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_angle.htm @@ -0,0 +1,72 @@ + + + + + + layer_text_get_angle + + + + + + + + + + +

    layer_text_get_angle

    +

    This function returns the angle (rotation value) of the given Text Element. This can be changed with layer_text_angle.

    +

     

    +

    Syntax:

    +

    layer_text_get_angle(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_angle = layer_text_get_angle(_text1_id);
    +
    + layer_text_angle(_text1_id, _text1_angle + 5); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then gets its angle. It applies the angle back with 5 added to it, so the element rotates 5 degrees every frame.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_blend.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_blend.htm new file mode 100644 index 000000000..dd504f85e --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_blend.htm @@ -0,0 +1,78 @@ + + + + + + layer_text_get_blend + + + + + + + + + + +

    layer_text_get_blend

    +

    This function returns the blend colour of the given Text Element. This can be changed with layer_text_blend.

    +

     

    +

    Syntax:

    +

    layer_text_get_blend(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_blend = layer_text_get_blend(_text1_id);
    +
    + var _target_colour = keyboard_check(vk_space) ? c_red : c_white;
    +
    + var _new_colour = merge_colour(_text1_blend, _target_colour, 0.1);
    +
    + layer_text_blend(_text1_id, _new_colour); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and gets its blend colour. It sets the target colour based on input, being red when space is held, and white otherwise.

    +

    It calculates a colour between the current and the target colour, moving the current colour 10% (0.1) towards the target.

    +

    Finally it applies the new colour to the element. Each frame it moves closer to the target colour.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_charspacing.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_charspacing.htm new file mode 100644 index 000000000..be738cf9b --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_charspacing.htm @@ -0,0 +1,71 @@ + + + + + + layer_text_get_charspacing + + + + + + + + + + +

    layer_text_get_charspacing

    +

    This function returns the character spacing (in pixels) of the given Text Element. This can be changed with layer_text_charspacing.

    +

     

    +

    Syntax:

    +

    layer_text_get_charspacing(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_charsp = layer_text_get_charspacing(_text1_id);
    +
    + layer_text_charspacing(_text1_id, _text1_charsp + 2); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, gets its character spacing value and applies it back, increased by 2.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_font.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_font.htm new file mode 100644 index 000000000..8f496de69 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_font.htm @@ -0,0 +1,74 @@ + + + + + + layer_text_get_font + + + + + + + + + + +

    layer_text_get_font

    +

    This function returns the Font Asset used by the given Text Element. This can be changed with layer_text_font.

    +

     

    +

    Syntax:

    +

    layer_text_get_font(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Font Asset

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_font = layer_text_get_font(_text1_id);
    +
    + if (!font_exists(_text1_font))
    + {
    +     layer_text_font(_text1_id, Font2);
    + } +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then gets its font. If the font does not exist, it applies the font Font2 to the element.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_frameh.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_frameh.htm new file mode 100644 index 000000000..660aebfd2 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_frameh.htm @@ -0,0 +1,77 @@ + + + + + + layer_text_get_frameh + + + + + + + + + + +

    layer_text_get_frameh

    +

    This function returns the frame height of the given Text Element. This can be changed with layer_text_frameh.

    +

     

    +

    Syntax:

    +

    layer_text_get_frameh(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_x = layer_text_get_x(_text1_id) - layer_text_get_xorigin(_text1_id);
    + var _text1_y = layer_text_get_y(_text1_id) - layer_text_get_yorigin(_text1_id);
    + var _text1_framew = layer_text_get_framew(_text1_id);
    + var _text1_frameh = layer_text_get_frameh(_text1_id);
    +
    + draw_set_color(c_blue);
    + draw_roundrect(_text1_x, _text1_y, _text1_x + _text1_framew, _text1_y + _text1_frameh, 0);
    + draw_set_color(c_white); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, then gets its text position (by subtracting the element's origin from its X/Y position) and its frame width and height.

    +

    Then it draws a blue round rectangle that covers the entire frame. To ensure this appears behind the text, the Object Instance needs to be in a layer with a depth higher than the Asset Layer where the Text Element is placed.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_framew.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_framew.htm new file mode 100644 index 000000000..583847e79 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_framew.htm @@ -0,0 +1,77 @@ + + + + + + layer_text_get_framew + + + + + + + + + + +

    layer_text_get_framew

    +

    This function returns the frame width of the given Text Element. This can be changed with layer_text_framew.

    +

     

    +

    Syntax:

    +

    layer_text_get_framew(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_x = layer_text_get_x(_text1_id) - layer_text_get_xorigin(_text1_id);
    + var _text1_y = layer_text_get_y(_text1_id) - layer_text_get_yorigin(_text1_id);
    + var _text1_framew = layer_text_get_framew(_text1_id);
    + var _text1_frameh = layer_text_get_frameh(_text1_id);
    +
    + draw_set_color(c_blue);
    + draw_roundrect(_text1_x, _text1_y, _text1_x + _text1_framew, _text1_y + _text1_frameh, 0);
    + draw_set_color(c_white); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, then gets its text position (by subtracting the element's origin from its X/Y position) and its frame width and height.

    +

    Then it draws a blue round rectangle that covers the entire frame. To ensure this appears behind the text, the Object Instance needs to be in a layer with a depth higher than the Asset Layer where the Text Element is placed.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_halign.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_halign.htm new file mode 100644 index 000000000..65aaac477 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_halign.htm @@ -0,0 +1,75 @@ + + + + + + layer_text_get_halign + + + + + + + + + + +

    layer_text_get_halign

    +

    This function returns the horizontal alignment mode of the given Text Element. This can be changed with layer_text_halign.

    +

    This will return one of the following constants:

    +
    +

     

    +

    Syntax:

    +

    layer_text_get_halign(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Text Horizontal Alignment Constant

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + text1_old_halign = layer_text_get_halign(_text1_id);
    + text1_old_valign = layer_text_get_valign(_text1_id);
    +
    + layer_text_halign(_text1_id, textalign_center);
    + layer_text_valign(_text1_id, textalign_bottom); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and stores its horizontal and vertical alignments into variables, before changing the alignments. These variables can later be used to reset the alignment values to what they were before they were changed here.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_id.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_id.htm new file mode 100644 index 000000000..ad1a6ec5b --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_id.htm @@ -0,0 +1,78 @@ + + + + + + layer_text_get_id + + + + + + + + + + +

    layer_text_get_id

    +

    This function returns the ID of a Text Element which was placed in the Room Editor. This ID can be used in the Text Element Functions.

    +

    You must provide a layer to check in, and the name of the text element as set in the Room Editor, as a string:

    +

    +

    Syntax:

    +

    layer_text_get_id(layer_name_or_id, text_element_name);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    layer_name_or_idString or LayerThe layer to check. 
    text_element_nameStringThe name of the Text Element as a string, see image above.
    +

     

    +

    Returns:

    +

    Text Element ID

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + if (layer_text_exists("Assets", _text1_id))
    + {
    +     layer_text_destroy(_text1_id);
    + } +

    +

    This gets the ID of the Text Element text1 from the Assets layer. It then checks whether that element exists, and if it does, it destroys it.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_linespacing.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_linespacing.htm new file mode 100644 index 000000000..ad253a19a --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_linespacing.htm @@ -0,0 +1,71 @@ + + + + + + layer_text_get_linespacing + + + + + + + + + + +

    layer_text_get_linespacing

    +

    This function returns the line spacing (in pixels) of the given Text Element. This can be changed with layer_text_linespacing.

    +

     

    +

    Syntax:

    +

    layer_text_get_linespacing(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_linesp = layer_text_get_linespacing(_text1_id);
    +
    + layer_text_linespacing(_text1_id, _text1_linesp + 4); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, gets its line spacing value and applies it back, increased by 4.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_text.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_text.htm new file mode 100644 index 000000000..964508d32 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_text.htm @@ -0,0 +1,73 @@ + + + + + + layer_text_get_text + + + + + + + + + + +

    layer_text_get_text

    +

    This function returns the text string of the given Text Element. This can be changed with layer_text_text.

    +

     

    +

    Syntax:

    +

    layer_text_get_text(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    String

    +

     

    +

    Example:

    +

    var _number = 5;
    +
    + var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_text = layer_text_get_text(_text1_id);
    +
    + layer_text_text(_text1_id, $"{_text1_text} ({_number})"); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and retrieves its text string. It then reapplies the text string back to the element, but with a number value added to it, inside parentheses. For example, if the text was "Waiting for players" it will become "Waiting for players (5)".

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_valign.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_valign.htm new file mode 100644 index 000000000..9f8fa025f --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_valign.htm @@ -0,0 +1,75 @@ + + + + + + layer_text_get_valign + + + + + + + + + + +

    layer_text_get_valign

    +

    This function returns the vertical alignment mode of the given Text Element. This can be changed with layer_text_valign.

    +

    This will return one of the following constants:

    +
    +

     

    +

    Syntax:

    +

    layer_text_get_valign(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Text Vertical Alignment Constant

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + text1_old_halign = layer_text_get_halign(_text1_id);
    + text1_old_valign = layer_text_get_valign(_text1_id);
    +
    + layer_text_halign(_text1_id, textalign_center);
    + layer_text_valign(_text1_id, textalign_bottom); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and stores its horizontal and vertical alignments into variables, before changing the alignments. These variables can later be used to reset the alignment values to what they were before they were changed here.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_wrap.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_wrap.htm new file mode 100644 index 000000000..06dd60132 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_wrap.htm @@ -0,0 +1,71 @@ + + + + + + layer_text_get_wrap + + + + + + + + + + +

    layer_text_get_wrap

    +

    This function returns whether wrapping is enabled (true) or disabled (false) in the given Text Element. This can be changed with layer_text_wrap.

    +

     

    +

    Syntax:

    +

    layer_text_get_wrap(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Boolean

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_wrap = layer_text_get_wrap(_text1_id);
    +
    + layer_text_wrap(_text1_id, !_text1_wrap); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and gets the wrapping boolean value. It then reapplies the boolean value after flipping it, so if wrapping is disabled, it will be enabled, and vice versa.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_x.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_x.htm new file mode 100644 index 000000000..15d2aea98 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_x.htm @@ -0,0 +1,84 @@ + + + + + + layer_text_get_x + + + + + + + + + + +

    layer_text_get_x

    +

    This function returns the X position of the given Text Element. This can be changed with layer_text_x.

    +

     

    +

    Syntax:

    +

    layer_text_get_x(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_pos =
    + {
    +     x : layer_text_get_x(_text1_id),
    +     y : layer_text_get_y(_text1_id)
    + }
    +
    + if (_text1_pos.y > room_height) _text1_pos.y = 0;
    + if (_text1_pos.y < 0) _text1_pos.y = room_height;
    + if (_text1_pos.x > room_width) _text1_pos.x = 0;
    + if (_text1_pos.x < 0) _text1_pos.x = room_width;
    +
    + layer_text_x(_text1_id, _text1_pos.x + 4);
    + layer_text_y(_text1_id, _text1_pos.y + 4); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then gets its X and Y positions, storing them into a struct.

    +

    It then performs a check on those coordinates, and if they reach one end of the room, they are set to the other end (e.g. going through the right boundary puts you at the left boundary, and so on).

    +

    Finally, it applies the positions back to the element, with 4 added to each component so it shifts its position every frame, moving down and right by 4 pixels each.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_xorigin.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_xorigin.htm new file mode 100644 index 000000000..779e508b0 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_xorigin.htm @@ -0,0 +1,73 @@ + + + + + + layer_text_get_xorigin + + + + + + + + + + +

    layer_text_get_xorigin

    +

    This function returns the X origin of the given Text Element. This can be changed with layer_text_xorigin.

    +

     

    +

    Syntax:

    +

    layer_text_get_xorigin(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_finalx = layer_text_get_x(_text1_id) - layer_text_get_xorigin(_text1_id);
    + var _text1_finaly = layer_text_get_y(_text1_id) - layer_text_get_yorigin(_text1_id);
    +
    + draw_sprite(spr_arrow, 0, _text1_finalx, _text1_finaly); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then calculates the final position of the text by reading the X/Y coordinates of the element and subtracting the origin from them.

    +

    It then draws an arrow at that position. That means this code would need to run in a Draw event for it to work. Keep in mind that you would ideally want to initialise the text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_xscale.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_xscale.htm new file mode 100644 index 000000000..e3092dcf8 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_xscale.htm @@ -0,0 +1,77 @@ + + + + + + layer_text_get_xscale + + + + + + + + + + +

    layer_text_get_xscale

    +

    This function returns the X scale of the given Text Element. This can be changed with layer_text_xscale.

    +

     

    +

    Syntax:

    +

    layer_text_get_xscale(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _zoom = (mouse_wheel_up() - mouse_wheel_down()) * 0.1;
    +
    + var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_xscale = layer_text_get_xscale(_text1_id);
    + var _text1_yscale = layer_text_get_yscale(_text1_id);
    +
    + layer_text_xscale(_text1_id, _text1_xscale + _zoom);
    + layer_text_yscale(_text1_id, _text1_yscale + _zoom); +

    +

    This scales the Text Element based on input from the mouse wheel. It first gets the wheel's delta input, by subtracting an up scroll from a down scroll (returning 1 for up and -1 for down). It multiplies that by 0.1 to slow down the scale change that takes place in one frame.

    +

    Then it gets the ID of the Text Element text1 from the layer Assets, and gets its xscale and yscale. It applies each component back, with the zoom value added to it.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_y.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_y.htm new file mode 100644 index 000000000..a78922218 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_y.htm @@ -0,0 +1,84 @@ + + + + + + layer_text_get_y + + + + + + + + + + +

    layer_text_get_y

    +

    This function returns the Y position of the given Text Element. This can be changed with layer_text_y.

    +

     

    +

    Syntax:

    +

    layer_text_get_y(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_pos =
    + {
    +     x : layer_text_get_x(_text1_id),
    +     y : layer_text_get_y(_text1_id)
    + }
    +
    + if (_text1_pos.y > room_height) _text1_pos.y = 0;
    + if (_text1_pos.y < 0) _text1_pos.y = room_height;
    + if (_text1_pos.x > room_width) _text1_pos.x = 0;
    + if (_text1_pos.x < 0) _text1_pos.x = room_width;
    +
    + layer_text_x(_text1_id, _text1_pos.x + 4);
    + layer_text_y(_text1_id, _text1_pos.y + 4); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then gets its X and Y positions, storing them into a struct.

    +

    It then performs a check on those coordinates, and if they reach one end of the room, they are set to the other end (e.g. going through the right boundary puts you at the left boundary, and so on).

    +

    Finally, it applies the positions back to the element, with 4 added to each component so it shifts its position every frame, moving down and right by 4 pixels each.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_yorigin.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_yorigin.htm new file mode 100644 index 000000000..9ccd7fc63 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_yorigin.htm @@ -0,0 +1,73 @@ + + + + + + layer_text_get_yorigin + + + + + + + + + + +

    layer_text_get_yorigin

    +

    This function returns the Y origin of the given Text Element. This can be changed with layer_text_yorigin.

    +

     

    +

    Syntax:

    +

    layer_text_get_yorigin(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_finalx = layer_text_get_x(_text1_id) - layer_text_get_xorigin(_text1_id);
    + var _text1_finaly = layer_text_get_y(_text1_id) - layer_text_get_yorigin(_text1_id);
    +
    + draw_sprite(spr_arrow, 0, _text1_finalx, _text1_finaly); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then calculates the final position of the text by reading the X/Y coordinates of the element and subtracting the origin from them.

    +

    It then draws an arrow at that position. That means this code would need to run in a Draw event for it to work. Keep in mind that you would ideally want to initialise the text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_yscale.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_yscale.htm new file mode 100644 index 000000000..f06d770eb --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_get_yscale.htm @@ -0,0 +1,77 @@ + + + + + + layer_text_get_yscale + + + + + + + + + + +

    layer_text_get_yscale

    +

    This function returns the Y scale of the given Text Element. This can be changed with layer_text_yscale.

    +

     

    +

    Syntax:

    +

    layer_text_get_yscale(text_element_id);

    + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    +

     

    +

    Returns:

    +

    Real

    +

     

    +

    Example:

    +

    var _zoom = (mouse_wheel_up() - mouse_wheel_down()) * 0.1;
    +
    + var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_xscale = layer_text_get_xscale(_text1_id);
    + var _text1_yscale = layer_text_get_yscale(_text1_id);
    +
    + layer_text_xscale(_text1_id, _text1_xscale + _zoom);
    + layer_text_yscale(_text1_id, _text1_yscale + _zoom); +

    +

    This scales the Text Element based on input from the mouse wheel. It first gets the wheel's delta input, by subtracting an up scroll from a down scroll (returning 1 for up and -1 for down). It multiplies that by 0.1 to slow down the scale change that takes place in one frame.

    +

    Then it gets the ID of the Text Element text1 from the layer Assets, and gets its xscale and yscale. It applies each component back, with the zoom value added to it.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_halign.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_halign.htm new file mode 100644 index 000000000..fcb852fb0 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_halign.htm @@ -0,0 +1,83 @@ + + + + + + layer_text_halign + + + + + + + + + + +

    layer_text_halign

    +

    This function changes the horizontal alignment of the given Text Element. You can supply any one of the following constants:

    +
    +

     

    +

    Syntax:

    +

    layer_text_halign(text_element_id, halign);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    halignText Horizontal Alignment ConstantHorizontal alignment to use
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + text1_old_halign = layer_text_get_halign(_text1_id);
    + text1_old_valign = layer_text_get_valign(_text1_id);
    +
    + layer_text_halign(_text1_id, textalign_center);
    + layer_text_valign(_text1_id, textalign_bottom); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and stores its horizontal and vertical alignments into variables, before changing the alignments. These variables can later be used to reset the alignment values to what they were before they were changed here.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_linespacing.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_linespacing.htm new file mode 100644 index 000000000..4b6432f85 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_linespacing.htm @@ -0,0 +1,76 @@ + + + + + + layer_text_linespacing + + + + + + + + + + +

    layer_text_linespacing

    +

    This function changes the line spacing of the given Text Element. This is the space (in pixels) added between each line in the displayed string.

    +

     

    +

    Syntax:

    +

    layer_text_linespacing(text_element_id, linespacing);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    linespacingRealThe new line spacing for the element.
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_linesp = layer_text_get_linespacing(_text1_id);
    +
    + layer_text_linespacing(_text1_id, _text1_linesp + 4); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, gets its line spacing value and applies it back, increased by 4.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_text.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_text.htm new file mode 100644 index 000000000..1d7830786 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_text.htm @@ -0,0 +1,78 @@ + + + + + + layer_text_text + + + + + + + + + + +

    layer_text_text

    +

    This function changes the text of the given Text Element. You supply the Text Element to modify, and the string that should appear on that element.

    +

     

    +

    Syntax:

    +

    layer_text_text(text_element_id, text);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    textStringThe text string that appears on the element.
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _number = 5;
    +
    + var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_text = layer_text_get_text(_text1_id);
    +
    + layer_text_text(_text1_id, $"{_text1_text} ({_number})"); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and retrieves its text string. It then reapplies the text string back to the element, but with a number value added to it, inside parentheses. For example, if the text was "Waiting for players" it will become "Waiting for players (5)".

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_valign.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_valign.htm new file mode 100644 index 000000000..b73b24c72 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_valign.htm @@ -0,0 +1,82 @@ + + + + + + layer_text_valign + + + + + + + + + + +

    layer_text_valign

    +

    This function changes the vertical alignment of the given Text Element. You can supply any one of the following constants:

    +
    +

     

    +

    Syntax:

    +

    layer_text_valign(text_element_id, valign);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    valignText Vertical Alignment ConstantVertical alignment to use
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + text1_old_halign = layer_text_get_halign(_text1_id);
    + text1_old_valign = layer_text_get_valign(_text1_id);
    +
    + layer_text_halign(_text1_id, textalign_center);
    + layer_text_valign(_text1_id, textalign_bottom); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and stores its horizontal and vertical alignments into variables, before changing the alignments. These variables can later be used to reset the alignment values to what they were before they were changed here.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_wrap.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_wrap.htm new file mode 100644 index 000000000..03fdcc281 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_wrap.htm @@ -0,0 +1,76 @@ + + + + + + layer_text_wrap + + + + + + + + + + +

    layer_text_wrap

    +

    This function enables or disables wrapping of text in the given Text Element. When enabled, text is moved to the next line when the current line width exceeds the frame width.

    +

     

    +

    Syntax:

    +

    layer_text_wrap(text_element_id, wrap);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    wrapBooleanEnable (true) or disable (false) wrapping
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_wrap = layer_text_get_wrap(_text1_id);
    +
    + layer_text_wrap(_text1_id, !_text1_wrap); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and gets the wrapping boolean value. It then reapplies the boolean value after flipping it, so if wrapping is disabled, it will be enabled, and vice versa.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_x.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_x.htm new file mode 100644 index 000000000..bee2110f7 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_x.htm @@ -0,0 +1,89 @@ + + + + + + layer_text_x + + + + + + + + + + +

    layer_text_x

    +

    This function changes the X (horizontal) position of the given Text Element. Note that the text's X position will be offset by the element's xorigin value.

    +

     

    +

    Syntax:

    +

    layer_text_x(text_element_id, x);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    xRealThe X position of the element
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_pos =
    + {
    +     x : layer_text_get_x(_text1_id),
    +     y : layer_text_get_y(_text1_id)
    + }
    +
    + if (_text1_pos.y > room_height) _text1_pos.y = 0;
    + if (_text1_pos.y < 0) _text1_pos.y = room_height;
    + if (_text1_pos.x > room_width) _text1_pos.x = 0;
    + if (_text1_pos.x < 0) _text1_pos.x = room_width;
    +
    + layer_text_x(_text1_id, _text1_pos.x + 4);
    + layer_text_y(_text1_id, _text1_pos.y + 4); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then gets its X and Y positions, storing them into a struct.

    +

    It then performs a check on those coordinates, and if they reach one end of the room, they are set to the other end (e.g. going through the right boundary puts you at the left boundary, and so on).

    +

    Finally, it applies the positions back to the element, with 4 added to each component so it shifts its position every frame, moving down and right by 4 pixels each.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_xorigin.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_xorigin.htm new file mode 100644 index 000000000..8515e43c0 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_xorigin.htm @@ -0,0 +1,80 @@ + + + + + + layer_text_xorigin + + + + + + + + + + +

    layer_text_xorigin

    +

    This function changes the X origin of the given Text Element.

    +

    This is similar to the sprite origin, and is the point within the element that acts as the "centre" for rotation. It acts as a negative offset for the text.

    +

     

    +

    Syntax:

    +

    layer_text_xorigin(text_element_id, xorigin);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    xoriginRealThe new X origin of the element
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + layer_text_x(_text1_id, x);
    + layer_text_y(_text1_id, y);
    +
    + layer_text_xorigin(_text1_id, 0);
    + layer_text_yorigin(_text1_id, 50); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and sets its position to the instance's position.

    +

    It then sets its xorigin to 0 and yorigin to 50, so it appears 50 pixels above the instance's position. This origin can later be changed to adjust the height of the text above the instance.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_xscale.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_xscale.htm new file mode 100644 index 000000000..aee24c5a1 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_xscale.htm @@ -0,0 +1,82 @@ + + + + + + layer_text_xscale + + + + + + + + + + +

    layer_text_xscale

    +

    This function changes the horizontal scale of the given Text Element. 1 is the default scale.

    +

     

    +

    Syntax:

    +

    layer_text_xscale(text_element_id, xscale);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    xscaleRealThe new X scale of the Text Element.
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _zoom = (mouse_wheel_up() - mouse_wheel_down()) * 0.1;
    +
    + var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_xscale = layer_text_get_xscale(_text1_id);
    + var _text1_yscale = layer_text_get_yscale(_text1_id);
    +
    + layer_text_xscale(_text1_id, _text1_xscale + _zoom);
    + layer_text_yscale(_text1_id, _text1_yscale + _zoom); +

    +

    This scales the Text Element based on input from the mouse wheel. It first gets the wheel's delta input, by subtracting an up scroll from a down scroll (returning 1 for up and -1 for down). It multiplies that by 0.1 to slow down the scale change that takes place in one frame.

    +

    Then it gets the ID of the Text Element text1 from the layer Assets, and gets its xscale and yscale. It applies each component back, with the zoom value added to it.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_y.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_y.htm new file mode 100644 index 000000000..c20948d31 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_y.htm @@ -0,0 +1,89 @@ + + + + + + layer_text_y + + + + + + + + + + +

    layer_text_y

    +

    This function changes the Y (vertical) position of the given Text Element. Note that the text's Y position will be offset by the element's yorigin value.

    +

     

    +

    Syntax:

    +

    layer_text_y(text_element_id, y);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    yRealThe Y position of the element
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_pos =
    + {
    +     x : layer_text_get_x(_text1_id),
    +     y : layer_text_get_y(_text1_id)
    + }
    +
    + if (_text1_pos.y > room_height) _text1_pos.y = 0;
    + if (_text1_pos.y < 0) _text1_pos.y = room_height;
    + if (_text1_pos.x > room_width) _text1_pos.x = 0;
    + if (_text1_pos.x < 0) _text1_pos.x = room_width;
    +
    + layer_text_x(_text1_id, _text1_pos.x + 4);
    + layer_text_y(_text1_id, _text1_pos.y + 4); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and then gets its X and Y positions, storing them into a struct.

    +

    It then performs a check on those coordinates, and if they reach one end of the room, they are set to the other end (e.g. going through the right boundary puts you at the left boundary, and so on).

    +

    Finally, it applies the positions back to the element, with 4 added to each component so it shifts its position every frame, moving down and right by 4 pixels each.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_yorigin.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_yorigin.htm new file mode 100644 index 000000000..b605a93c6 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_yorigin.htm @@ -0,0 +1,80 @@ + + + + + + layer_text_yorigin + + + + + + + + + + +

    layer_text_yorigin

    +

    This function changes the Y origin of the given Text Element.

    +

    This is similar to the sprite origin, and is the point within the element that acts as the "centre" for rotation. It acts as a negative offset for the text.

    +

     

    +

    Syntax:

    +

    layer_text_yorigin(text_element_id, yorigin);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    yoriginRealThe new Y origin of the element
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + layer_text_x(_text1_id, x);
    + layer_text_y(_text1_id, y);
    +
    + layer_text_xorigin(_text1_id, 0);
    + layer_text_yorigin(_text1_id, 50); +

    +

    This gets the ID of the Text Element text1 from the layer Assets, and sets its position to the instance's position.

    +

    It then sets its xorigin to 0 and yorigin to 50, so it appears 50 pixels above the instance's position. This origin can later be changed to adjust the height of the text above the instance.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_yscale.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_yscale.htm new file mode 100644 index 000000000..e0106f874 --- /dev/null +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Rooms/Text_Functions/layer_text_yscale.htm @@ -0,0 +1,82 @@ + + + + + + layer_text_yscale + + + + + + + + + + +

    layer_text_yscale

    +

    This function changes the vertical scale of the given Text Element. 1 is the default scale.

    +

     

    +

    Syntax:

    +

    layer_text_yscale(text_element_id, yscale);

    + + + + + + + + + + + + + + + + + + + + + + + +
    ArgumentTypeDescription
    text_element_idText Element IDThe text element ID, retrieved from layer_text_create or layer_text_get_id.
    yscaleRealThe new Y scale of the Text Element.
    +

     

    +

    Returns:

    +

    N/A

    +

     

    +

    Example:

    +

    var _zoom = (mouse_wheel_up() - mouse_wheel_down()) * 0.1;
    +
    + var _text1_id = layer_text_get_id("Assets", "text1");
    +
    + var _text1_xscale = layer_text_get_xscale(_text1_id);
    + var _text1_yscale = layer_text_get_yscale(_text1_id);
    +
    + layer_text_xscale(_text1_id, _text1_xscale + _zoom);
    + layer_text_yscale(_text1_id, _text1_yscale + _zoom); +

    +

    This scales the Text Element based on input from the mouse wheel. It first gets the wheel's delta input, by subtracting an up scroll from a down scroll (returning 1 for up and -1 for down). It multiplies that by 0.1 to slow down the scale change that takes place in one frame.

    +

    Then it gets the ID of the Text Element text1 from the layer Assets, and gets its xscale and yscale. It applies each component back, with the zoom value added to it.

    +

    Since this code is for a Step event, you should initialise the _text1_id variable in the Create event.

    +

     

    +

     

    + + + + + \ No newline at end of file diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Sequences/Sequence_Structs/The_Keyframe_Data_Struct.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Sequences/Sequence_Structs/The_Keyframe_Data_Struct.htm index c136ad07d..065043917 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Sequences/Sequence_Structs/The_Keyframe_Data_Struct.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Sequences/Sequence_Structs/The_Keyframe_Data_Struct.htm @@ -4,7 +4,7 @@ The Keyframe Data Struct - + @@ -25,7 +25,7 @@

    The Keyframe Data Struct

    - Sequence Keyframe Data Struct + Sequence Keyframe Data Struct Variable @@ -34,57 +34,57 @@

    The Keyframe Data Struct

    channel - Real + Real This is the channel that the keyframe data should be applied to. It is a positive integer value starting at 0, and it's worth noting that when creating parameter tracks for "position" or "scale" keyframes, then you need to use very specific channel values. These are: channel 0 is the X position or the X scale, channel 1 is the Y position or Y scale. spriteIndex - Sprite Asset + Sprite Asset The index of the sprite asset to use for the track. This property is only available for tracks of the type seqtracktype_graphic and you can get or set it. soundIndex - Sound Asset + Sound Asset The index of the audio asset to use for the track. This property is only available for tracks of the type seqtracktype_audio and you can get or set it. playbackMode - Sequence Audio Key Constant + Sequence Audio Key Constant The playback mode for the sound. This property is only available for tracks of the type seqtracktype_audio and you can get or set it. The property should be one of the constants given in the table below this one. curve - Animation Curve Struct + Animation Curve Struct This property requires an animation curve struct (see here for more information) and is only available for tracks of the type seqtracktype_real. If no curve struct is used then the value for this property will be -1. value - Real + Real This property is simply a value that is associated with the keyframe data channel, and is only available for tracks of the type seqtracktype_real when no curve struct is supplied. This can be, for example, the X or Y position of the track if placed inside a "position" parameter track. colour - Array of Reals + Array of Reals This property returns (or requires, if being set) an array for the colour value of the keyframe with the format [A, R, G, B]. This is only available for tracks of the type seqtracktype_colour. Note that the values for each component should be expressed as between 0 and 1, where 0 corresponds to the HEX value #00 and 1 corresponds to the HEX value #FF (0 - 255 as shown in the colour picker for colour tracks in the Sequences Editor). sequence - Sequence Object Struct + Sequence Object Struct This property will return (or requires, if being set) a sequence object struct and is only available for tracks of the type seqtracktype_sequence. objectIndex - Object Asset + Object Asset This property will return (or requires, if being set) an object index and is only available for tracks of the type seqtracktype_instance. events - Array of Strings + Array of Strings This property allows access to the events and broadcast messages associated with the keyframe data struct. You can get or set this property, and when getting it an array of strings is returned, and when setting it an array of strings should be specified. For more information on events, please see the section Sequence Events And Moments. This property is only available for tracks of the type seqtracktype_message. event - Method + Method This property will return (or can be set to) the method associated with the keyframe data struct. If no method has been specified or you wish to remove the method, then the property should be -1. This property is only available for tracks of the type seqtracktype_moment. @@ -102,7 +102,7 @@

    The Keyframe Data Struct

    - Sequence Audio Key Constant + Sequence Audio Key Constant Constant @@ -132,7 +132,7 @@

    Text Track Data

    - Sequence Keyframe Data Struct + Sequence Keyframe Data Struct Variable @@ -141,89 +141,38 @@

    Text Track Data

    text - String + String This is the text string that is drawn on the track. wrap - Boolean + Boolean This is a boolean that indicates whether the text should be wrapped (true) or not (false). alignmentH - Sequence Text Alignment Constant - This is the horizontal alignment of the text, and will be one of the Sequence Text Alignment Constants given below. + Text Horizontal Alignment Constant + This is the horizontal alignment of the text, and will be one of the constants given below. alignmentV - Sequence Text Alignment Constant - This is the vertical alignment of the text, and will be one of the Sequence Text Alignment Constants given below. + Text Vertical Alignment Constant + This is the vertical alignment of the text, and will be one of the constants given below. fontIndex - Font Asset - This is the Font Asset used by the text track. + Font Asset + This is the Font Asset used by the text track.

     

    alignmentH can be any of the following constants:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Sequence Text Alignment Constant (alignmentH)
    ConstantDescription
    seqtextkey_leftThe text will be aligned to the left of the frame
    seqtextkey_rightThe text will be aligned to the right of the frame
    seqtextkey_centerThe text will be centred horizontally within the frame
    seqtextkey_justifyThe text will be justified within the frame
    +

     

    alignmentV can be any of the following constants:

    - - - - - - - - - - - - - - - - - - - - - - -
    Sequence Text Alignment Constant (alignmentV)
    ConstantDescription
    seqtextkey_topThe text will be aligned to the top of the frame
    seqtextkey_bottomThe text will be aligned to the bottom of the frame
    seqtextkey_middleThe text will be centred vertically within the frame
    +
    +

     The constants seqtextkey_left, seqtextkey_center, seqtextkey_right, seqtextkey_justify, seqtextkey_top, seqtextkey_middle, seqtextkey_bottom also work as alternatives for the constants listed above, however they are deprecated and only supported for legacy purposes.

     

     

    -
    © Copyright YoYo Games Ltd. 2023 All Rights Reserved
    +
    © Copyright YoYo Games Ltd. 2024 All Rights Reserved

    draw_set_halign

    This function is used to align text along the horizontal axis and changing the horizontal alignment will change the position and direction in which all further text is drawn with the default value being fa_left. The following constants are accepted:

    - - - - - - - - - - - - - - - - - - - -
    ConstantAlignment
    fa_leftfa_left example
    fa_centerfa_center example
    fa_rightfa_right example
    +

     

    Syntax:

    draw_set_halign(halign);

    @@ -48,7 +29,7 @@

    Syntax:

    halign - Horizontal Alignment Constant + Horizontal Alignment Constant Horizontal alignment constant (from the table above). @@ -73,7 +54,7 @@

    Example:

    Next: draw_set_valign
    -
    © Copyright YoYo Games Ltd. 2022 All Rights Reserved
    +
    © Copyright YoYo Games Ltd. 2024 All Rights Reserved

    draw_set_valign

    This function is used to align text along the vertical axis and changing the vertical alignment will change the position and direction in which all further text is drawn, with the default value being fa_top. The following constants are accepted:

    - - - - - - - - - - - - - - - - - - - -
    ConstantAlignment
    fa_topfa_top example
    fa_middlefa_middle example
    fa_bottomfa_bottom example
    +

     

    Syntax:

    draw_set_valign(valign);

    @@ -48,7 +29,7 @@

    Syntax:

    valign - Vertical Alignment Constant + Vertical Alignment Constant Vertical alignment constant (from the table above). @@ -72,7 +53,7 @@

    Example:

    Next: draw_get_font
    -
    © Copyright YoYo Games Ltd. 2022 All Rights Reserved
    +
    © Copyright YoYo Games Ltd. 2024 All Rights Reserved

    Layer Types And Properties

    -

    Everything that goes into the room you create in The Room Editor is placed on a layer. Layers can be added, removed, and sorted from the Layer Editor, and come in a variety of different types, each with their own set of options and way of working. You aren't limited to the number of each type of layer, and can have multiple tile layers, or path layers, or instance layers, etc. Each type of layer has its own properties window where you can set different things depending on the layer type. You can also toggle the layer's visibility, with invisible layers not being processed at runtime (but you can make them visible again at any time using the function layer_set_visible).

    -

    Room LayersThe image above shows the Layer Editor, with the current layers listed at the top, and the different buttons for creating layers at the bottom. You can rename any layer from this editor by doing a slow double click on the name (note that you cannot use anything except letters numbers and the underbar _ character for names) and you can also switch its visibility on or off by clicking the eye icon Eye Icon. If the room has inherited layers from a parent room, you can toggle the inheritance from the button at the bottom, but note that this will affect all layers (see Room Inheritance for more information on inheritance). You can also use Shift Icon or Control Icon / CMD Icon and left click LMB Icon on multiple layers to select them for duplication or deletion (these options are also available from the right mouse RMB Icon menu).

    +

    Everything that goes into the room you create in The Room Editor is placed on a layer. Layers can be added, removed, and sorted from the Layer Editor, and come in a variety of different types, each with their own set of options and way of working.

    +

    You aren't limited to the number of each type of layer, and can have multiple tile layers, or path layers, or instance layers, etc. Each type of layer has its own properties where you can set different things depending on the layer type.

    +

    You can also toggle the layer's visibility, with invisible layers not being processed at runtime (but you can make them visible again at any time using the function layer_set_visible).

    +

    Room LayersThe image above shows the Layer Editor, with the current layers listed at the top, and the different buttons for creating layers at the bottom.

    +

    You can rename any layer from this editor by doing a slow double click on the name (note that you cannot use anything except letters numbers and the underbar _ character for names) and you can also switch its visibility on or off by clicking the eye icon Eye Icon. If the room has inherited layers from a parent room, you can toggle the inheritance from the button at the bottom, but note that this will affect all layers (see Room Inheritance for more information on inheritance). You can also use Shift Icon or Control Icon / CMD Icon and left click LMB Icon on multiple layers to select them for duplication or deletion (these options are also available from the right mouse RMB Icon menu).

    To help with ordering your layers and keeping them tidy, you can create groups of layers in a layer folder by clicking the folder icon Folder Icon. You can also delete one or more selected layers by clicking the delete button Delete Layer Icon. All layers will have a depth value, which defines where in the draw order that layer will be placed when its contents are rendered in the room. Layers are drawn from the highest depth to the lowest, so a layer at a depth of -100 will be drawn over a layer with a depth of 200.

    If you right-click RMB Icon on any layer you get the layer menu:

    Room Layer MenuHere you can open the layer properties window for the selected layer, delete the layer, rename the layer, or add a sub layer. If you choose to add a sub layer, the new layer will be created under it, tabbed to the right. You can then choose to have the sub layer inherit its properties from the parent layer, and also set whether it should inherit the visibility from the parent layer.

    Note that you can drag layers up or down in the window to re-order them, and you can select and move multiple layers too using either Shift Icon + LMB Icon to select from one layer to another (including all those in between) or Control Icon / CMD Icon + LMB Icon to select layers one at a time. If you place the layers on top of a layer folder, they will be moved and set as sub-layers of the folder you dropped them on to. You can also lock layers so that they cannot be edited by mistake using the lock button Padlock Icon.

    -

     In the actual editor window where you place the different assets on their layers, you can hold down "P" + click anywhere to instantly select an asset and skip to the layer that it has been placed on.

    +

     In the room canvas where you place the different assets on their layers, you can hold down "P" + click anywhere to instantly select an asset and skip to the layer that it has been placed on.

    Below you can find an overview of each of the available layer types as well as the editable properties for that layer:

    Background Layer IconBackgrounds

    @@ -124,13 +127,25 @@

    Layer Types And PropertiesAsset Layer IconAssets

    You can add a new asset layer by clicking on the Asset Layer Icon button. This will add the new layer, and then open up the asset layer properties window:

    -

    Room Layer Asset propertiesAn asset layer contains graphical assets (sprites, sequences (possibly containing audio emitters) and particle systems) that are placed into the room independently of instances, and you can place them by either dragging them in from The Asset Browser or by selecting the one you want in the Asset Browser and then using Alt Icon + LMB Icon to "paint" them. Sprite assets are similar to tiles, only they can be fully animated - if the sprite used has sub-images they will be shown - without the restrictions that are in place for tiles, i.e.: they aren't forced to a grid and animations can be any length and speed. Sequences are "collections" of sprites, sounds and instances that will play when the room is entered. Particle systems contain emitters that "emit" particles according to predefined formulas which results in an animation.

    -

    While placing assets on the asset layer they will snap to the grid snap values set at the top of the Room Editor for the grid, but if you want to place them freehand, simply switch off the grid or use the keys Control Icon / CMD Icon and the left mouse button . While those keys are held down, you will be free to place the asset anywhere, without it snapping to the grid resolution.

    -

    Once you place an asset in the room, you have a certain amount of control over how it looks by double clicking  on it to open the asset properties window:

    -

    Room Asset propertiesFrom here you can give the asset a unique name, set whether it is to inherit from the parent room, or change the sprite, sequence or particle system that you want it to display. For sequences, you can set the animation speed and the initial playhead frame, as well as the colour to blend with it (white by default) and the position in the room. You can change the characteristics of sprite assets too, setting a colour to blend it with (white by default), or rotating and flipping it. You can also scale sprites along either or both the axis, and set their position within the room. If the sprite has sub-images, you can choose the animation speed as well as set the initial frame to be shown. Finally, for particle systems, you can also set the blend colour and the rotation of the entire particle system.

    +

    Room Layer Asset propertiesAn asset layer contains graphical assets (sprites, sequences, text and particle systems) that are placed into the room independently of instances, and you can place them by either dragging them in from The Asset Browser or by selecting the one you want in the Asset Browser and then using Alt Icon + LMB Icon to "paint" them.

    +

    While placing assets on the asset layer they will snap to the grid snap values set at the top of the Room Editor for the grid, but if you want to place them freehand, simply switch off the grid or use the keys Control Icon / CMD Icon and the left mouse button LMB Icon. While those keys are held down, you will be free to place the asset anywhere, without it snapping to the grid resolution.

    +

    Asset Types

    +

    Sprite assets are similar to tiles, only they can be fully animated - if the sprite used has sub-images they will be shown - without the restrictions that are in place for tiles, ie: they aren't forced to a grid and animations can be any length and speed.

    +

    You can drag Sequences into an asset layer, which are animated "collections" of sprites, sounds and instances that will play when the room is entered. You can also drag Particle Systems, which contain emitters that "emit" particles according to predefined formulas which results in an animation.

    +

    You can place text by dragging a Font asset into the room, or pressing the  icon in the Layer Toolbox at the top and then clicking in the room where you want to place the text. The default text that appears on a new text element can be changed from the Room Editor Preferences.

    +

    Creating a new text element will create a new Font asset if the project doesn't have any, or use an existing one.

    +

     The image above shows an asset layer with text inside it, and an Outline filter applied to it through The Inspector. Filters/effects can be used in this way to apply visual effects to any type of layer.

    +

     Text elements can be modified at runtime using Text Element Functions.

    +

    Asset Properties

    +

    Once you place an asset in the room, you have a certain amount of control over how it looks by double clicking LMB Icon on it to open the asset properties window:

    +

    Room Asset propertiesThese properties will also appear in The Inspector window, placed on the left by default.

    +

    From here you can give the placed asset ("element") a unique name, set whether it is to inherit from the parent room, or change the sprite, sequence or particle system that you want it to display.

    +

    For sequences, you can set the animation speed and the initial playhead frame, as well as the colour to blend with it (white by default) and the position in the room. You can change the characteristics of sprite assets too, setting a colour to blend it with (white by default), or rotating and flipping it. You can also scale sprites along either or both the axis, and set their position within the room. If the sprite has sub-images, you can choose the animation speed as well as set the initial frame to be shown.

    +

    For text, you can change the multi-line string that appears, its colour, rotation, scale, and position, same as a sequence or sprite graphic. Text-specific options can also be edited, such as the origin (which acts as a negative offset), frame size (only used when wrapping is enabled), wrapping, alignment, character spacing and line spacing. This text functionality is similar to Text in Sequences, refer to that page for more information on text editing behaviour, especially Resize Behaviour.

    +

    Finally, for particle systems, you can also set the blend colour and the rotation of the entire particle system.

    It is worth noting that each asset on the layer is automatically flagged for exporting when the game is made. However, especially when working with inheritance, it may be that you don't want specific assets to be added to the room in the final game. If that is the case, then simply un-checking the "Export" checkbox to the left of the asset in the layer properties list will prevent it from being exported as part of the executable. It is important to note, however, that if you have any code that references that asset, then the game will not run correctly, so use this feature with care.

    -

    Filter/Effect

    +

    Filter/Effect

    You can add a new Filter/Effect layer by clicking on the  button. This will add the new layer, and then open up the asset layer properties window:

    diff --git a/Manual/contents/The_Asset_Editors/Rooms.htm b/Manual/contents/The_Asset_Editors/Rooms.htm index d350c2158..01db8665a 100644 --- a/Manual/contents/The_Asset_Editors/Rooms.htm +++ b/Manual/contents/The_Asset_Editors/Rooms.htm @@ -16,7 +16,7 @@

    The Room Editor

    -

    The Room Editor is where you create your game rooms. Every game requires at least one room to run, and in the room you can place instances, sprites, tiles, paths, backgrounds, sequences and particle systems. Each of these different assets can be placed on their own unique layer which can then be ordered however you wish in the Layer Editor. Due to the complexity of the Room Editor, we'll give you first a brief overview of the most important features, and then you can find more in-depth details from the section links listed below.

    +

    The Room Editor is where you create your game rooms. Every game requires at least one room to run, and in the room you can place instances, sprites, tiles, paths, backgrounds, sequences, text and particle systems. Each of these different assets can be placed on their own unique layer which can then be ordered however you wish in the Layer Editor. Due to the complexity of the Room Editor, we'll give you first a brief overview of the most important features, and then you can find more in-depth details from the section links listed below.

    When you create a room asset, you can right click RMB Icon on it in The Asset Browser to open the context menu, which will permit you to create child rooms (see the page on Room Inheritance for more information), open up the room for editing, add a new asset group to better organise the rooms, rename the room or delete it. Note that to change the room order and/or inheritance you need to use The Room Manager, which you can open using the menu in the top right of the Asset Browser.

    The Room Editor is itself a workspace and as such you can click LMB Icon on the tab and drag it off of the main window into a new window of its own - perhaps in another display, for example. You can also place it back into the main window by dragging the tab to the top of the IDE and releasing the mouse button.

    The user interface for the Room Editor is simple to navigate and split in various discrete sections. Those parts of the editor that are docked - The Inspector that shows the room or layer properties and the Layer Editor - can also be removed from the dock by simply dragging them out into the workspace, and they can be added back into the docks again by dragging them to the sides or the bottom of the workspace.

    @@ -31,7 +31,7 @@

    The Room Editor

    The Room Editor places things onto layers within the room. Each layer is at a discrete "depth", where those that appear at the bottom of the list in the layer window will be drawn under those that appear near the top.

    -

    Layers are created by clicking  the appropriate button for the type of layer you want to create, which are:

    +

    Layers are created by clicking the appropriate button for the type of layer you want to create, which are:

    @@ -52,7 +52,7 @@

    The Room Editor

    - + @@ -84,7 +84,7 @@

    The Room Editor

    Layer Toolbox

    -

    Certain layer types will have additional tools added to the top of the IDE in the Layer Toolbox (for example, tile layers or path layers). The exact tools will change based on the layer type currently being edited, and so are explained on the Layer Types And Properties page.

    +

    Certain layer types will have additional tools added to the top of the IDE in the Layer Toolbox, for example, tile layers, asset layers (for text) and path layers. The exact tools will change based on the layer type currently being edited, and so are explained on the Layer Types And Properties page.

     

    Room Toolbox

    @@ -154,7 +154,7 @@

    Room Menu

    -
    © Copyright YoYo Games Ltd. 2023 All Rights Reserved
    +
    © Copyright YoYo Games Ltd. 2024 All Rights Reserved
    Asset Layer Icon AssetsThis layer is for visual assets to be added to the room, like spritessequences and particles.This layer is for visual assets to be added to the room, like spritessequences, text and particles.