Skip to content

API reference

glitchroy edited this page Oct 12, 2019 · 9 revisions

Contents


This article provides a full API reference for scripts intended to be used by the user.

  • variable:Type syntax refers to the expected type the variable should have
  • ?variable:Type denotes that the argument is optional
  • variable:Type = value denotes that the variable has a default value of value if no other value is provided

TbyBranch

TbyBranch lifecycle

Note
tby_branch_create(command_list:Array)
tby_branch_run(branch:TbyBranch,
               destroy_on_finish:Boolean = false)

TbyBranch is an array value returned by tby_branch_create().

tby_branch_destroy(branch:TbyBranch)

TbyCmd for branches

Note
tby_add_box(text:String,
			?placement:TbyPlacement)

TbyPlacement is either TbyPlacement.Bottom, .Middle, .Top or .Auto.

tby_add_bubble(text:String,
               ?instance:Number)

instance is a GML instance id, so something like instance_find(objMyObject, 0). No object references (e.g. objMyObject) should be used.

tby_add_choice(text:String,
			   choice_a:String,
			   choice_b:String,
               option_a:TbyBranch,
               option_b:TbyBranch,
               ?placement:TbyPlacement)

option_a and option_b are arrays in the same form as the usual TbyBranch syntax.

tby_add_config(config:TbyConfig,
               value:any);

Please see branch config options for valid TbyConfig values.

tby_add_script(script:Script,
               ?...arguments:any)

script is a script resource, e.g. function. Do not call the function, e.g. function().

tby_add_set_var(identifier:String,
                value:any,
                instance = id)

identifier is a string representation of a variable. instance is the instance scope for the variable, defaulting to the calling instance (id).

tby_add_set_global(identifier:String,
                   value:any)

The string identifier should not include the global. prefix.

tby_add_pause(seconds:Number)

Decimals are allowed.

tby_add_label(label_name:String)
tby_add_goto(label_name:String)
tby_add_exit()
tby_add_if(compare_a:TbyPointer,
           comparison:TbyCondition,
           compare_b:TbyPointer,
		   if_true:TbyBranch,
           ?if_false:TbyBranch)

Please see Conditionals and pointers for an explanation. The if_false branch is optional.

textboxy

                        

Examples

                        

Technical overview

                        

Clone this wiki locally