Questions tagged [codea]

Codea is a coding app for iPad based on the Lua programming language. It is similar to Processing in API design and is geared towards creating graphics and simulations.

Overview

Codea is a coding environment for iPad created by Two Lives Left. It is designed for programming games and simulations, and is inspired by the Processing API. The application is designed to provide users with immediate feedback on their projects by encouraging them to quickly view their creations. Codea exposes multitouch, accelerometer, sound, 2D and 3D rendering, and more.

Codea's editor is designed for touch-based programming. Certain function arguments, such as colors, images and fonts, can be touched and selected directly within the editor. Sounds can be built directly in the code editor as well, by tapping on the sound function to bring up the sound designer.

Uses

Codea is primarily designed for rapid prototyping of visual ideas. It includes a special parameter function that creates sliders in the user's program for adjusting global variables. This is to encourage experimentation with parameters.

One can also use Codea to build native iOS applications. Codea projects can be compiled as stand-alone applications using Xcode and the Codea Runtime Library. (The Codea Runtime Library is an open source project released by Two Lives Left.)

The first native application produced with Codea was Cargo-Bot.

13 questions
9
votes
1 answer

Lua getters and setters

I'm working with the Codea iPad app and learning Lua. Codea uses Class.lua for classes. What I'm trying to achieve is a way to specify functions for a variables get and set methods. Currently, a variable say "x" can be accessed liked this:…
Spencer
  • 4,018
  • 10
  • 33
  • 43
4
votes
1 answer

A paperjs-equivalent for python (specifically, Pythonista for iOS)?

I've taken to creative coding on my iPad and iPhone using Codea, Procoding, and Pythonista. I really love the paper.js Javascript library, and I'm wondering how I might have the functionality that I find in paper.js when writing in…
nmelehan
  • 51
  • 4
3
votes
1 answer

Are there problems with this design pattern: Main --> Graphics <--> Data?

I'm posting this in Lua and Codea, since that's what I'm using, but it's a pretty general question I think. I'm considering an overall design pattern for displaying graphics, and I'd like to know if there are problems with it. Here's the design…
Le Mot Juiced
  • 3,761
  • 1
  • 26
  • 46
3
votes
1 answer

Is there an App like "Codea", but for MonoTouch?

Is there an App like "Codea" ( http://twolivesleft.com/Codea/ ), but for MonoTouch? I need a way to write and compile my MonoTouch code directly on the iPad. I thought about writing my own realtime c# MonoTouch compiler for iPad, but I fear that…
Emanuele Sabetta
  • 1,571
  • 12
  • 34
2
votes
1 answer

GitHub OAuth in lua

I am working on a library in LUA for an ipad app called Codea. I'm trying to figure out to use OAuth for GitHub Gists. Only part that i can not figure out is how to get an Auth token via code. I used curl in terminal to get myself a token but this…
briarfox
  • 525
  • 5
  • 13
1
vote
0 answers

Any way to access an instance variable from inside a simple function in Lua?

How to create a "pseudo-instance" variable or access an instance variable from a simple function defined inside a class in Lua ? I did'nt find any way to access an instance variable from a simple function inside a class. I can only access it if…
Lostania
  • 145
  • 8
1
vote
2 answers

Codea vertices draw full screen

So I've written a shader that I want to draw across the whole screen of my Codea app, although I have supplied 4 varying vec2's as the vertices table it only draws a triangle. Why is this happening? Here's my code board = mesh() board.shader =…
Dave Mackintosh
  • 2,738
  • 2
  • 31
  • 40
1
vote
3 answers

How can I build an IOS app on IOS?

I've made an app with Codea and exported to an XCode project. Is there way to build it on IOS (or windows)?
Rule
  • 105
  • 1
  • 10
1
vote
1 answer

Codea / Lua pong game CPU opponent inaccuracy

I have recently designed and programmed a pong game in lua (codea); where you can play in multiplayer and in singleplayer where you play against the CPU. My problem is, I can have the CPU to play perfectly bat_cpu = ball_y but that would not make…
Laurent
  • 1,292
  • 4
  • 23
  • 47
1
vote
3 answers

Lua table read and match efficient

My problem is simple, i used to do this in order to check if any of my lines (see photo) bump into any other line (or trail of any other line). But the way i do this now is by doing a lot of if statements, which is not good. So here is the code i…
Laurent
  • 1,292
  • 4
  • 23
  • 47
0
votes
1 answer

How can I create a button in Codea

So I am new to lua and I am curious how to make buttons. P.S. I work with Codea engine so the fn tag doesn’t work. I looked everywhere but I can’t find a good tutorial.
0
votes
1 answer

touched function not working

I am trying to create a simple app in codea on my ipad that displays an image and lets the user move it.I am able to display the image properly,but am not able to move it with my finger. Here is my code for it. function touched(touch) local…
0
votes
2 answers

Can inheritance be used with Codea?

Is it possible to use inheritance with Codea? While I am fairly new to Lua, but from some quick Googling, it looks like the methods to do inheritance and polymorphism are a bit "involved". Is there any technique that can be used safely with Codea's…
Joseph Weissman
  • 5,697
  • 5
  • 46
  • 75