corona

UTF-8 incorrectly displayed in Lua/ Corona

人走茶凉 提交于 2019-12-12 09:14:01
问题 In Lua, for an iPad Corona project, I'm requesting a UTF-8 server text file (containing Chinese characters) using network.request, but the result when displayed in the console or in the app shows as "garbage". Google Chrome, for instance, displays the same UTF-8 page fine, as I'm setting the http header when the server sends this (using PHP) to 'Content-Type: text/plain; charset=utf-8' (and there's no BOM, byte order mark either). The "garbage" I'm seeing in Lua looks similar to when I "force

how to create .ipa file from Corona SDK

╄→尐↘猪︶ㄣ 提交于 2019-12-12 04:53:19
问题 Please tell me how to create .ipa file instead of .app file in Corona SDK? and how to submit Corona Application in Appstore? 回答1: I got a solution for creating . ipa file while creating build file from Corona . Steps are given below - Step 1 - Create a .app file Step 2 - Create a folder with name "Payload" Step 3 - Compress the "Payload" folder and rename it to your file name.ipa from "Payload.zip". 回答2: You need to go Corona Simulator -> File -> Build ->iOS If you are going to get the build

How to make custom buttons in corona, Lua

狂风中的少年 提交于 2019-12-12 04:18:15
问题 I'm trying to make a mobile application with a screen that looks like this: I'm making this using Corona, it's written in the Lua language It's a scrollable list of buttons, I somewhat understand the scroll aspect. What I'm having problems now is making a button that can have more than one line of text and also an image. I've literally been searching for hour but haven't found anything (I'm probably bad at finding things). I think I'd have to create a custom button but I have no idea how to

Collision of a drawed line and objects(Corona SDK)

时光毁灭记忆、已成空白 提交于 2019-12-12 04:08:59
问题 For example i have a line that i can draw with a finger and i have a rectangle. i want my line to end drawing up when it collisions with the rectangle. How can i do it? For ex my function of a line: local line = function() if(e.phase == "began") then --code for line elseif(e.phase == "moved") then --code for line to draw elseif(e.phase == "ended") then --code for line to stop draw end i guess that i can do that with collision smith like this local function onCollision( event ) if ( event

Can't login to Parse with Facebook account

早过忘川 提交于 2019-12-12 03:39:41
问题 I'm developing in corona. I'm login(using develephant.net mod_parse.lua) into Parse.com with my Facebook account, which did work just fine before. But now I keep getting this error from Parse: I/Corona (14497): Parse Code: 251 I/Corona (14497): Error: The supplied Facebook session token is expired or invalid. I/Corona (14497): im logged in I have checked with Facebook on https://developers.facebook.com/tools/debug/ and get this feedback: Issued 1392307353 (22 hours ago) Expires 1397491353 (in

touchEvent for Grid(2D-Array)of Sprites using Corona sdk

旧巷老猫 提交于 2019-12-12 00:31:17
问题 I have a grid of animated sprites in an 2D-Array, but when put the eventListener for a sprite object it is showing the following error "Director ERROR: Failed to load module 'game' - Please check if the file exists and it is correct.", when I remove the code for touch the next scene pops up with animated fireballs in a grid(which is nice), but I wanted to implement touchevents for the individual sprites in the grid. Please help me. Thanks Here Is the Code: module(..., package.seeall) function

Modify the time value of a transition

筅森魡賤 提交于 2019-12-11 22:14:51
问题 How can i change the time value of a transition while is executing? For example I have the object "cesta" moving from the left to the right with a time of 4000ms then for some reason I want to change the time value to move it faster. function createCesta() ... transition.to(cesta, {time = 4000, x = screenW + 110}) ... end function touchScreen(event) if event.phase == "began" then end if event.phase == "ended" then --change the time value from here "from 4000 to 2000" end end 回答1: The docs at

Lua: how do I add display objects required from external functions to display groups?

匆匆过客 提交于 2019-12-11 20:48:14
问题 In a storyboard scene, I require a bunch of display objects from external functions. When I attempt to add these to the scene's display group, I get the error "table expected." function scene:createScene(event) local group=self.view local shieldDisplay = shieldDisplay.new() group:insert(shieldDisplay) end The external function looks like this: function shieldDisplay.new() shieldDisp = display.newText("Shield: "..tostring(Cshield), 1165, 20, native.systemFont, 30) shieldDisp:setTextColor(9,205

Lua / Corona String Text

ε祈祈猫儿з 提交于 2019-12-11 19:13:05
问题 what would be the command to fill a text with a few variables. ex> "Day: %1 is the %2th day in the %3th week" where %1 could be 5 , %2 could be 10 and %3 12 in another text it could be: ex> "in the %3 week the %2th day is your Day: %1" while always the %1 get variable 1, %2 variable 2 and %3 variable 3 i hope i made it understandable :) its about my Language File and about grammer the variables would sit sometimes at different possitions. thanks chris 回答1: Lua's built-in "fill a text with a

Corona - create regular display objects from sprite sheets?

戏子无情 提交于 2019-12-11 18:18:12
问题 This is normal way of displaying an image: local img = display.newImage("image.png"); But doesn't it save memory to put all your images in one large image and export from Zwoptex? There is documentation for creating animated sprites from sprite sheets, but what about just pulling a single image from a sprite sheet? local zwoptexData = require "sheet1" local data = zwoptexData.getSpriteSheetData() //then what? 回答1: The commands to make a static image from a tile sheet look like this: local