DIALOGUE ENGINE MANUAL

------------------------------------------
CONTENTS
- Introduction
- Scripts
    - Basic scripts
    - Settings scripts
    - Styling scripts
    - Options scripts
    - Other scripts
- Changing default settings
- Using Draw GUI
- Using Dialogue engine with Cutscene engine
- Smart line break configuration
- Tutorials
- Report a bug
- Other things
------------------------------------------

INTRODUCTION

Thank you for getting my Dialogue engine! This manual will help you get started.

The fastest way to get started is probably checking the example objects to see how this engine can be used.
Also, at the end of every script there is a little example of how to use it.

If you want to ask anything or suggest a feature, see the "Contact me" part at the bottom of this manual.

------------------------------------------

SCRIPTS

    BASIC SCRIPTS
    
    textbox_create()
    With this script you can create the dialogue.
    
    ------------------------
    SETTINGS SCRIPTS
    
    textbox_set()
    With this you can set the style and some settings of the textbox.

    textbox_set_bubble()
    If you call this instead of textbox_set(), you can make the textbox a speech bubble.
    
    textbox_set_speed()
    With this you can set the speed of the dialogue. The default speed is 0.5.
    
    textbox_set_key()
    With this you can choose the keyboard keys used for the dialogue.
    
    textbox_set_sound()
    Choose the sound for the dialogue.
    It could be, for example, a typewriter sound.
    
    textbox_add_voice()
    With this you can add voice acting to the dialogue.
    
    ------------------------
    STYLING SCRIPTS
    
    textbox_set_sprite()
    With this function you can add your own sprite for the textbox and name box, instead of colored rectangles.
    (The sprite size should be a multiple of 3, for example, 12 or 24).
    
    textbox_set_portrait()
    With this you can set a different character portrait sprite to every message in the dialogue.
    
    textbox_set_position()
    Set the position of everything.
    The textbox automatically fits the view, but if you don't like how it goes, you can change it with this.
    It's not necessary to change everything. If you change only some things, the others should automatically go to correct positions.
    
    ------------------------
    OPTIONS SCRIPTS
    
    textbox_add_options()
    Add up to 3 options.
    
    textbox_change_message_according_option()
    Change one message depending on what option the player chooses.
    
    textbox_change_var_at_end()
    Change a variable when the dialogue ends.
    You could use this, for example, to know if the player has spoken to a npc or not.
    
    chooses_option()
    Checks what option the player chooses. You can use it to change something (for example a variable).
    For an example, see the object: example_npc3.
    
    OTHER SCRIPTS
    
    textbox_exists()
    Checks if the textbox exists.
    Call it before using textbox_create(). For example:
    if !textbox_exists() {
        textbox_create("Hello.");
    }
    
    textbox_hide() and textbox_is_visible()
    textbox_is_visible() checks if the textbox is visible or not and textbox_hide() can be used to hide or show the textbox.
    For example:
    if textbox_exists() {
        if keyboard_check_pressed(vk_escape) {
            if textbox_is_visible() {
                textbox_hide(true);
            }else{
                textbox_hide(false);
            }
        }
    }
    
    textbox_show_backlog() && textbox_backlog_visible()
    textbox_backlog_visible() checks if the backlog is visible or not.
    textbox_show_backlog() shows or hides the backlog.
    
---------------------------------

CHANGING DEFAULT SETTINGS
If you don't want to call the script textbox_set() or textbox_set_sprite() etc. everytime, you can change
the default settings in the textbox_create() script. If you go to that script, you will find a "SETTINGS AREA"
where you can change variables.
---------------------------------

USING DRAW GUI
Using Draw GUI with this Dialogue engine hasn't been tested a lot yet, so
I recommend using the normal Draw event. But if you want to use it, follow these instructions:
1. Go to the textbox object.
2. Change the Draw event to Draw GUI.
3. Change the draw_gui variable there to true.

Things to note:
Remember that using textbox_set_position is of course different when using Draw GUI.
When using Draw GUI, your camera size and viewport size should be the same, otherwise clicking options with mouse will not work well.
---------------------------------

USING DIALOGUE ENGINE WITH CUTSCENE ENGINE
I have also made a cutscene engine (https://marketplace.yoyogames.com/assets/8241/cutscene-engine).
It uses some of the same scripts and objects as the dialogue engine. When importing these scripts and objects, you can replace the duplicates.
---------------------------------

SMART LINE BREAK CONFIGURATION
Recently I added a new optional argument to textbox_set: smart line breaks.
This prevents text from changing line in the middle of a word. However, this is still an experimental
feature and doesn't work correctly on all projects (also, it doesn't seem to work when using Draw GUI in the textbox object).
If you want to use this feature in your project but it doesn't work correctly, you can try this:
Go to textbox_draw script. Change the variable called linebreak_addition to something else
(for example: 0, -5 or -10). It's completely possible that this doesn't fix it and you will not be able
to use this feature. However, I tried to use this feature in 4 different projects and in 3 of them changing
this variable helped (on 1 project it didn't work at all).
---------------------------------

TUTORIALS
There are some (currently only one...) simple tutorials on my Youtube channel.
If you already know how to use this, feel free to make your own tutorials.
---------------------------------

REPORT A BUG
If you find a bug, please report it in the discussion boards on itchio.
You can also email me. See the "Contact me" section below.
---------------------------------

OTHER THINGS
You can ignore the textbox object. It manages itself. You can also ignore the internal scipts.

-Showcasing your games-
Have you made a game using this Dialogue engine?
If so, you can email me a link to the game and I might showcase it on my website or in the marketplace.

-Becoming a tester-
Would you like to try new features earlier? Email me to become a tester for Dialogue engine
(and Cutscene engine too if you own it). You will also get one of my games for free every time you have
tested an update, when the update is published.

-Contact me-
Discussion board on itchio.
For email, see contact page (link below).