-
Notifications
You must be signed in to change notification settings - Fork 61
Options
Parchment allows you to specify options in two places, the query string, and a source code parchment_options
object.
Some of Parchment's options are set with a query string. The most important is of course the story option, which specifies which story to load. Use these options after the query string marker ?
, and separate them with &
or ;
.
Example: http://iplayif.com/?story=http://ifarchive.org/if-archive/games/glulx/advent.ulx;vm=quixe
Parchment allows the following options to be specified by query string:
Name | Default | Description | Example |
---|---|---|---|
options | - | override parchment_options with a JSON object | options={"width":35} |
story | whatever is specified in parchment_options | the URL of a story to load | story=game.z5 |
vm | - | force the use of a particular VM | vm=quixe |
If you have your own copy of Parchment you can customise more options by adding some simple Javascript to your HTML, as this example shows:
parchment_options = {
default_story: [ 'stories/mygame.z5', 'stories/mygame.z5.js' ],
lib_path: 'parchment/'
};
If you don't have your own copy of Parchment you can also specify these options via the query string, however that is not recommended and not all copies of Parchment will allow it.
Parchment allows the following options to be customised:
Name | Default | Description | Example |
---|---|---|---|
container | #parchment | A selector for the top HTML element which we will have complete control over | container: '#gamediv' |
default_story | none | The default story to load. If unspecified, will show the default panel instead. This can either be a single URL, or it can be an array of two URLs, where the second is a backup Javascript encoded story file |
default_story: 'stories/mygame.z5' or default_story: [ 'stories/mygame.z5', 'stories/mygame.z5.js' ]
|
lib_path | lib/ | Where to find the Javascript libraries Parchment needs | lib_path: 'parchment/' |
lock_options | 0 | If set to 1 will stop people from specifying additional options in the query string | lock_options: 1 |
lock_story | 0 | If set to 1 will stop people from specifying another story in the query string | lock_story: 1 |
page_title | 1 | Set to 0 if you don't want Parchment to overwrite your <title> | page_title: 0 |
panels | [ 'search', 'url', 'about' ] | An array of front page panels to display if there is no default story | panels: [ 'about', 'search', 'url' ] |
proxy_url | https://zcode.appspot.com/proxy/ | The URL of the proxy server | proxy_url: 'http://yourdomain.com/proxy/' |
width | 80 | The width of the screen in characters. You might want to set this to a smaller value if you're putting it in an <iframe> for example. | width: 32 |