DEV Community

HALO
HALO

Posted on

ADV Development with GOKI2 [ModTitle Introduction]: Implementing the Title Screen and Defining Button Layouts

Download

Avalanches & GOKI2 can download the latest environment from the Assets link of Avalanches-GOKI2-Release2.x.y.y.zip based on the release tag on the following site (written as Avalanches (GOKI2) release version 2.x.y.y).

https://github.com/halo1234/Avalanches/releases

Title Screen

In GOKI2, ModTitle implements the title screen.
First, load the module.

tjs:/src/goki2/system/construct.gs
; Title Screen
@load_module name=ModTitle
`plaintext
Now the title screen is available.

Title Screen Settings

First, specify the sound effects.


@title_option click_sound=se001.ogg enter_sound=se002.ogg
plaintext
Here, we specify the click sound and the sound effect for mouse enter.

Title Screen Layout

The title screen can have five buttons: "Start," "Load," "CG/Recollection," "System," and "Exit."
For example, you can do it like this:

`

@title_screen start_caption=Start start_left=370 start_top=400 start_width=60 start_height=20 start_target=*start
@title_screen load_caption=Load load_left=370 load_top=430 load_width=60 load_height=20
@title_screen cgmemory_caption=CG/Reminiscence cgmemory_left=370 cgmemory_top=460 cgmemory_width=60 cgmemory_height=20
@title_screen system_caption=System system_left=370 system_top=490 system_width=60 system_height=20
@title_screen exit_caption=Exit exit_left=370 exit_top=520 exit_width=60 exit_height=20 exit_target=*exit
Enter fullscreen mode Exit fullscreen mode

The start and end options require specifying the scenario storage and label name to execute when selected.
Otherwise, the screen display will be executed directly internally.

Let's look at each option using the start option as an example.

start_caption=Start specifies the button's caption.
This is mostly unnecessary if you're using an image for the button.

start_left=370 start_top=400 start_width=60 start_height=20 specifies the button's position and size.

start_target=*start specifies the label name to execute when Start is selected.
If the scenario storage is omitted, the scenario storage at the time title_screen show is called is assumed to be the one specified.
This attribute is only valid for Start and End.

Displaying the Title Screen

After configuration is complete, display the title screen at any time.


@title_screen show
@s
`plaintext
After displaying the title screen, stop using the s tag or similar.

Events

When the Start and End buttons are pressed, they execute the specified scenario storage and label.
For example, like this:

*exit
@close !ask
*start
@go_to_start !ask

In this case, the start label simply returns to the start, but in reality, it's better to use the *que** tag in the default tags to execute the next scenario.

In Conclusion

We've written a series of articles up to this point, and I think we've finished setting up most of the screens.
From here on, there's a long road ahead where we'll be diligently writing scenario scripts.
However, if you've followed the articles this far, you should be able to overcome this long road.
In the next articles, we'll explain how to implement the game parts, such as choices and video playback.

Top comments (0)