This is just a cool test


Trying out my code in Lua that will auto format some cool text to make it different colors and stuff

If you have Codea, I can give you the code and tell you how to use it

Hopscotch project JSON reader


first reply


Now it should have a transparent background


Hello @Valgo!:grinning: This is really cool!:grinning: I actually have Codea so if I could actually code this it would be awesome.:slight_smile:


Wait it should work now


You can have the code if you want. I'll also tell you how to use it

Tutorial for anyone who has Codea:

Link to Codea code:

Basically to format the text, you need to use hashtags. So #red would make the text Red.
To change the color of the text, put one of these in front of the text:
To change the size, use these:
To make a new line, use
Once you get the text, put it in the renderText() part of the code (it's at the top)
Then, paste the image copied to the clipboard into the notes app, save it, and upload it!



lol cool



I recently(ish) learned text-colour-changing in HTML. Excited, I rushed to the forum. Didn't work :frowning:


I know .-. I tried it last night, but it didn't work, so I made this



(I wish we could customise colour...)


I know. I went on the discourse test forums where you can try it, and it didn't work there. I guess it's just not a feature of discourse yet

We should make a #BringHTMLColours thing lol

Hopscotch project JSON reader

This is awesome! I think only certain HTML tags are allowed on the forum otherwise people might take advantage of things and mess up the site... (even if it's just the colour scheme)

Ask questions to the Hopscotch Team!

Good point. JavaScript is definitely powerful enough to do that.


And really lovely of you to share the code! Do you think you could quickly go through how it works? :blush: Somehow seeing this makes me feel less lonely on Codea, guess it doesn't have a community for sharing like Hopscotch does. :grin: (Well I suppose it has its forum but it's not the same as a public community for sharing) I am still new to it :blush:


So I have a class that takes in the text and does everything it needs to do to it. First, I have what I call The Parser. It is a function that will read through the text, and if it sees any specific hashtags (the ones above), it will do certain things to the text after it. I keep track of the text in a table. If you accidentally typo a tag, it won't do anything. Then, the class will take that Data table and render it into an image. It will pay attention to text size, text color, and any line breaks you put in. That's basically how that works! (I know, I need to add in more comments into my code :sweat_smile:)

Edit: I can explain it in simpler terms if necessary, or I can explain some terms XD

Electronics Talk!

Thank you that's awesome :blush:

I can see that, in the parse() func, it checks for the # character and spaces, and it looks like it is collecting all the characters in between the # and " " in the token string, and then eventually whatever is in token goes into self.tokens.

And for any other words, it puts the characters in t instead, and it looks like those end up in the table. At the moment I am not quite sure how the render() func works, and how the Tokens table and Data table are used yet, but I'll keep looking. If I've gotten anything confused so far, please feel free to point it out too :slight_smile:

(Hehe, don't worry :) Me, I used to go overboard with comments and comment every line when I was first learning text-based coding. But turns out you can convey the information in other ways like in variable names and function names for example.

Naming is a whole other thing :joy: I can go pretty overboard with that too, with doing long descriptive names, but then I realised I couldn't even read my own code from a glance when I did that :laughing: At the moment I find shortened forms of words easier to look at. Still learning :slight_smile:)

So lovely of you to help everyone by the way! :blush::blush::blush:


Actually, the self.tokens table basically has all of the words that the parser will recognize as something important in it. It has all of the colors in it, and all of the sizes. And new line, too. The self.tokens table never changes.


i do lease tell me please


What do you need?