Corona Archives

Incoming search terms:

  • corona saving to sql

find() uses a pattern syntax. A dot represents “any character.” This will match the first character of any string you search. In order to search for a literal dot, you need to doo this:

Saving Score to a Text File in Corona

In Corona, it is possible to save scores to an external text file. This can be accomplished using the following lines of code :

This code snippet will save the score value in the scoreStr variable to the the file score.txt.

How to renames a file or directory : corona SDK

The following lines of code will help you to renames a file or directory in a corona SDK project:

– if there is no such file, you will get the following the message in the console.

There are types of rendering modes in corona SDK physics engine. The rendering modes are very much useful for the developers. Here I’ll show you how to choose any of these 3 rendering modes.

Code:

physics.setDrawMode( "debug" )    -- It will show collision engine outlines only.
physics.setDrawMode( "hybrid" )   -- It overlays collision outlines on normal Corona objects.
physics.setDrawMode( "normal" )  -- It is the default Corona renderer, with no collision outlines.

(Note: You can change the mode at any time, if you want)

as simple as that… :)

object:stopAtFrame( )

Jumps the animation to the specified frame number or frame label specified by the setLabels()function.

Syntax:

object:stopAtFrame( frame )

eg:

myAnim:stopAtFrame(4)

display.capture()

This function is the same as display.save(), but it returns a display object instead of saving to a file by default. You can optionally save the capture to the device’s photo library.

syntax :

Example :

physics.setGravity()

Sets the x,y components of the global gravity vector, in units of m/s2. The default is ( 0, 9.8 ) to simulate standard Earth gravity, pointing downwards on the y-axis.

syntax

gx
Sets the global gravity vector in X direction, in units of m/s2.

gy
Sets the global gravity vector in Y direction, in units of m/s2.

Widget in corona

Using Widget Themes

The mechanism used for ‘theming’ widgets is now completely different, and much more flexible. Themes are now external lua modules that you include in your project folder, which will have tables for the corresponding widgets. The individual widget tables in your theme file will have the parameters, and references to any graphics assets that are needed.

When a widget is instantiated, it first checks to see if there is a corresponding table in your theme file, with corresponding parameters. For parameters that aren’t found in your theme file, the default values are used. You can override any theme parameters by setting your own parameters when you create a widget.

Please use the official themes as a reference for creating your own themes. Download links for the current “official” themes are below:

To set a theme, use the widget.setTheme()

media.newRecording()

Description:

Create object for audio recording.

Syntax:

recording = media.newRecording( [path] )

Example:

 

Page 1 of 4412345...102030...Last »