So I want to make a game where you guess the name of a Snap! user via their forum profile picture. Of course I’ll put mine in, but I would like to know who actually would like to have their account for this. I’m not going to scrap the forum, thus this post. Simply put your username below (you can edit this post) if you would like to be added: (not doing replies as that will be hard to comb through)
The game is up! Currently it does not prevent duplicates in the options, as I currently do not have enough people for it - but it still works. Hope you enjoy! Link was added to the original post.
I found a bug, specifically for usernames with underscores:
It tries formatting the text inside “_…_” and in cases like this it continues formatting until the text ends.
All of the PFPs that fail the conversion are SVGs, which makes sense. One way I can see doing this is having the conversion script not run on startup, and instead a script I run whenver the list changes which will use JS. In that, I simply create a element in with the correct width/height, set the src to the PFP url, draw that onto a 144x144 canvas, and finally create a Costume from that. This will prevent the user having to load all the PFPs from the servers (might make Snap! developers perfectly happy with it), and make it automatic. I will work on this when I have time.
I don’t really think I could fix this without skipping the write text to stage library in total, because I’ve tried escaping it before passing it in and it didn’t work. Will switch to centered Text Costumes for this soon
I’ve just now changed it to only load the costumes the first time the flag is clicked/when the space key is pressed.
You think that this project might bog down the forum servers? I would think it would be just as bad (fine) as everybody who uses the project loading a single page on the forums. Maybe I’m wrong though.
True. Eh, Im still going to go with my approach because the only way to import every image as a perfect 144x144 scaled image is probably my approach, which requires JS to work. And no one wants to enable JS for a silly PFP guessing project!
I tried a bunch of stuff but eventually couldn’t get the SVGs to scale correctly. So, for now, everything will be manual. I might try again when I get home and actually have a computer that can inspect a web page (I’m on my school chromebook at the moment!)
You can switch to using the writing and formatting library to still use a font. It also has a block to get the width of text before writing it to the stage, so you can align the text based off of that instead of creating a text costume.