Macao API Designer 1.2

You can use the Macao API to animate your home page or to write graphic adventures. Use the Macao Tutorial to get an introduction into Macao. See the descriptions of the classes and the methods in the API to get into detail.

The Macao API Designer documents the classes, methods and fields, which you can use to build a web site based on Macao. The Macao API Full documents also the inner classes, methods and fields. Refer to the full documentation, if you want to modify the core functionality of Macao or if you are searching for bugs.

Error Messages

Here you can find a description of the error messages, which are built into the API.

101 Storage manager not found.

You must include the JavaScript library core/storageManager.js in the top most frame. If you don't use frames, include the library in every page.

102 The storage manager can only store strings, numbers and Boolean values.

You tried to store a complex object in the storage manager. May be you should not use auto restore for an object, which executes an event at the end of a walk. See also MacaoObject.setAutoRestore().

103 The resource definition laguages are not defined.

You need to call MacaoPage.setResourceDefinitionLanguages() before calling MacaoPage.defResource().

104 Provide params as array for a MacaoEvent.

When you send an event, you have to enclose the parameters for the event in an array. Just enclose them in [ ].

105 No size defined for the image.

You need to provide a width and height for an image or a look with an image, which you add to an object. This does not have to be the real size of the image file.

106 A look with that name is already defined.

You tried to add a look with the same name for a second time. If you want to switch the look of an object, use MacaoObject.setActualLook() or MacaoObject.setPreferredLook(). Use phases to switch between bunches of looks. See also MacaoObject.addLookBunch().

107 The name of the talk item is already in use.

You tried to add a talk item with the same name for a second time. Use game events to switch between talk items, if you want to both talk items to respond to the same trigger event. See also MacaoTalkItem.setGameEvents().

108 The road has no node with that index.

You tried to assign an object to a road node. But the road element has no node with the provided index. Try a smaller index.

109 There is no road with that name.

You tried to assign an object to a road node. But there is no road element with the provided name. Use the Road Editor to assign a name to the road element.

110 The card has already a front look.

You tried to create a front look for a card a second time. Call only oneof the methods MacaoCard.createFrontLookGeneric() or MacaoCard.createFrontLookImage().

Packages
cards

The package cards can be used to build card games. Use the class MacaoCard to create cards. Use the Class MacaoCardStack to handle the cards.

cardTypes

The package cardTypes is implemented in the file optional/cards/cardTypes.js. You can use this package to create a standard set of cards.

dynamic

The dynamic package is implemented in the file core/dynamic.js. A compressed version of the package is available in the file core/compressed/dynamic.js. The package is needed in every main content page. It is not needed in controllers- and inventory pages. Load this package after the kernel.js package.

frameset

The frameset package is implemented in the file core/framset.js. Include this package in every page, which defines a frameset and does neither contain the package storageManager nor the package kernel. You only need to include the package. You don't need to call any methods.

kernel

The kernel package contains the class MacaoObject, which is the basic class for any acting object. It also contains the helper classes MacaoLook, MacaoEvent and MacaoBubble.

menu

The menu package is implemented in the file core/menu.js. A compressed version of the package is available in the file core/compressed/menu.js. The package is needed in every page, which displays controllers like a talk controller, a sentence controller or the inventory controller. Normally controllers are not included in a content page but are in extra frames. Include this package after the package kernel.js in a page.

persistence

The package Persistence implements the functionality to save the game score as a bookmark in the browser and to reload this game score, when the bookmark is opened.

road

The road package is implemented in the file core/road.js. A compressed version of the package is available in the file core/compressed/road.js. The package is needed in every main content page that has to display a road map. It is not needed in controllers- and inventory pages. Load this package after the dynamic.js package.

storageManager

The storage manager is used to store values and transfer them between the content pages.