corona

How to slide pages in Corona SDK

笑着哭i 提交于 2020-01-05 07:45:08
问题 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 = {}

How do I detect a TouchOut event in Corona SDK?

佐手、 提交于 2020-01-04 11:39:53
问题 I have a joystick graphic placed in the corner of the screen in my Corona game. When the user touches the joystick and drags it from side-to-side, it moves the character. However, if the user drags from the middle of the joystick all the way off to the side , then removes his/her finger, the character keeps on moving. I'd like the character to stop on touch-up, even if the touch up is no longer on the joystick graphic. The joystick image subscribes to the "touch" listener with control

Drag physic object in corona sdk

白昼怎懂夜的黑 提交于 2020-01-02 06:11:13
问题 I'm try to drag a dynamic body with gravity = 0,0 in my scene, I have a square with body type dynamic, and an image with body type static, but when drag the square over the image this have a little force but can exceed the image and pass to the other side like the images: This is my code to drag the square: local function dragBody( event ) local body = event.target local phase = event.phase local stage = display.getCurrentStage() if "began" == phase then stage:setFocus( body, event.id ) body

corona textbox loop into database

醉酒当歌 提交于 2019-12-31 05:34:14
问题 I am new to Corona and I have a set of 10 question and the input is in the range from 0-8. I have code it such that my numeric textbox will loop for i times (i = number of question in array). My question is how do I insert these value that is being keyed in into the database that i have created? Do i need to assign these individual question with a variable? local madrs = display.newGroup() local function textListener( event ) if ( event.phase == "began" ) then elseif ( event.phase == "ended"

Why length is different in Lua

不想你离开。 提交于 2019-12-31 01:55:32
问题 I'm learning Lua for corona sdk and I have these local type1 = {nil, "(", nil, "x" ,nil , ")" ; n=6} local type2 = {"(",nil, "x",nil, ")",nil ; n=6} print(#type1) --prints 6 print(#type2) --prints 3 why the second one is not 6 too?? 回答1: The # operator doesn't work on every table, it works only on a sequence, that is, the set of its positive numeric keys is equal to {1..n} for some integer n . In that case, n is its length. For instance, local t = {"hello", 42, true} is a sequence. But both

Have an error of project by corona sdk

安稳与你 提交于 2019-12-25 19:46:55
问题 I hava a project from my friends, When I run the project in the Eclipse ,will have an error printed in the LogCat Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/ansca/corona/JavaToNativeShim; Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lcom/ansca/corona/CoronaEnvironment; threadid=1: thread exiting with uncaught exception (group=0x41b2f498) FATAL EXCEPTION: main java.lang.ExceptionInInitializerError at com.uangel.corona

Loadsave module - Corona SDK

主宰稳场 提交于 2019-12-25 14:21:29
问题 I am using Rob Miracle's loadsave module for my Corona SDK game I have this little Enquiry on it If I save a json table on mydata.lua M={} M.highScore = 0 M.levels=1 loadsave.saveTable(M,"settings.json") return M Now if in the game.lua...I do this.... function gameOver If gamewin == false then mydata.level = mydata.level + 1 gamewin = true loadsave.saveTable(mydata,"settings.json") end Now if I do this will the loadsave module overwrite the whole json file and hence remove the high score

Using a table in Lua to display text isn't working?

≡放荡痞女 提交于 2019-12-25 09:08:55
问题 I'm using Corona SDK, Sublime Text 3, and Lua. My goal in this particular program is to make a visual novel app that changes when the player clicks on the text displayed at the bottom of the screen to progress to the next text entry, therefore continuing the story. I set up a bunch of code for logo, title screen, and other things, that works perfectly. What I'm currently trying to do within the visual novel scene is to use a table to draw the text from by change the .TEXT property to select a

How to check cpu usage of my application?

给你一囗甜甜゛ 提交于 2019-12-25 07:06:17
问题 How can I check cpu usage of my application with Corona SDK? the only thing i found on google is how to check memory usage collectgarbage() print( "MemUsage: " .. collectgarbage("count") ) local textMem = system.getInfo( "textureMemoryUsed" ) / 1000000 print( "TexMem: " .. textMem ) 回答1: Sorry, there is currently no way to check the cpu usage of your application in Corona SDK. 来源: https://stackoverflow.com/questions/17632091/how-to-check-cpu-usage-of-my-application

What sizes of images do I need for background and sprites in corona to support android/iphone

一曲冷凌霜 提交于 2019-12-25 06:28:03
问题 I like that corona compiles to multiple environments, but I want to know what size sprites, and images do I need. I mean I don't have time to create separate images for every conceivable device size. I know corona supports some auto scaling of images. So for example if I have a 64x64 sprite is that all I need? or do I need new image sizes for every scenario? I am looking for 80% coverage not perfect for every device. 回答1: I'm doing it in a different way. I think this may help you. As my