2
0
Эх сурвалжийг харах

1.2.160 Fixes (#62)

* Full list with dependencies for `android-support-v4`

* Initial commit for the new HTML5 manual

* Html5 manual

* Info about different color themes

* Added info about extension

* Review fixes

* added info about dependency

* Removed old permissions

* Remove Gameroom

* Firebase messages already extracted

* typo
Alexey Gulev 6 жил өмнө
parent
commit
f995f60e48

+ 0 - 4
docs/en/en.json

@@ -474,10 +474,6 @@
                         "path": "/manuals/windows",
                         "name": "Windows"
                     },
-                    {
-                        "path": "/manuals/gameroom",
-                        "name": "Facebook Gameroom"
-                    },
                     {
                         "path": "/manuals/instant-games",
                         "name": "Facebook Instant Games"

+ 0 - 9
docs/en/manuals/android.md

@@ -77,18 +77,9 @@ Allows an application to write to external storage. Starting in API level 19, th
 ### android.permission.READ_PHONE_STATE (Protection level: dangerous)
 Allows read only access to phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any PhoneAccounts registered on the device. This permission is used to detect if a call is ongoing (for [sound.is_phone_call_active()](/ref/sound/#sound.is_phone_call_active)) as well as to populate the `device_ident` field of [sys.get_sys_info()](/ref/sys/#sys.get_sys_info). ([Android official docs](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE))
 
-### android.permission.GET_ACCOUNTS (Protection level: dangerous)
-Allows access to the list of accounts in the Accounts Service. This permission was used when registering for push notifications, but it is actually not needed. You can safely remove this permission (it will be removed from the default manifest later). ([Android official docs](https://developer.android.com/reference/android/Manifest.permission#GET_ACCOUNTS)).
-
 ### android.permission.WAKE_LOCK (Protection level: normal)
 Allows using PowerManager WakeLocks to keep processor from sleeping or screen from dimming. This permission is needed to temporarily prevent the device from sleeping while receiving a push notification. ([Android official docs](https://developer.android.com/reference/android/Manifest.permission#WAKE_LOCK))
 
-### android.permission.VIBRATE (Protection level: normal)
-Allows access to the vibrator. This permission is needed for the device to vibrate when a push notification is received. ([Android official docs](https://developer.android.com/reference/android/Manifest.permission#VIBRATE))
-
-### com.google.android.c2dm.permission.RECEIVE and {{android.package}}.permission.C2D_MESSAGE
-These permissions are needed to receive push notifications.
-
 
 ## Android Debug Bridge
 

+ 29 - 19
docs/en/manuals/extensions-details.md

@@ -46,27 +46,37 @@ We don't specify a specific C++ version, so we use the default of each compiler.
 
 ## Android
 
-We include the following libraries and its dependencies into the Android bundle:
+We include the following libraries into the Android bundle:
 ```
-com.google.firebase:firebase-messaging:17.3.4
-com.google.firebase:firebase-core:16.0.7
-com.google.android.gms:play-services-base:16.0.1
-com.android.support:support-v4:27.1.1
-com.android.support:support-compat:27.1.1
-com.android.support:support-core-utils:27.1.1
-com.android.support:support-core-ui:27.1.1
-com.android.support:support-media-compat:27.1.1
-com.android.support:support-fragment:27.1.1
-com.android.support:support-annotations:27.1.1
-android.arch.core:common:1.1.0
-android.arch.core:runtime:1.1.0
-android.arch.lifecycle:common:1.1.1
-android.arch.lifecycle:compiler:1.1.1
-android.arch.lifecycle:extensions:1.1.1
-android.arch.lifecycle:reactivestreams:1.1.1
-android.arch.lifecycle:runtime:1.1.1
+com.google.android.gms.play-services-ads-identifier:16.0.0
+com.google.android.gms.play-services-base:16.0.1
+com.google.android.gms.play-services-tasks:16.0.1
+com.google.android.gms.play-services-basement:16.0.1
+com.android.support.support-v4:27.1.1
+android.arch.lifecycle.extensions:1.1.1
+com.android.support.support-fragment:27.1.1
+com.android.support.support-core-ui:27.1.1
+com.android.support.support-core-utils:27.1.1
+com.android.support.support-media-compat:27.1.1
+com.android.support.support-compat:27.1.1
+android.arch.lifecycle.compiler:1.1.1
+android.arch.lifecycle.reactivestreams:1.1.1
+android.arch.lifecycle.runtime:1.1.1
+android.arch.lifecycle.livedata:1.1.1
+android.arch.lifecycle.livedata-core:1.1.1
+android.arch.lifecycle.common:1.1.1
+android.arch.core.runtime:1.1.1
+android.arch.core.common:1.1.1
+android.arch.lifecycle.viewmodel:1.1.1
+com.android.support.support-annotations:27.1.1
+org.jetbrains.kotlin.kotlin-stdlib:1.2.20
+com.google.auto.auto-common:0.6
+com.squareup.javapoet:1.8.0
+org.reactivestreams.reactive-streams:1.0.0
+org.jetbrains.annotations:13.0
+com.google.guava.guava:18.0
 ```
-*We plan to move Firebase messages and Google Play Services to its own extensions.*
+*We plan to move Google Play Services to its own extension.*
 
 ## Win32 + Clang
 

+ 2 - 0
docs/en/manuals/facebook.md

@@ -14,6 +14,8 @@ To start using the Facebook extension you need to add it as a dependency to your
 https://github.com/defold/extension-facebook/archive/master.zip
 ```
 
+We recommend using a link to a zip file of a [specific release](https://github.com/defold/extension-facebook/releases).
+
 Documentation of the API is available on the [extension GitHub page](https://defold.github.io/extension-facebook/).
 
 ## Registering as a Facebook developer

+ 0 - 104
docs/en/manuals/gameroom.md

@@ -1,104 +0,0 @@
----
-title: Facebook Gameroom
-brief: Facebook Gameroom for PC gaming is a Windows-native client available as a free download for players worldwide. Within Facebook Gameroom, players can experience both web games and also native games built exclusively for the platform.
----
-
-# Facebook Gameroom
-
-Facebook Gameroom is a Windows-native client allowing players to play web games as well as native games built exclusively for the platform.
-
-![Gameroom](images/gameroom/gameroom.jpg)
-
-<span class="icon-windows"></span> The client is [available for download here](https://www.facebook.com/gameroom/download/) for Windows 7 and above.
-
-Gameroom builds work with the same Facebook Lua API as usual. See the [Facebook manual](/manuals/facebook) for more information on the Defold Facebook API.
-
-## Configuring for Gameroom
-
-You need to set up your project for Facebook first. See the [Facebook manual](/manuals/facebook) for details.
-
-Secondly, you should set the *IAP provider* setting under *Windows* in your "game.project" file to `Gameroom`:
-
-![Project settings](images/gameroom/game_project.png)
-
-## Building and testing locally
-
-Bundle your game for the Windows platform. (<kbd>Project ▸ Bundle ▸ Windows Application</kbd>). Notice that there is a file named "launch" in the bundle directory.
-
-You need a Windows machine to fully test your game. You also need the Gameroom client to test that your game integrates correctly with the SDK.
-
-1. Start the client and click on your profile icon in the top right corner of the application window:
-
-   ![Start client](images/gameroom/client.jpg)
-
-2. Click *[DEV] Debug Local Game Build*:
-
-   ![Debug local game build](images/gameroom/local_dev.jpg)
-
-3. Click *Launch Game* and select the file "launch":
-
-   ![Launch](images/gameroom/launch2.jpg)
-
-   ![Launch](images/gameroom/launch.jpg)
-
-## Publishing your game
-
-Your app must be approved in the Facebook App Center before it can go live. You can find instructions on how to proceed on the Facebook for developers pages here: https://developers.facebook.com/docs/games/gameroom/launch
-
-![Launch on gameroom](images/gameroom/launch_on_gameroom.jpg)
-
-## Premium games
-
-You can set up your game as a premium game in Gameroom to provide paid content to players:
-
-Premium Game
-: Pay before you download and play.
-
-Trial Mode
-: Try before you buy.
-
-See https://developers.facebook.com/docs/games/gameroom/premium for details on how to set up your game as a premium game on the Facebook *App Dashboard*.
-
-Gameroom adds two functions to the iap API. Use them to implement a license check in order to separate trial and paid content.
-
-[iap.has_premium()](/ref/iap#iap.has_premium)
-: Checks if the user has purchased a license for the game.
-
-[iap.buy_premium()](/ref/iap#iap.buy_premium)
-: Let the user purchase a premium game license. The purchase transaction is handled like other IAP purchases, via an iap listener function.
-
-To implement a trial mode, you do both a license check and a time limit (3 hour trial) or a content limit (first level trial) check. If the license check fails and the conditions for the trial does not hold anymore, you prompt the player to purchase the game. The Gameroom API will automatically display a payment dialog with the price configured in the Facebook App Dashboard.
-
-```lua
-local function iap_listener(self, transaction, error)
-  if error == nil then
-    if (transaction.state == iap.TRANS_STATE_PURCHASED) then
-      iap.finish(transaction)
-      msg.post("game#controller", "continue_after_purchase")
-    end
-  else
-    -- an error occurred...
-  end
-end
-
-local function premium_result(self, has_premium)
-  -- how many minutes has player tried this game?
-  local playminutes = go.get("game#timekeeper", "playtime"))
-
-  -- if user has played for more than 3 hours and has not yet purchased.
-  if playminutes > 180 and not has_premium then
-     -- stop the game until game is purchased
-     msg.post("game#controller", "stop_for_purchase")
-     iap.buy_premium()
-  end
-end
-
-function init()
-  -- set the listener function for iap transactions
-  iap.set_listener(iap_listener)
-
-  -- check if the player needs to purchase a license.
-  -- this should probably be done at regular intervals.
-  iap.has_premium(premium_result)
-end
-```

+ 107 - 170
docs/en/manuals/html5.md

@@ -1,49 +1,50 @@
 ---
 title: Defold development for the HTML5 platform
-brief: This manual describes the process of creating HTML5 canvas applications, along with known issues and limitations.
+brief: This manual describes the process of creating HTML5 game, along with known issues and limitations.
 ---
 
 # HTML5 development
 
-Defold supports building games for the HTML5 platform through the regular bundling menu, as well as some platform specific tools. In addition, the resulting game is embedded on a regular HTML page that can be styled through a simple template system.
+Defold supports building games for the HTML5 platform through the regular bundling menu, as well as for other platforms. In addition, the resulting game is embedded on a regular HTML page that can be styled through a simple template system.
 
 The *game.project* file contains the HTML5 specific settings:
 
 ![Project settings](images/html5/html5_project_settings.png)
 
-## Customizing heap size
+## Heap size
 
 Defold support for HTML5 is powered by Emscripten (See http://en.wikipedia.org/wiki/Emscripten). In short, it creates a sandbox of memory for the heap in which the application operates. By default, the engine allocates a generous amount of memory (256MB). This should be more than sufficient for the typical game. As part of your optimization process, you may choose to use a smaller value. To do this, follow these steps:
 
-1. Set *custom_heap_size* to a preferred value. It should be expressed in bytes.
-2. Enable the override by checking *set_custom_heap_size*
-3. Create your HTML5 bundle (see below)
+1. Set *heap_size* to a preferred value. It should be expressed in megabytes.
+2. Create your HTML5 bundle (see below)
 
-## Monitoring memory usage
+## Testing HTML5 build
 
-During development, you may track the use of application memory by creating bundles that include a special memory tracking component. This feature is enabled by checking *include_dev_tool*. For further details, see below.
+For testing, HTML5 build needs an HTTP server. Defold creates one for you if you choose <kbd>Project ▸ Build HTML5</kbd>.
 
-## Application cache
+![Build HTML5](images/html5/html5_build_launch.png)
 
-You may opt to save application data within the _HTML5 application cache_ (See https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache), as it may improve loading times and reduce network traffic. Most commonly, this features is not used during development as the browser will prefer cached data over any new content you create. If you use the feature during testing, note that building a new bundle will alter the cache manifest, leading to new data being fetched. All browsers provide the means to clear this cache.
+If you want to test your bundle, just upload it to your remote HTTP server or create a local server, for example, using python in the bundle folder.
+Python 2:
+> python -m SimpleHTTPServer
 
-## Creating HTML5 content
+Python 3:
+> python -m http.server
 
-Creating HTML5 content with Defold is simple and follows the same pattern as all other supported platforms: select <kbd>Project ▸ Bundle...​ ▸ HTML5 Application...</kbd> from the menu:
+or
+> python3 -m http.server
 
-![Build HTML5](images/html5/html5_build_launch.png)
-
-You will be prompted to select a folder in which to create your application. After the export process completes, you will find all of the files needed to run the application.
-
-![Application files](images/html5/html5_files.png)
+::: important
+You can't test the HTML5 bundle by opening `index.html` file in a browser. This requires HTTP server.
+:::
 
-## Testing HTML5 Content
+## Creating HTML5 bundle
 
-Install your content into a directory accessible to a web server. The testing environment available to you will depend upon your project: from this environment simply open the .html page of your application.
+Creating HTML5 content with Defold is simple and follows the same pattern as all other supported platforms: select <kbd>Project ▸ Bundle...​ ▸ HTML5 Application...</kbd> from the menu:
 
-![Application](images/html5/html5_goat.png)
+![Application files](images/html5/html5_bundle.png)
 
-You may also launch HTML content directly from the editor, which opens the application in a local browser. Depending on the functionality of your game, you may prefer to test your application from a web server instead.
+You will be prompted to select a folder in which to create your application. After the export process completes, you will find all of the files needed to run the application.
 
 ## Known issues and limitations
 
@@ -51,14 +52,6 @@ Live update
 : Defold applications must run their own miniature web server in order to receive live updates from the editor. This is not possible within a pure browser application.
 
 
-CORS
-: Cross-origin resource sharing (See http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) is not enabled in the QA environment, limiting the ability of browsers to interact with web APIs. There are two possible workarounds: when using Chrome, start it with the ‘--disable-web-security’ flag; you can create a proxy server.
-
-
-Safari (IndexedDB)
-: Persistent user data is stored locally using _IndexedDB API_ (see https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API). This HTML5 feature is not supported in the current version of Safari, so data will not be stored between sessions when using this browser. It will be included in the next update.
-
-
 Internet Explorer 11 (audio)
 : Defold handles audio playback using HTML5 _WebAudio_ (see http://www.w3.org/TR/webaudio), which is not currently supported by Internet Explorer 11. Applications will fall back to a null audio implementation when using this browser.
 
@@ -71,213 +64,157 @@ Internet Explorer 11 (Full screen)
 : Full screen mode is unreliable in the browser.
 
 
-## Customizing HTML5 applications
-
-When generating an HTML5 version of your application, Defold provides a default web page that will house your application. It references style and script resources that dictate how your application is presented.
-
-In general, the time required to fetch all resources required to launch an application is not negligible. For this reason, Defold HTML5 applications implement a splash screen feature that is loaded separately from the main application and that will show while the main application loads.
-
-Unless overridden, Defold will produce a default page, consisting of:
+## Customizing HTML5 bundle
 
-- An HTML5 canvas for your application
-- A button to access fullscreen mode
-- Splash screen content and logic
-- Development tools, if required
+When generating an HTML5 version of your game, Defold provides a default web page. It references style and script resources that dictate how your game is presented.
 
 Each time the application is exported, this content is created afresh. If you wish to customize any of these elements you must make modifications to your project settings. To do so, open the *game.project* in the Defold editor and scroll to the *html5* section:
 
-![HTML5 settings](images/html5/html5_styling_settings.png)
+![HTML5 Section](images/html5/html5_section.png)
 
-These settings allow you to add a custom HTML file, stylesheet and splash image.
+More information about every option is available in [project settings manual](/manuals/project-settings/#_html5).
 
-::: sidenote
-To get started, you can begin by exporting the application once with the default settings. You then copy the exported HTML and CSS back into your project. Once copied, make the changes to the settings, as described above, and start editing the files.
+::: important
+You can't modify files of the default html/css template in `builtins` folder. For applying your modifications copy/paste needed file from `builtins` and set this file in `game.project`.
 :::
 
-You have considerable freedom to make changes or additions to this content, but some restrictions apply:
-
-- The canvas should not be styled with any border or padding. If you do, mouse input coordinates will be wrong.
-- If Facebook support is required then the script tag that loads the Javascript SDK should appear before the main application script.
-
-## Splash screens
-
-By default, a splash screen is implemented. If you wish to customize or remove the splash screen then there are a few features that require attention:
-
-- HTML markup
-- CSS styling
-- Javascript logic
-
-Although the implementation of any associated Javascript is a matter of preference, Defold applications will send information back to you if you implement a "SplashControl" object that contains the following methods:
+::: important
+The canvas shouldn't be styled with any border or padding. If you do, mouse input coordinates will be wrong.
+:::
 
-onSetMessage(text)
-: This callback receives text that is intended for display to the user.
+In `game.project` it is possible to turn-off the `Fullscreen` button and the `Made with Defold` link.
+Defold provides a dark and light theme for the index.html. The light theme is set by default but it is possible to change by changing `Custom CSS` file. There is also four predefined scale modes to chose from in the `Scale Mode` field.
 
+::: important
+The calculations for all scale modes include current screen DPI in case if you turn on `High Dpi` option in `game.project` (`Display` section)
+:::
 
-onSetProgress(current, max)
-: As the application is loaded, this callback receives the current progress. "current" contains the amount of data that has been loaded and "max" contains the total amount of data to load.
+### Downscale Fit and Fit
 
+For the `Fit` mode canvas size will be changed to show full game canvas on the screen with original proportions. The only difference in `Downscale Fit` is changing size only if the inner size of the webpage is smaller than the original canvas of the game, but doesn't scale-up when a webpage is bigger than the original game canvas.
 
-onDismissSplash()
-: This callback is invoked by the application when the application is loaded and it is about to begin execution and render to the canvas (i.e. the splash screen should be dismissed).
+![HTML5 Section](images/html5/html5_fit.png)
 
+### Stretch
 
-The default implementation also contains logic to deal with window resizing events. If you wish to change or replace the implementation, the main module provides two helper functions:
+For the `Stretch` mode canvas size will be changed to fully fill the inner size of the webpage.
 
-Module.matchToCanvas(id)
-: Accepts the id of a DOM element and adjusts its styled "width" and "height" properties to match the proportions of the canvas. The "marginTop" property is set to a value that centers the canvas vertically in the browser window.
+![HTML5 Section](images/html5/html5_stretch.png)
 
+### No Scale
+With `No Scale` mode the canvas size is exactly the same as you predefined in `game.project` file, `[display]` section.
 
-Module.setMarginTop(id, sourcePixels)
-: Set the "marginTop" property of element "id" to a value "sourcePixels" that is expressed at a scale relative to the project settings application height. Internally, "sourcePixels" is multiplied by _scale_ before it's assigned to the top margin. The _scale_ is the actual browser window pixel height divided by the application pixel height as specified in the project settings.
+![HTML5 Section](images/html5/html5_no_scale.png)
 
+## Tokens
 
-::: important
-These methods are not available until the module script is loaded. See the default generated HTML file for example usage.
-:::
+We use [Mustache template language](https://mustache.github.io/mustache.5.html) for creation of the `index.html` file. When your are building or bundling, the HTML and CSS files are passed through a compiler that is capable of replacing certain tokens with values that depend upon your project settings. These tokens are always encased in either double or triple curly braces (`{{TOKEN}}` or `{{{TOKEN}}}`), depending on whether character sequences should be escaped or not. This feature can be useful if you either make frequent changes to your project settings or intend for material to be reused in other projects.
 
 ::: sidenote
-When focusing on splash screen development, you can comment out any code related to loading and running the engine to speed up the process.
+More information about Mustache template language is available in [manual](https://mustache.github.io/mustache.5.html).
 :::
 
-## Tokens
+Any `game.project` can be a token. For example, if you want to use `Width` value from `Display` section:
 
-When your HTML5 application is created, the HTML and CSS files are passed through a compiler that is capable of replacing certain tokens with values that depend upon your project settings. These tokens are always encased in either double or triple curly braces (`{{TOKEN}}` or `{{{TOKEN}}}`), depending on whether character sequences should be escaped or not. This feature can be useful if you either make frequent changes to your project settings or intend for material to be reused in other projects.
+![Display section](images/html5/html5_display.png)
 
-Whether HTML or CSS content, the following tokens are all supported:
+Open `game.project` as a text and check `[section_name]` and name of the field you want to use. Then you can use it as a token: `{{section_name.field}}` or `{{{section_name.field}}}`.
 
-DEFOLD_DISPLAY_WIDTH
-: (HTML or CSS) Writes the value specified in your project settings for display width.
+![Display section](images/html5/html5_game_project.png)
 
+For example, in HTML template in JavaScript:
 
 ```javascript
 function doSomething() {
-    var x = {{DEFOLD_DISPLAY_WIDTH}};
+    var x = {{display.width}};
     // ...
 }
 ```
 
-DEFOLD_DISPLAY_HEIGHT
-: (HTML or CSS) Writes the value specified in your project settings for display height.
-
-
-```javascript
-function doSomething() {
-    var y = {{DEFOLD_DISPLAY_HEIGHT}};
-}
-```
+Also, we have the following custom tokens:
 
 DEFOLD_SPLASH_IMAGE
-: (HTML or CSS) Writes the filename of the splash image file.
-
-
-```html
-<image class="splashImage" src="{{DEFOLD_SPLASH_IMAGE}}"></image>
-```
-
-The following tokens are only supported when processing HTML files:
-
-DEFOLD_APP_TITLE
-: (HTML) Generates a string based on your project’s title.
-
-
-```html
-<head>
-    <title>{{DEFOLD_APP_TITLE}}</title>
-</head>
-```
-
-DEFOLD_JS
-: (HTML) Corresponds to the name of the main application javascript file.
-
-
-DEFOLD_MODULE_JS
-: (HTML) Corresponds to the name of the bootstrap javascript file. It is this file that loads the application assets and coordinates the activity of the splash screen.
+: Writes the filename of the splash image file or `false` if `html5.splash_image` in `game.project` is empty
 
 
-```html
-<script type='text/javascript' src="{{DEFOLD_MODULE_JS}}"></script>
+```css
+{{#DEFOLD_SPLASH_IMAGE}}
+		background-image: url("{{DEFOLD_SPLASH_IMAGE}}");
+{{/DEFOLD_SPLASH_IMAGE}}
 ```
 
-DEFOLD_CSS
-: (HTML) This is the filename of the CSS file that is output during export, either using the default or the template specified in your project settings.
-
-
-```html
-<head>
-    <link rel="stylesheet" type="text/css" href="{{DEFOLD_CSS}}"></style>
-</head>
-```
+exe-name
+: The project name without unacceptable symbols
 
-DEFOLD_DEV_HEAD
-: (HTML) Creates a custom HTML fragment, used in the `<head>` section of your HTML document, content depending upon your project settings. Note the use of triple braces, as it is important that this character sequence should not be escaped.
-
-
-```html
-<head>
-    {{{DEFOLD_DEV_HEAD}}}
-</head>
-```
 
-DEFOLD_DEV_INLINE
-: (HTML) Creates a custom HTML fragment, used in the `<body>` section of your HTML document, content depending upon your project settings.
+DEFOLD_CUSTOM_CSS_INLINE
+: This is the place when we inline of the CSS file specified in your `game.project` settings.
 
 
 ```html
-{{{DEFOLD_DEV_INLINE}}}
-<script type="text/javascript" src="//connect.facebook.net/en_US/sdk.js"></script>
-<!-- etc. -->
+<style>
+{{{DEFOLD_CUSTOM_CSS_INLINE}}}
+</style>
 ```
 
 ::: important
-It is important that this inline block appear before the main application script is loaded. Since it includes HTML tags, this macro should appear in triple braces to prevent character sequences being escaped.
+It is important that this inline block appear before the main application script is loaded. Since it includes HTML tags, this macro should appear in triple braces `{{{TOKEN}}}` to prevent character sequences being escaped.
 :::
 
-DEFOLD_JS_INIT
-: (HTML) This tag, once processed, adds code to load the Defold application. Should development options also be enabled, it also performs initialization of any associated modules.
+DEFOLD_SCALE_MODE_IS_DOWNSCALE_FIT
+: This token is `true` if `html5.scale_mode` is `Downscale Fit`.
 
+DEFOLD_SCALE_MODE_IS_FIT
+: This token is `true` if `html5.scale_mode` is `Fit`.
 
-```html
-{{{DEFOLD_DEV_INLINE}}}
-<script type="text/javascript" src="//connect.facebook.net/en_US/sdk.js"></script>
-{{DEFOLD_JS_INIT}}
-```
-
-::: important
-If you wish to use the Facebook SDK then the tag to load this should appear before the `{{{DEFOLD_JS_INIT}}}` tag. This macro should also be enclosed in triple braces, as it too contains HTML tags and should not be escaped.
-:::
-
-## HTML5 Memory Tracker
+DEFOLD_SCALE_MODE_IS_NO_SCALE
+: This token is `true` if `html5.scale_mode` is `No Scale`.
 
-In development, HTML5 bundles can be created that include a simple memory tracking tool. To include it in your application, open your "game.project" file and scroll to the *html5* section.
+DEFOLD_SCALE_MODE_IS_STRETCH
+: This token is `true` if `html5.scale_mode` is `Stretch`.
 
-![Include devtool](images/html5/html5_devtool_include.png)
+DEFOLD_HEAP_SIZE
+: Heap size specified in `game.project` `html5.heap_size` converted to bytes.
 
-By enabling the *include_dev_tool* option, the bundling process will automatically include and enabled this tool. *Remember to cancel this option before creating release candidates!*
+DEFOLD_ENGINE_ARGUMENTS
+: Engine arguments specified in `game.project` `html5.engine_arguments` separated by `,` symbol.
 
-## Tool features
 
-Launch your application in a browser as normal, and the tool will appear on screen.
+## Extra parameters
 
-![Devtool example](images/html5/html5_devtool_goatgold.png)
+If you create your custom template, you can specify extra parameters for the engine loader:
+```
+`Module.runApp("canvas", extra_params) - Starts the
+    application given a canvas element id
 
-You may enable or disable the various sections of memory reporting by pressing the toggle switches. The sections contain the following information:
+'extra_params' is an optional object that can have the
+    following fields:
 
-Heap
-: The overall size of the heap memory. This may be configured by setting a custom heap size. Tuning this value will be useful when creating a release that makes optimum use of resources.
+'archive_location_filter':
+    Filter function that will run for each archive path.
 
-Dynamic
-: Measures the current and peak levels of dynamic memory allocation, alongside overall counts of allocation and free operations being performed by the application.
+'unsupported_webgl_callback':
+    Function that is called if WebGL is not supported.
 
-Static
-: Summarizes memory allocated for statically included data, built directly into the application.
+'engine_arguments':
+    List of arguments (strings) that will be passed to the engine.
 
-Stack
-: Monitors the overall amount of memory allocated to the code for stack use. You should expect the used value to consistently report zero during normal operation, other values may indicate a bug in the engine.
+'persistent_storage':
+    Boolean toggling the usage of persistent storage.
 
+'custom_heap_size':
+    Number of bytes specifying the memory heap size.
 
-It is most likely that the first two sections will be most relevant during development. In particular, best performing applications will not make frequent requests to dynamically allocate memory.
+'disable_context_menu':
+    Disables the right-click context menu on the canvas element if true.
 
-## Known limitations
+'retry_time':
+    Pause before retry file loading after error.
 
-The memory tracking tool works by patching the functions `malloc()` and `free()`, and doing so at the earliest possible moment. This patch is not performed before methods are declared to global constructors, meaning that dynamic allocations made during this early phase of the application will not be tracked in the usage or peak data. Values relating to the dynamic memory area and locations will, however, be accurate.
+'retry_count':
+    How many attempts we do when trying to download a file.
 
+'can_not_download_file_callback':
+    Function that is called if you can't download file after 'retry_count' attempts.
+*/
+```

BIN
docs/en/manuals/images/html5/html5_build_launch.png


BIN
docs/en/manuals/images/html5/html5_bundle.png


BIN
docs/en/manuals/images/html5/html5_devtool_goatgold.png


BIN
docs/en/manuals/images/html5/html5_devtool_include.png


BIN
docs/en/manuals/images/html5/html5_display.png


BIN
docs/en/manuals/images/html5/html5_files.png


BIN
docs/en/manuals/images/html5/html5_fit.png


BIN
docs/en/manuals/images/html5/html5_game_project.png


BIN
docs/en/manuals/images/html5/html5_goat.png


BIN
docs/en/manuals/images/html5/html5_no_scale.png


BIN
docs/en/manuals/images/html5/html5_project_settings.png


BIN
docs/en/manuals/images/html5/html5_section.png


BIN
docs/en/manuals/images/html5/html5_stretch.png


BIN
docs/en/manuals/images/html5/html5_styling_settings.png


+ 17 - 11
docs/en/manuals/project-settings.md

@@ -358,23 +358,17 @@ Iap Provider
 
 ## HTML5
 
-Set Custom Heap Size
-: If set, Emscripten allocates *custom_heap_size* number of bytes for the application heap.
-
-Custom Heap Size
-: Sets the custom heap size (number of bytes) for Emscripten to use if *set_custom_heap_size* is set. If not set, 256MB is allocated for the application heap.
-
-Include Dev Tool
-: Includes a visual dev-tool in the application that allows tracking of memory usage.
+Heap Size
+: Heap size (number of megabytes) for Emscripten to use. By default this value is 256MB.
 
 .html Shell
-: If set, use the specified template HTML file when bundling.
+: Use the specified template HTML file when bundling. By default `/builtins/manifests/web/engine_template.html`.
 
 Custom .css
-: If set, use the specified CSS file when bundling.
+: Use the specified theme CSS file when bundling. By default `/builtins/manifests/web/light_theme.css`.
 
 Splash Image
-: If set, use the specified splash image on startup when bundling.
+: If set, use the specified splash image on startup when bundling instead of Defold logo.
 
 Archive Location Prefix
 : When bundling for HTML5 game data is split up into one or more archive data files. When the engine starts the game, these archive files are read into memory. Use this setting to specify the location of the data, `archive` by default.
@@ -382,6 +376,18 @@ Archive Location Prefix
 Archive Location Suffix
 : Suffix to be appended to the archive files. Useful to, for instance, force non-cached content from a CDN (`?version2` for example).
 
+Engine Arguments
+: List of arguments that will be passed to the engine.
+
+Show Fullscreen Button
+: Enables Fullscreen Button in `index.html` file. By default `true`.
+
+Show Made With Defold
+: Enables Made With Defold link in `index.html` file. By default `true`.
+
+Scale Mode
+: Specifies which method to use to scale the game canvas. By default `Downscale Fit`.
+
 ## Facebook
 
 Appid

+ 17 - 1
docs/en/manuals/push.md

@@ -5,10 +5,26 @@ brief: This document describes how to set up and implement remote and local iOS
 
 # Push notifications
 
-Push notifications are available on iOS and Android devices and allow your game to inform the player about changes and updates. The core functionality is similar between iOS and Android but there are some platform specific differences that you need to consider.
+Push notifications are available on iOS and Android devices as a [native extension](/manuals/extensions/) and allow your game to inform the player about changes and updates. The core functionality is similar between iOS and Android but there are some platform specific differences that you need to consider.
 
 For a push notification to find its way from the server to the target device, certain bits of information are required for your app. The most complex part consists of security information that you set in the application so the notification system can verify the legitimacy of the client receiving notifications. But you will also need a piece of security information for your notification server so the Apple or Google servers can verify that your server is a legitimate notification sender. Finally, when you send notifications, you need to be able to uniquely direct notifications to a specific user's device. For that you retreive and use a token that is unique to the particular device (i.e. user).
 
+## Installing the extension
+
+To start using the Push extension you need to add it as a dependency to your `game.project` file. The latest stable version is available with the dependency URL:
+```
+https://github.com/defold/extension-push/archive/master.zip
+```
+
+We recommend using a link to a zip file of a [specific release](https://github.com/defold/extension-push/releases).
+
+This extension requires the following dependency ([specific release](https://github.com/defold/extension-firebase-core/releases)):
+```
+https://github.com/defold/extension-firebase-core/archive/master.zip
+```
+
+Documentation of the API is available on the [extension GitHub page](https://defold.github.io/extension-push/).
+
 ## iOS setup
 
 ::: sidenote