Embed Skyland Survival
One line of script
Put an element where the game should go and load embed.js. The game fills the element's width and
loads only when the visitor presses Play.
| Attribute | Effect |
|---|---|
data-autostart | Start without waiting for a click. |
data-ratio="16/9" | Width to height. Default 16/10. |
data-height="600px" | A fixed height instead of a ratio. |
Or a plain iframe
Add ?autostart to the iframe's URL to skip the Play button. Saves are kept in the visitor's browser
for this site, so an embedded camp and the full-screen one are the same camp.
Talking to the frame
The frame posts { source: 'skyland', type } messages to its parent, with type one of
ready, open, close or error. Post
{ source: 'skyland', type: 'open' } to it to start the game.