Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
skeddles opened this issue May 30, 2024 · 1 comment
Open

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

skeddles opened this issue May 30, 2024 · 1 comment
Labels

Comments

@skeddles
Copy link

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):

  • OS: Windows 10
  • Browser: Firefox 126, Chrome 125

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.

@skeddles skeddles added the bug label May 30, 2024
@corpsinhere
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants