From 7ee651df37573edf1fbf47ae07580e36f1807c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ritzl?= Date: Thu, 1 Aug 2019 07:20:09 +0200 Subject: [PATCH] Fixed some minor issues in the docs --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 2ffbf9c..5288691 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ For proxies the recommended setup is to create one game object per screen and pe * **Popup (boolean)** - Check this if the screen should be treated as a [popup](#popups). * **Popup on Popup (boolean)** - Check this if the screen is a [popup](#popups) and it can be shown on top of other popups. * **Timestep below Popup (number)** - Timestep to set on screen proxy when it is below a popup. This is useful when pausing animations and gameplay while a popup is open. -* **Transition Url (url)** - Optional URL to call when the screen is about to be shown/hidden. Use this to trigger a transition (see the section on [transitions](#transitions)). -* **Focus Url (url)** - Optional URL to call when the screen gains or loses focus (see the section on [screen focus](#screen-focus-gainloss)). +* **Transition Url (url)** - Optional URL to post messages to when the screen is about to be shown/hidden. Use this to trigger a transition (see the section on [transitions](#transitions)). +* **Focus Url (url)** - Optional URL to post messages to when the screen gains or loses focus (see the section on [screen focus](#screen-focus-gainloss)). * **Preload (boolean)** - Check this if the screen should be preloaded and kept loaded at all times. For a collection proxy it means that it will be async loaded but not enabled at all times while not visible. This can also temporarily be achieved through the `monarch.preload()` function. ![](docs/setup_proxy.png) @@ -44,8 +44,8 @@ For factories the recommended setup is to create one game object per screen and * **Screen Id (hash)** - A unique id that can be used to reference the screen when navigating your app. * **Popup (boolean)** - Check this if the screen should be treated as a [popup](#popups). * **Popup on Popup (boolean)** - Check this if the screen is a [popup](#popups) and it can be shown on top of other popups. -* **Transition Id (url)** - Optional id of the game object to send a message to when the screen is about to be shown/hidden. Use this to trigger a transition (see the section on [transitions](#transitions)). -* **Focus Id (url)** - Optional id of the game object to send a message to when the screen gains or loses focus (see the section on [screen focus](#screen-focus-gainloss)). +* **Transition Id (hash)** - Optional id of the game object to send a message to when the screen is about to be shown/hidden. Use this to trigger a transition (see the section on [transitions](#transitions)). +* **Focus Id (hash)** - Optional id of the game object to send a message to when the screen gains or loses focus (see the section on [screen focus](#screen-focus-gainloss)). * **Preload (boolean)** - Check this if the screen should be preloaded and kept loaded at all times. For a collection factory this means that its resources will be dynamically loaded at all times. This can also temporarily be achieved through the `monarch.preload()` function. ![](docs/setup_factory.png) @@ -289,7 +289,7 @@ Both the ```monarch.show()``` and ```monarch.back()``` functions take an optiona Show a Monarch screen. Note that the screen must be registered before it can be shown. The ```init()``` function of the ```screen.script``` takes care of registration. **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to show. +* ```screen_id``` (string|hash) - Id of the screen to show. * ```options``` (table) - Options when showing the new screen (see below). * ```data``` (table) - Optional data to associate with the screen. Retrieve using ```monarch.data()```. * ```callback``` (function) - Optional function to call when the new screen is visible. @@ -308,7 +308,7 @@ The options table can contain the following fields: Hide a screen that has been shown using the `no_stack` option. If used on a screen that was shown without the `no_stack` option it will only hide it if the screen is on top of the stack and the behavior will be exactly like if `monarch.back()` had been called. **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to hide. +* ```screen_id``` (string|hash) - Id of the screen to hide. * ```callback``` (function) - Optional function to call when the screen has been hidden. **RETURN** @@ -330,7 +330,7 @@ Go back to a previous Monarch screen Preload a Monarch screen. This will load but not enable the screen. This is useful for content heavy screens that you wish to be able to show without having to wait for it load. **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to preload. +* ```screen_id``` (string|hash) - Id of the screen to preload. * ```callback``` (function) - Optional function to call when the screen is preloaded. @@ -338,7 +338,7 @@ Preload a Monarch screen. This will load but not enable the screen. This is usef Check if a Monarch screen is preloading (via monarch.preload() or the Preload screen setting). **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to check +* ```screen_id``` (string|hash) - Id of the screen to check **RETURN** * ```preloading``` (boolean) - True if the screen is preloading. @@ -348,7 +348,7 @@ Check if a Monarch screen is preloading (via monarch.preload() or the Preload sc Invoke a callback when a screen has been preloaded. **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to check +* ```screen_id``` (string|hash) - Id of the screen to check * ```callback``` (function) - Function to call when the screen has been preloaded. @@ -356,7 +356,7 @@ Invoke a callback when a screen has been preloaded. Unload a preloaded Monarch screen. A preloaded screen will automatically get unloaded when hidden, but this function can be useful if a screen has been preloaded and it needs to be unloaded again without actually hiding it. **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to unload. +* ```screen_id``` (string|hash) - Id of the screen to unload. * ```callback``` (function) - Optional function to call when the screen is unloaded. @@ -367,7 +367,7 @@ Get the id of the screen at the top of the stack. * ```offset``` (number) - Optional offset from the top of the stack, ie -1 to get the previous screen **RETURN** -* ```screen_id``` (hash) - Id of the requested screen +* ```screen_id``` (string|hash) - Id of the requested screen ### monarch.bottom([offset]) @@ -377,14 +377,14 @@ Get the id of the screen at the bottom of the stack. * ```offset``` (number) - Optional offset from the bottom of the stack **RETURN** -* ```screen_id``` (hash) - Id of the requested screen +* ```screen_id``` (string|hash) - Id of the requested screen ### monarch.data(screen_id) Get the data associated with a screen (from a call to ```monarch.show()``` or ```monarch.back()```). **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to get data for +* ```screen_id``` (string|hash) - Id of the screen to get data for **RETURN** * ```data``` (table) - Data associated with the screen. @@ -394,7 +394,7 @@ Get the data associated with a screen (from a call to ```monarch.show()``` or `` Check if a Monarch screen exists. **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to get data for +* ```screen_id``` (string|hash) - Id of the screen to get data for **RETURN** * ```exists``` (boolean) - True if the screen exists. @@ -407,21 +407,21 @@ Check if Monarch is busy showing and/or hiding a screen. * ```busy``` (boolean) - True if busy hiding and/or showing a screen. -### monarch.is_top(id) +### monarch.is_top(screen_id) Check if a Monarch screen is at the top of the view stack. **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to check +* ```screen_id``` (string|hash) - Id of the screen to check **RETURN** * ```exists``` (boolean) - True if the screen is at the top of the stack. -### monarch.is_visible(id) +### monarch.is_visible(screen_id) Check if a Monarch screen is visible. **PARAMETERS** -* ```screen_id``` (hash) - Id of the screen to check +* ```screen_id``` (string|hash) - Id of the screen to check **RETURN** * ```exists``` (boolean) - True if the screen is visible.