Parchment Site Generator: cover art when no autoplay?

If I chuck a zblorb or gblorb into the Parchment Site Generator and then put the resulting page in an iframe (e.g. as happens via itch.io), we now get this extra loading page:

This is probably a good thing in a lot of situations, but not really for itch, which gives you a play button for free anyway. While trying to work out if I could turn off this behaviour, I noticed that the loading spinner in the middle of the page has an alt of “Cover art”.

I probably wouldn’t mind this start page so much if it did have the cover art on it… Is this a bug? What are my options?


EDIT: I have answered my initial query, by finding the below block in the HTML file and adding the autoplay line:

<script>parchment_options = {
  "single_file": 1,
  "autoplay": true,
  "story": {
    "title": "Ancient Treasure, Secret Spider by C.E.J. Pacian",
    "url": "embedded:Ancient Treasure, Secret Spider.zblorb",
    "format": "zcode",
  },
}</script>
1 Like

I don’t remember if cover art used to work and broke or if I never added it, but it shouldn’t be too tricky to add. (The underlying code is the same as for iplayif.com which does have cover art, so I probably just forgot a variable to send the cover art in the sitegen tool.)

The idea of the play button was so that it wouldn’t autoplay if Parchment is loaded in an iframe. But does Itch use a whole-window iframe? That’s not ideal. I could change it to autoplay if it detects the iframe takes up the whole window.

1 Like

itch already adds its own play button to the game’s iframe:

So the two clicks in a row feel a bit much here. But I’m sure it’s a good idea in general, and I was able to figure out how to turn this behaviour off.

Although I will confess that the first time I saw the new page I did spend too long waiting for it to load (due to the spinner) before I realised that the “Play” button was there.

Separate from the cover art, could the loading spinner just get hidden when the game is ready to play?

Hmm, maybe I should test directly if it’s embedded into an Itch page and autoplay in that case?

The spinner should definitely disappear once it’s finished loading, if it doesn’t that’s a major bug.

When the game has loaded what I see is: the game title, a loading spinner with alt text “cover art” and a “Play” button.

After you’ve pressed the Itch Run Game button you mean? That’s before Parchment itself has actually loaded the game and engine.

Here’s how I was testing. Happy to learn that I have done something stupid or I’m failing to understand something. :sweat_smile:

  1. Stick my zblorb into the Site Generator:

  1. Chuck the HTML file it made in a directory with an HTML file of my making, demo.html:

  1. Chuck an iframe in demo.html:
<html>
<iframe height="480px" width="640px" src="./CastleOfTheRed Prince.zblorb.html"></iframe>
</html>
  1. Open demo.html in Chrome or Firefox:

  1. Wait any amount of time or none at all, the “Play!” button will start playing the game.

  1. The thing in the middle spins like a loading spinner and has alt text “Cover art”. (If it’s not a loading spinner, could it perhaps be a static image instead of animated?)

1 Like

Not sure how important it is, but since you asked, I’ll quickly explain what itch.io does here.

First of all, the iframe can either be embedded in the page (ie. not a whole-window iframe), or it can have a “Play” button which does launch a whole-window, fullscreen iframe:

If you choose “Embed in page”, you have two additional options. You can have the embedded game start automatically in its small iframe; if this is deactivated, the embed will have a “Play” button as well. You can also add a fullscreen button so the player can turn the iframe into a whole-window iframe at any time.

So there are two scenarios where itch presents its own “Play” button before loading the game: If you want the game to launch directly into fullscreen, and if you don’t want that but want a “Play” button anyway (to allow it to autoplay sound, for example, which browsers usually require interactivity to do). The latter probably serves a similar purpose as the sitegen’s “Play” button?

2 Likes

I wouldn’t have thought Itch’s play button would work for solving the sound autoplaying issue because it’s a separate HTML page, but if that’s what other non-IF games use I guess it must. Though I haven’t added sound support to the sitegen tool yet so we couldn’t test it. I’ll try to get to these things soon!

1 Like