Difference between revisions of "Text Boxes"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
(Graphics)
(special symbols & HTML markup tags)
Line 2: Line 2:
 
[[Alternate Descriptions]] can be used to append extra text, or completely change the displayed message, based on [[Restrictions]].   
 
[[Alternate Descriptions]] can be used to append extra text, or completely change the displayed message, based on [[Restrictions]].   
  
 +
 +
== Special Characters ==
 +
The following symbol characters are used for special purposes, so cant be used freely in text.
 +
*< (Less than) This is used for HTML markup tags and to insert comments in the text. The tag finishes at the next > character.
 +
*% (Percent) Two of these are used as delimiters around variable names, functions and equations that are embedded in the text and evaluated immediately prior to he text being output. Note that nested % symbols may be placed inside the brackets of a function. The equation finishes and normal text resumes at the next % symbol that is not enclosed by bracket
 +
*The following special symbols are used inside equations delimited by % symbols
 +
**( ) (Parentheses) Used to delimit the parameter lists of some functions, but not others.
 +
**[ ] (Square brackets) When used after a function name these are used to delimit a single text parameter for the function, ie. [ is the equivalent of (" and ] is the equivalent of ")  Except [ ] is also used to indicate the index value when used with an array variable. Except [ ] is also used around parameter lists of some functions when its not text, sometimes, for those functions not using ( ). Maybe. Sort of.
 +
**, (comma) Separates parameters in a parameter list, seems to work in the middle of a string when delimited by square brackets so must itself be a string delimiter. sometimes. except when its not.
 +
**+ (Plus) Causes runner to hang if used in a string passed to a function such as UCase[ ]
 +
**$ (Dollar) Causes runner to hang if used in a string passed to a function such as UCase[ ]
 +
**^ (Cirumflex) Causes runner to hang if used in a string passed to a function such as UCase[ ]
 +
**< > (Less than, greater than) Must be used in pairs inside of other brackets as Adrift does not currently nest different types of delimiter correctly.
 +
== HTML markup tags ==
 +
Many standard HTML markup tags can be inserted in text to control the formatting of the output.
 +
 +
*< br > (break) Start a new line.
 +
*<img src="''filename or url''"> Insert an image into the text (see also the graphics section below)
 
== Drag and Drop ==
 
== Drag and Drop ==
 
As well as being able to drag and drop pieces of text into the text boxes, you can also drag items from the main ADRIFT window into the boxes too.  This provides a quick way of creating functions.  So for example, if you drag a character from a list into a text window it will pop up a menu asking what you wish to display from:
 
As well as being able to drag and drop pieces of text into the text boxes, you can also drag items from the main ADRIFT window into the boxes too.  This provides a quick way of creating functions.  So for example, if you drag a character from a list into a text window it will pop up a menu asking what you wish to display from:

Revision as of 01:07, 27 November 2011

All multi-line text boxes within ADRIFT are completely flexible as to how and what they display. They are designed to look simple at first glance, with the user typing in basic descriptions. They all support Syntax Highlighting to show functions, references, keys, comments and variables. Alternate Descriptions can be used to append extra text, or completely change the displayed message, based on Restrictions.


Special Characters

The following symbol characters are used for special purposes, so cant be used freely in text.

  • < (Less than) This is used for HTML markup tags and to insert comments in the text. The tag finishes at the next > character.
  • % (Percent) Two of these are used as delimiters around variable names, functions and equations that are embedded in the text and evaluated immediately prior to he text being output. Note that nested % symbols may be placed inside the brackets of a function. The equation finishes and normal text resumes at the next % symbol that is not enclosed by bracket
  • The following special symbols are used inside equations delimited by % symbols
    • ( ) (Parentheses) Used to delimit the parameter lists of some functions, but not others.
    • [ ] (Square brackets) When used after a function name these are used to delimit a single text parameter for the function, ie. [ is the equivalent of (" and ] is the equivalent of ") Except [ ] is also used to indicate the index value when used with an array variable. Except [ ] is also used around parameter lists of some functions when its not text, sometimes, for those functions not using ( ). Maybe. Sort of.
    • , (comma) Separates parameters in a parameter list, seems to work in the middle of a string when delimited by square brackets so must itself be a string delimiter. sometimes. except when its not.
    • + (Plus) Causes runner to hang if used in a string passed to a function such as UCase[ ]
    • $ (Dollar) Causes runner to hang if used in a string passed to a function such as UCase[ ]
    • ^ (Cirumflex) Causes runner to hang if used in a string passed to a function such as UCase[ ]
    • < > (Less than, greater than) Must be used in pairs inside of other brackets as Adrift does not currently nest different types of delimiter correctly.

HTML markup tags

Many standard HTML markup tags can be inserted in text to control the formatting of the output.

  • < br > (break) Start a new line.
  • <img src="filename or url"> Insert an image into the text (see also the graphics section below)

Drag and Drop

As well as being able to drag and drop pieces of text into the text boxes, you can also drag items from the main ADRIFT window into the boxes too. This provides a quick way of creating functions. So for example, if you drag a character from a list into a text window it will pop up a menu asking what you wish to display from:

Character Name
Character Description
List objects held by
List objects worn by
Location of

By selecting one of these entries, the corresponding function for your selection will be inserted into the textbox.

Similar menus are offered for the other item types.

Preview

This section has still to be completed. I am hoping that it will provide a preview of the text as it would be displayed in Runner. It may also be possible to apply formatting directly to the text.

Graphics

You can insert graphics into a piece of text by selecting the Graphics tab on the right hand side. This provides a handy preview and URL. You can enter a filename, or a URL from the Internet here. Internet images will be downloaded on the fly, which can minimize the size of your adventure. By default, this will display the graphic at the start of the section of text.

It is also possible to insert multiple images in any piece of text by using <img> tags. The format is <img src="filename or url">. Using the <img> tags also allows you to customise exactly where in the text it will appear. This is useful if, for example, you have <waitkey> or <wait X> tags in your text. Also, you may want different images to appear for different alternate descriptions