testing wiki

  1. heading1
    1. heading2
      1. choice
  2. Canvas UI
      1. From MupeWiki
  3. Identifier
    1. attributes
    2. creation
  4. Anchoring UI items
  5. Events defined by Canvas Items

This is the front page of your Midgard CMS powered Wiki. Wikis are useful online scratchpads for writing documentation or quick notes in a collaborative fashion.

Content on this wiki is edited using the Markdown syntax, with links to pages made using [Square brackets]. New pages are created by linking to their name and then clicking the link.

Please read the linking instructions for more information.

heading1

heading2

choice

Adds a new item in the choicegroup.

First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

text

First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

more text

Function name Description
help() Display the help window.
destroy() Destroy your computer!

Example(s)

<choice name='item1' text='first item' />
   <choice name='item1' text='first item' />

Canvas UI

From MupeWiki

Canvas implements a free-form graphical user-interface. Canvas UI is meant to be used in graphical application that require a user-interface that does not auto-format itself, such as many kinds of games. With canvas UI content creator can define absolute locations of the UI items and have features for advanced functionality, such as

  • image frame animations
  • moving objects
  • showing and hiding
  • anchoring items together
  • z-order
  • windowing (item groups)
  • graphics primitives for drawing lines, circles, arcs, rectangles, ellipses, etc


Canvas UI uses four UI items that have a lot of common functionality but also specialized features. The UI items are

  • Image
  • String
  • Graphics
  • Button
  • tilemap
  • Prompt
  • Scrollbar


Unlike the form UI, the canvas UI does not use one-level item hierarchy, but there can be several “window”-like drawing spaces, called groups. Groups are used as containers for the UI items. They are rectangular, opaque, areas that can be placed anywhere on the screen. By default, if no groups are created, the UI still containts one group, which is the canvas UI itself. From implementation point-of-view the canvas UI creates a fullscreen group with the ID from the template message.


Identifier

In this UI type the the UI items are referenced using three parameters: ui, group and id. The ui parameter can be left unspecified when the referred UI item is in the same UI with the caller. The “group” parameter can be left unspecified when the referred UI item is in same UI group with the caller. In addition to the UI Items The UI itself can be referred with its id and group, where the group parameter is same as the id. Item groups can be referred same way, by giving id and group parameters with same value.

Alternatively its possible to refer to ui items using target parameter as follows: target="ui:group.id".


attributes

Param Type Meaning
id string Canvas Id (and default group Id)
width int Width of the UI.
height int Height of the UI.
smallfontheight int Height of the small font size.
mediumfontheight int Height of the medium font size.
largefontheight int Height of the large font size.


creation

Param Type Default Meaning
type string none must be ‘canvas"
id string auto Canvas Id (also Id of the default item group)
style string “color” color = flat color background image = image background tiled = tiled image background
img string none URL to image that is used with “image” and “tiled” styles.
resource string none Resource that is used with“image” and “tiled” styles.
uigroup string none ui group Id
active boolean true true = UI is displayed false = UI is just stored in ui group
fullscreen bool true True for fullscreen Uis, false for normal UI size


Example(s)


Anchoring UI items

Each UI item can be anchored to another UI tem. The programmer specified where this item is anchored to (anchor) and where this item is anchored at (reference). Offsets can also be specified. Default anchor is the top left of the group the object is added to and the default reference is this objects top left corner.

If an object is moved and it has another object anchored to it, the anchored object it moved with it. This way the objects can be grouped and moved together. The location of the reference/anchor is defined by: _. The possible combinations are seen in the following table:

**left** **center** **right**
**top** Top\_left top\_center top\_right
**center** center\_left center\_center (aka 'center') center\_right
**bottom** bottom\_left bottom\_center bottom\_right


The anchor and reference points are defined by three parameters reference, anchor and anchorid. the reference parameters tells the reference point of the item and the anchor parameter tells where the reference point is anchored. The anchorid parameter specifies to which item the anchored item is anchored to.


In addition to previous, its possible to specify all three parameters within the anchor parameter (since v2.30 of client). This is just implemented there, because defining the anchoring for every item can be cumbersome. To enable this feature, the reference and anchorid parameters are left unspecified and the anchor parameter is given with notation anchor='referencepoint/anchorpoint/anchorid.


Example(s)

top_left center

  <anchorid>another\_item</anchorid>

Events defined by Canvas Items

These event hooks are defined for all the canvas UI items. They extend the set of events defined in Common Script Language.