Author Archive

For setting the keyboard type of input text field in Corona,

Use,
object.inputType = type

the possible type’s includes,

“default” – the default keyboard, supporting general text, numbers and punctuation
“number” – a numeric keypad
“phone” – a keypad for entering phone numbers
“url” – a keyboard for entering website URLs
“email” – a keyboard for entering email addresses

Example :
numericField = native.newTextField( 50, 150, 220, 36, handlerFunction )
numericField.inputType = “number”

Incoming search terms:

  • corona keyboard input

For making an input text field hidden/secure,

local passwordField = native.newTextField( 100, 50, 40, 30, inputListener )
passwordField.isSecure = true

Incoming search terms:

  • corona password text field
  • input text in corona sdk

For setting color of text in text input field,

local field1 = native.newTextField( 50, 100, 100, 35 )
field1.text = “Hello, world!”
field1:setTextColor( 255, 128, 0 )

Creating a numeric text field in Corona SDK

For creating a numeric text field in Corona SDK,

Syntax :

native.newTextField( left, top, width, height [, listener] ) 

Example :

 
numericField = native.newTextField( 50, 150, 220, 36, handlerFunction )
numericField.inputType = "number"

It will create a numeric text field with even handler ‘handlerFunction’

Setting the sound volume in Corona SDK

For setting the sound volume in Corona SDK,

 media.setSoundVolume( 0.5 )

Media sound volume can range between 0-1.

For setting a movieclip object to draggable, use the following code

myAnim:setDrag{ 
  drag=true,
  onPress=pressFunction, 
  onRelease=releaseFunction,
  bounds = { 50, 200, 220, 200 }
}

it will call ‘pressFunction’ on object press and ‘releaseFunction’ on object release and bounds will set the dragging boundary.

For generating a random number between two particular numbers in Corona SDK,

print (math.random (180, 280))

It will print out a random number between 180 and 280

Incoming search terms:

  • continuouslygenerate random number corona
  • generate prime number in corona sdk

For rewinding all the playing audio channels in Corona SDK,

audio.rewind()

For rewinding an audio loaded with audio.loadSound() in Corona SDK, you should use the channel you want to rewind,

audio.rewind( { channel=3 } )

You should use the audioHandle to rewind an audio loaded with audio.loadStream() in Corona SDK,

audio.rewind( BGMusic ) 

‘BGMusic’ is your audio handle

Page 20 of 35« First...10...1819202122...30...Last »
We Can Build Your App for You. Lets Get Started !