corona

How to start new activity in corona?

天大地大妈咪最大 提交于 2020-01-06 20:04:27
问题 I am new on Corona and worked with android sdk on Eclipse but i don't know how to pass from one activity to another in this one? What do you we use for this on Corona? 回答1: You do not have control over activities of your app when using Corona SDK. What you need is the StoryBoard API which helps you to manage difference scenes. Here are a few links regarding storyboard. http://www.coronalabs.com/blog/2011/11/14/introducing-the-storyboard-api/ http://www.coronalabs.com/blog/2012/03/27

How to assign a function in Lua for a randomly generated numbers

北城余情 提交于 2020-01-06 14:19:38
问题 First I stored 10 images in array(i.e., table) from 1-10 as key values and I create a random number using math.random function between 0-9., and I need to access the image that is stored in array by the value created by random function, and assign the touch function for the particular image file alone., Ex: If the random function creates number as "5" I need to move the image 5.png that is stored in array index as 5 .,other images except 5.png should not use touch function., (i.e., they are

How to assign a function in Lua for a randomly generated numbers

半腔热情 提交于 2020-01-06 14:19:27
问题 First I stored 10 images in array(i.e., table) from 1-10 as key values and I create a random number using math.random function between 0-9., and I need to access the image that is stored in array by the value created by random function, and assign the touch function for the particular image file alone., Ex: If the random function creates number as "5" I need to move the image 5.png that is stored in array index as 5 .,other images except 5.png should not use touch function., (i.e., they are

Lua : delete table which contains graphic objects

一笑奈何 提交于 2020-01-06 12:36:11
问题 In my game I've a gamefield object (table) which contains all other graphic (display.newRect) and non graphic objects. Now I'm looking for good way to restart game, is there way to remove only gamefield object (table) and cause that inserted objects will be removed, graphic and non graphic together? Or I should remove graphic objects manually? Thank you. 回答1: Put all your graphical objects in a display group (display.newGroup). When you remove the display group, it will remove all the images,

Corona: unable to submit value into sqlite database

回眸只為那壹抹淺笑 提交于 2020-01-06 07:13:45
问题 I am using corona to develop my app. What am i trying to achieve here is to have 10 textbox for users to key in the value. After keying the value the data will store into sqlite once the user press submit. The code below have 10 loops and it is for the textbox. i have no problem displaying the textbox but my problem here is i am unable to store the value into sqlite database. Once i press submit i have no error at all but it just simply wont update the database. local amt_padding = 4800

measure elapsed time of image loading in Corona SDK

*爱你&永不变心* 提交于 2020-01-06 07:01:44
问题 I'm trying to benchmark the loading of large images in Corona SDK. local startTime = system.getTimer() local myImage = display.newImageRect( "someImage.jpg", 1024, 768 ) local endTime = system.getTimer() print( endTime - startTime ) -- prints 8.4319999999998 This returns values of around 8 ms. I know it takes longer to load an display an image because if it really took 8 ms I wouldn't notice the delay, but I do notice it. I'd say it takes about 300 ms. Also the FPS drop drastically when

Lime for Corona SDK - Camera focus on layer

♀尐吖头ヾ 提交于 2020-01-06 03:41:26
问题 Is there any solution for setting up focus on layer in Lime framework. I would like to use this on game called "keepie uppie" with scrolling background (camera). When you hit the ball the entire frame together with a ball and tennis racket moves up. The figure below shows how I would like to make it work: 回答1: Check out the Camera from Lime. It basically creates a display group and moves everything relative to that. You can focus the camera on one of your game objects. The github repo

Button removal in Corona

谁说胖子不能爱 提交于 2020-01-05 08:15:18
问题 I'm trying to nest pages and such with button presses in an app I am working on. However, as a widget, it carries over and such and must be removed using display.remove() or :removeSelf. I'm trying to make these buttons delete/remove themselves from the view as they are pressed and the next page is loaded, but when I do this it either does not work, or throws a runtime error. Suggestions? Edit: This is what I am currently using, although it leaves the button gone permanently after click. `

Button removal in Corona

纵然是瞬间 提交于 2020-01-05 08:14:54
问题 I'm trying to nest pages and such with button presses in an app I am working on. However, as a widget, it carries over and such and must be removed using display.remove() or :removeSelf. I'm trying to make these buttons delete/remove themselves from the view as they are pressed and the next page is loaded, but when I do this it either does not work, or throws a runtime error. Suggestions? Edit: This is what I am currently using, although it leaves the button gone permanently after click. `

How to slide pages in Corona SDK

天涯浪子 提交于 2020-01-05 07:45:09
问题 I'm using CORONA SDK. I have a set of pages and I would like to slide between them using swipe left -right. The page contains a set of controls (mostly text) What is the best way to do this slide/swipe in Corona? 回答1: Using touch events. When the phase of event is "began" (The user just touched the screen), allow the three pages to move (the actual, the forwards and the backwards). if event.phase == "began" then page1.canMove = true page2.canMove = true page3.canMove = true initial = {}