itchio / itch.io

:bug: Public itch.io issues tracker and documentation - use support instead for private information!
https://itch.io/support
239 stars 25 forks source link

Iframe gets cropped instead of shrunk when page is below 1000px #1599

Open skeddles opened 4 months ago

skeddles commented 4 months ago

Describe the bug When you shrink the browser window, my game gets cut off, rather than being resized. Under 1000px wide, the website limits the size of the content to 600px.

I have my games resolution set to 768x384 on itch, because I want it to be this big for normal desktop viewers, but it has the ability to render smaller. But instead of shrinking the iframe when the page is under 1000px, the webpage keeps it the same size, and just cuts it off (by putting overflow:hidden on #inner_column.

Not only does this make my game unplayable, you can't even click the fullscreen button any more, which would at least be a workaround, it too is cut off.

To Reproduce Steps to reproduce the behavior:

  1. Go to my game
  2. Resize window to less than 1000px wide
  3. See game being cut off

Expected behavior I would expect the game's iframe to be forced to be smaller to fit within the 600px window, or at least allowed to not be cut off. Cutting off a portion of the game screen would render nearly all games unplayable, whereas most games have the ability to render at difference resolutions, which is how the fullscreen button works.

Screenshots Here is a screenshot of above 1000px wide window, and below 1000px wide window

firefox_2024-05-29_22-25-39 firefox_2024-05-29_22-25-45

Desktop (please complete the following information):

Additional context My game is not using an engine, just javascript, so maybe I'm doing something wrong, but I can't imagine im the first person to ever run into this issue. My game can render as small as 256x128, and while I could set the size on itch to be 512x256, i don't want it to have to render smaller for all desktop users just so a few people with smaller screens can play it.

Since the fullscreen button already changes the size of the iframe and expects your game to adapt accordingly, I don't think it's crazy to expect games to still work if you shrink the iframe to 600px. Perhaps there could be a setting on pages, but again i doubt any game is going to work with the right side of it cropped off.

Or at the very least, the game submission page should warn you to not to set the width higher than 600px.

corpsinhere commented 3 months ago

I have a similar and possibly related problem. Itch now only opens games launched via firefox in a new window. The iframe in this window zooms my game and also cuts off most of it. ifram_problem Note that the UI elements remain in place while the game itself is zoomed and cropped. I added a manual zoom slider to see what is happening. This revealed that the game is also translated such that the bottom of the game is aligned with the center of the iframe. There is also a background texture that is just missing. In chrome, in the embedded version, these issues do not come up.

Skyedra commented 1 month ago

This; if the iframe is resized, then we can adjust our content to fit. Just having it clipped off means we can't set the horizontal iframe size larger than 550px