Lua-Users.Org Tutorials: Output?

Well, everyone responded so helpfully to my last question that I am emboldened to ask another!

I’m trying to follow along with the lua-users tutorials, and I’m encountering what look like various ways to put text or values on the screen, but which do NOT work with Codea. Am I right about this? Examples include the = sign at the command prompt (which doesn’t exist in Codea, I’m guessing) and something called io.stdout:write.

So far, the only way I know to display something on the screen (like a string or a number or some text) is to use the print command. Is that the only way in Codea? Are there other commands I should know about?

Apologies if my ignorance on this is beyond the pale! And once again, thanks for any help.

yes, you can do something like this:

function draw()
    fontSize(40)
    fill(255,0,0,255)
    text("Hello World", 300,300)
end

This is a common problem that is encountered by new Codea users. I believe it’s very common that I think this should be explained in the FAQ. It is understandable since Codea is using Lua as its language.

However, please keep in mind that Codea is MUCH MORE than an editor with Lua interpreter. Codea comes with its own language features (class, draw loop, touch loop, etc), coding framework (drawing API, sensory API, touch API, etc), coding resources and tools (sprite pack, color picker, etc), and many more which aren’t available in standard and common Lua language and interpreter. In fact, some common and standard Lua language features are NOT available in Codea, for some reasons.

So, while knowing how to code with standard Lua is helpful, it’s NOT yet enough. You still have to also learn what other things that come with Codea beside Lua itself. You could find about them in Codea’s documentation (including the wiki) and -of course- in this forum as well.

Good luck and happy coding. :slight_smile:

@raferguzman FYI as an adjunct to the tutorials at lua-users.org I find the tutorials/tips at http://www.troubleshooters.com/codecorn/lua/index.htm also helpful.

Thanks again for the feedback, all. To Blanchot, thanks for this link! I’ll bookmark it and check it out asap.