Script (java)

Script (java) - lets you enter Java-based code. To see how this works, enable "Save generated script" in the program options. The following files are then created in the __SCRIPTS subfolder of the project folder when you compile the project:

Another way to see how this works is to select any action (for example Jump menu or Play movie) and then select "Script (java)" instead: the Java code is generated automatically.

 

Types

The following types are used:

 

Constants

 

Name conversion

When you refer to any object of the program by name (item, movie, menu), the following rules apply:

Example - jump to the main menu "Main Sound" and select the "SndMusic" button:

manager.activateSegment("S:MM_Main_Sound.show_menu");
manager.activateButton("H:MM_Main_Sound.Handler", "SndMusic");

Example - play the movie "Movie":

manager.setStartPlayMark(#1);
manager.activateSegment("S:MV_Movie.play_movie");

 

Dynamic load notes

In Dynamic load mode, "Jump menu" commands are translated into transitions that preload the graphic segments. Therefore all "activate segment" commands have to lead to the corresponding transition segments. To generate these transitions, the engine needs to know the target segments, so you have to add special comments to tell it:

//TRANSITION:[transition_segment_name]:[target_segment_name]:[source_segment_name]:[target_menu_prefix:target menu name]

For example:

You can see how these comments are generated automatically by selecting "Script (Java)" for any command while "Dynamic load" is enabled.

Note that the scripts generated with and without "Dynamic load" are different.

 

Minimize internal names optimization notes

If Safe is selected, the following internal names are replaced:

_anim_segment_done_ → _sd
QueueTimer → QT
_ActivatedPause_ → _AP
DummyAnm → DA
Dummy → Y
Everything → ET
Loading → LD
AnimList → _L
Anim → _A
animgroup → ag
animall → aa
obj_btm → _b
obj_top → _t

If All is selected, the following names are replaced in addition to those replaced by Safe:

animate → _a
ClosePopup → CP
Normal → N
Selected → S
Activated → A
Current → C
show_menu → sm
first_run → fr
play_movie → pm
Handler → H
Listener → U
assembly → as
activated → ac
Press → P
Enter → E
Select → T
Left → L
Right → R
Down → D
Green → G
Yellow → Y
Blue → B
PopupMenu → PM
NextTrack → NT
PrevTrack → PT
FastForward → FF
Rewind → W

 

Available functions (methods)

Described here.

 

Hotkeys