2.6 PAGE definition
Posted on May 17, 2016 | 0 comments
PAGE defines a custom HTML template which can be sent to the player’s client.
Any PAGE definition must be placed in the GUI section according to the following syntax:
(square brackets indicate optional parts):
PAGE viewId , template
In practice, the specified template is loaded at startup time and then used at the programmer’s need.
The template is actually an HTML file which you build with any suitable editor. When designing the view, you should insert in the HTML code the placeholders: $scene, $icons, $inventory, $navpad, $messages which will be replaced at run-time by the actual content.
Identifier of the view (mandatory)
Note: “default” refers to the pre-defined view.
It is normally a .HTM file which resides in the media folder.
You can specify a file name, a relative path, or an absolute URL starting with http://
This is also called HTML template. See next section to learn how to produce one.
The defined PAGEs can be used later by means of the UseView script instruction (See section 3.12.27).
2.6.1 HTML templates
HTML Templates are HTML files which can be used by the game engine to produce game views. They must be declared by using the PAGE tag in the GUI section (see above), and then called at programmer’s need by using the script’s SendPage instruction.
HTML templates can be prepared by the programmer by using any HTML editor (or any text editor if you like). They can include special placeholders which will be automatically replaced by game’s real values during game display. Also, the player’s chosen skin is applied to the HTML template automatically.
The following is a list of currently supported placeholders:
|Placeholder||Will be replaced with…|
|$display||Player’s messages (avatar’s thoughts)|
|$icons||Icons of objects in the current room.|
|$banner||ONLY the banner of focusized object normally seen at the top of a $scene. Typically used when NOT displaying the $scene.|
|$properties||Player’s properties (all those beginning with a capital letter)|
Scene display (usually the room’s image), with focusized object on top.
Note: this will always appear in the same position, that is at coordinates 1,21 of the screen. This will be fixed in later releases.
HTML templates can use media files (e.g. images) contained in your game’s IMAGEDIR or anywhere else on the web by using an absolute URL starting with http://.
Tip: It is recommended that you compose any HTML template in your images folder, so you can peview the result in your browser. Then, when it looks OK, just move it to folder where you keep the game’s DXW file.
The DimensioneX game engine expects to find the HTML templates in the same folder where the main game source resides