People say to draw do this coding… variablename:draw(). But nothing shows up between the () do I have to put the image coding in between this () if you know what I mean please help
Sorry to confuse you. This is much more complicated coding stuff. Let me reexplain myself:
- Create a class.
- Inside you will see a className:init() (get rid of the x inside the parenthesis), className:draw(), and className:touch().
- Imaging this as its own program. It has a draw loop, initial setup loop, and a touched loop, but they have to manually be called.
- If you want a lot of these classes, set a variable to them, therefore duplicating them. So if you say
variablename = className:init()you create a duplicate of the class. Then you can tell the class duplicate to draw like this:
- You don’t need to pass in functions to these classes, but it’s best if you do.
- To draw an image, it’s as simple as saying
sprite(spritename). Tap on the blue part to choose from the built in sprite packs. In 1.4, we’re getting sprite pack management, so we’ll get custom images without hacking.
Hope that helps! That might be more info than needed or possibly too complicated with beginners. If the link wasn’t broken, I’d send you to the classes tutorial on Wiki.
Look at the example projects - it should make more sense with working code.
If i have a photo in my iPad,is it possible draw it in a program?
Just wait for 1.4… Something big awaits us all… There is a custom sprite pack hack you can use for now… If you want more info, LMK.
In 1.4 beta, you can simply import photos from your photo roll to a spritepack. You can also cut/paste them in, say from Safari. I don’t know when Apple will approve it, or if it’s even been submitted yet, but this is coming.