Let's display the background!

 Background is displayed behind forground(like characters). KAG(by default) reads the background image in the size of 640 × 480.

 For experiment, please look for a desired image of 640 × 480 resolution in the folder 'bgimage'. This image is assumed to be bg0.jpg. Bring it suitably from somewhere because this image is not in the LZH format of KAG. (^^)
 Now, change the code in the scenario file of Display Text tutorial as follows:

[image storage="bg0" page=fore layer=base]
[wait time=200]
*start|Start
[cm]
Hello.

 bg0.jpg is displayed as the background layer by using a tag named image here.
 The extension is ommitable in the file value given to the 'storage' attribute of the image tag.(^^)

 Please execute the code...

BG_Displayed.jpg
The background is displayed

 What are 「Back page」 and 「Background Image」? The true meaning is...


Note
 If you have changed the values of 'scWidth' and 'scHeight' in the Config.tjs, then it's obvious that you have to choose a background image with resolution equal to scWidth × scHeight

Layer composition of KAG

 Kirikiri, or rather KAG, is configured by superimposing, what is referred to as, a "layer" on the screen(similar to layers of Photoshop).


 For instance, in case of the following display...


Layers.jpg
Display example


 The layer structure is as follows:


LayersDesc.jpg
Layer composition


 In KAG, first of all, there is one background layer base and it is displayed below (very back) most. There are three foreground layers (0, 1, 2) on/above the background layer. In addition, there are two message layers above all. Layers can be hidden or displayed by toggling between visible=false and visible=true with the layopt tag. By default, all the foreground layers and one message layer is kept hidden. It is also possible to display foreground layer with the image tag.
 There are two sets(pages) of similar layer structures in KAG, called '(Recto)Fore page' and 'Reverse back page'. The reverse back page can't be displayed on the screen, though the fore page can be displayed on the screen.

 The layer attribute and the page attribute of image tag has to be specified. Layer has to be either 'fore' or 'base'. Also, it's optional to specify base/0/1/2 in the layer attribute.


Note
 The three foreground layers and two message layers is the default setting in Config.tjs.
 The number of the foreground and the message layers can be changed in 'numCharacterLayers' and 'numMessageLayers' respectively. Also, it can be changed when using the 'laycount' tag.


Note
 "Background", "foreground", "recto fore", "reverse back" is likely to be confusing. Fore, specified in the page attribute, is intended to represent the "front screen", NOT a "foreground layer".
 The recto fore or the reverse back page corresponds with fore and back in the page attribute respectively. In the layer attribute, specify 0, 1 or 2, which specifies the base in the case of the background layer.