#I honestly haven't consciously developed for mobile
Explore tagged Tumblr posts
Note
Hi! You obv dont have to answer this but Ive also been working on a twine game on harlowe for some time and usually play yours on my desktop. But I just played it on mobile and wow! That's such an effective conversion for mobile! I have my layout on harlowe all figured out for desktop play but just cant figure out how to make my passages and such responsive and mobile friendly but your mobile version looks completely different from the desktop version. I looked for some guides on how to achieve responsive passages and such in mobile but I didnt find much and what I found didnt really help me bc I probably understood it incorrectly. Could you maybe give some advice on how to tackle making a mobile version on harlowe? Of course I understand if its too much trouble!
I also really love your games and am looking forward to the bad ritual update!!
Oh thank you....thank you so much this means so much to me đđđ
Okay so the straightforward answer is âmy degree was really mobile focused so Iâve next to never built anything that is not optimized for mobile so I barely think about itâ but I do absolutely have tips when I do sit down and think about it !!
Okay so pretty much all of this will exist in your CSS file, and itâs a pretty easy fix. One of the easiest things you can do to make things more mobile friendly is to tell pixels to get lost and jump on the percentages train. This happens in two main areas: font sizes, and dimmensions.
For a long time I did font sizes in pixels because thatâs what the internet tells you to do when you ask it, but then I switched to doing font sizes in âemâ. This makes it so that itâs using the userâs default font sizes as a references point, which generally makes things easier to read because the user will have their system font set to something they can see. So instead of trying to do a system style:
tw-body { Â Â font: 13px; }
Youâd instead write:
tw-body { Â Â font: 1em; }
1em is using the exact system sized font the user has set, and then you increment it by decimal points to make it larger (or the opposite way to make it smaller but itâs a little dicey to start purposely going below what your user is comfortable seeing; itâs not impossible to need to, because if you have icons that link to things using the <a> tag, it will technically be a font and not an image). Always start at one, and change by .10 when youâre incrementing it.
Besides using em for font sizes (and font sizes only), you can also ditch pixels when youâre setting widths and heights. This is less common Iâve found because Twine really does most of its own work when it comes to how things are laid out, but say you do want a box or an image to sit somewhere on the page. Instead of writing something like:
.box { Â Â width: 50px; Â Â height: 50px; }
You can instead do something much safer and write something like:
.box { Â Â width: 30%; Â Â height: 30%; }
Now that isnât a 1:1 size ratio, and part of the struggle will be to figure out how to make a percentage dimmensional value sit as precisely as youâd think an explicit pixel size would, but the benefits of taking up a percentage of the screen rather than an exact pixel value is that barring some browser nonsense, it will more or less look exactly the same on every screen. That saves you a LOT of trouble down the line: elements will be less likely to run off the screen/create weird scroll bars, and youâll get less grief from an element taking up both 30% of a TV screen like I use in my daily life to read things, and 30% of a cell phone screen which is much smaller, versus having an element that takes up 20px of precious real estate on a cell screen versus a measly 20px of a TV screen.
This can also be used for stuff like margins and custom line spacing, it just isnât necessarily AS important. Sometimes you donât notice the difference, and sometimes itâs just a little added oomph of consistency that lets you more easily develop on one device for many. Another good tip that I should use but rarely do is to make sure that even though youâre developing on one device, check as many others as possible. Occasionally open up the file on your phone, just to see what everyone using a phone is seeing. I know when youâre using desktop Chrome you can preview the game in mobile (and on specific mobile devices) like this:
Open your game in Chrome (again, this might work for other browsers but Iâm most familiar with Chrome), right click on the screen, and click âinspectâ:
In the upper left corner of the menu that appears, youâll see a little icon that looks like a tablet and a cellphone: go ahead and click on that.
The view of your game will then switch from desktop to mobile! From here you can see what it looks like, I think the default is âresponsiveâ because thatâs just generalized âwhat it looks like when the screen gets smallerâ, but you can also toggle specific devices, or switch from portrait to landscape!
#talkForge#code help#I hope this answers the question !!! I genuinely don't know if it will or not#I honestly haven't consciously developed for mobile#but I do build everything as if you're all sitting a room away from a TV while reading like I am while writing#Anonymous
32 notes
¡
View notes