Codea Runtime Library

Quick Question. I fired up my project under the new release of the Runtime but it appears that it isn’t performing the http.get functions in the simulator.

Is this just an Xcode simulator thing or did I screw something up in my project as opposed to my iPad project?

Nevermind… It decided to just take a bit of time to work :stuck_out_tongue:

@Inviso: Yes, only with the new iPad. Since v1.4 i’ve the same issue inside Codea, not only with the runtime library.

New problem. After transferring my app over to Xcode, I’ve noticed that my app appears to be running a bit slower and one of the touch functions is no longer working. There is no difference between the xCode code and the Codea project code. Any idea on these two issues?

I should mention the touch function that is not working is one that should bring up the keyboard.

@Deamos Can you post the smallest code that replicates the problem?

It’s a fairly large project so I’ll try to post the parts handling the keyboard.

function handleSearchBarButton(touch)

if touch.x>=285 and touch.x < 485 and touch.state == BEGAN then
    if touch.y >= HEIGHT*.95 and touch.y <= HEIGHT*.95+35 then
        showKeyboard()
        return
    end
end

end

function drawBoxes()

--Zoom In/Zoom Out Buttons
pushStyle()
sprite("Eve Live View:44_32_44",WIDTH-76+36/2,HEIGHT*.95+35/2)
sprite("Eve Live View:44_32_43",WIDTH-38+36/2,HEIGHT*.95+35/2)
popStyle()
popStyle()

pushStyle()
if mapStarLinesToggle == true then
    tint(0, 255, 26, 255)
end
sprite("Eve Live View:44_32_58",26,HEIGHT*.95+16)
popStyle()

pushStyle()
strokeWidth(1)
stroke(104, 104, 104, 130)
fill(57, 59, 58, 194)
rect(285,HEIGHT*.95,200,35)
popStyle()
pushStyle()
fill(255, 255, 255, 255)
font("Courier-Bold")
fontSize(18)
textMode(CORNER)
textAlign(RIGHT)
text(kbBuffer,288,HEIGHT*.95+9)
popStyle()

pushStyle()
strokeWidth(1)
stroke(255, 255, 255, 255)
fill(27, 73, 145, 255)
rect(485,HEIGHT*.95,35,35)
fontSize(18)
fill(255, 255, 255, 255)
sprite("Eve Live View:77_32_49",503,HEIGHT*.95+35/2)
popStyle()

pushStyle()
strokeWidth(2)
stroke(255, 255, 255, 255)
fill(80, 74, 70, 255)
--rect(WIDTH-38,HEIGHT-100,35,35)
fill(255, 255, 255, 255)
sprite("Eve Live View:77_32_30",WIDTH-21,HEIGHT-100+35/2,28,28)
popStyle()

pushStyle()
strokeWidth(2)
stroke(255, 255, 255, 255)
fill(80, 74, 70, 255)
if infoBar == false then
    tint(212, 209, 209, 255)
else
    tint(27, 255, 0, 255)
end
sprite("Eve Live View:44_32_24",WIDTH-23,HEIGHT-140,28,28)
popStyle()

end

Those two functions draw/display the text and handle at least opening the keyboard for the input.

If that isn’t enough to replicate, I’ve posted the source in its entirety at https://github.com/deamos/Codea-Eve-Live-Viewer-for-iPad.

Other than the noticeable slowdown and the opening of keyboard issue, all other touch functions are working perfectly. I don’t know why this is happen as everything is working flawlessly from within Codea.

Any idea yet, @Dylan, on why its not recognizing the showkeyboard()?

@Deamos I think showKeyboard() is broken in the Codea Runtime Library. You’ve found a bug. We don’t have a hidden text field to focus on for the keyboard in the runtime library — an oversight. I’ll have to add it.

Ahh cool. +1 bug found for me. Thanks @Simeon! I was tearing apart my code thinking it was a problem on my end.

Edit: Almost forgot. Is there any reason why there would be around a 25% slowdown of a project in the transfer to XCode?

@Deamos perhaps you are running in Debug mode? When you do a final archive of your app it will be in release mode. Codea runs in release mode so it will generally be faster than a default Xcode build.

Ahh, now that would probably explain it. Thanks again, @Simeon. I’ll try it out again when the Runtime gets updated.

These are the reasons I prefer Codea over xCode and ObjC. Much simpler and allows me to focus on my idea, instead of dealing with the pits of iOS development.

Good job with Codea Runtime Library. I did not expect to see it now. I thought it will take more time to make a converter Codea to xCode. But, here is a little problem. What should I do if my game needs music or sounds?

Simeon, please answer me this question: What should I do if my game needs music and sounds?

You can use sound() to generate sounds. Cargo-Bot also uses sound() to make music as well, using @Fred’s ABC Music player library.

Alternatively you can modify the runtime to expose music playing functions. I believe @frosty did this or his game.

On the moment is fine with ABC Music player library. Thanks Simeon for this tip. I think that I have to read the entire board, may be more interesting things here.

I think @frosty wanted to share his changes to the code to achieve background music support… But it seems he didn’t quite got to it yet… But I’m sure he will as soon as he can :slight_smile:

I’ve just gotten my hands on a Mac, so can now potentially make use of the runtime library. I’m not all that sure what I need to do and what I can do. I have Xcode installed, and I chose to include the iOS suite. So then I can clone the git repository and presumably compile stuff (haven’t tried yet). At some point I clicked some link which started the process of registering me as an “Apple Developer”, but I aborted before finishing the form (partly because the telephone number field insisted on having an area code).

My basic question is: how much can I do before I have to pay someone something?

That is, when registering as an Apple Developer then it didn’t look like I was going to have to pay any money, but I presume that to get to the point of selling something on the App store then one has to do so. Is there some point before that where I can actually get something onto my iPad? Even just so that I can write something for my kids so that they don’t have to keep clicking on Codea, selecting the program, and running it (with all the attendant dangers of deleting all my code).

Pointing me to documentation would be fine.

@Andrew_Stacey - Without a developer account, the only things you can do is build an app in Xcode and test it in the iPhone simulator. You can not do an Ad Hoc (on the device) build or publish it to the app store. There are hidden ways to get your app on your iPad if your jailbroken, but that’s very undocumented due to apple the bully. Hope that helps! Maybe I answered the wrong question.

I just ran across this nugget for anyone who does not have a Mac and still wants to develop for iOS. You still need a developer account and I have not tried it yet, but it sounds very promising.

http://trigger.io/cross-platform-application-development-blog/2012/06/13/new-features-test-iphone-ipad-apps-on-windows-and-linux-embed-media-players-and-widgets-updated-toolkit/