CodeHint


Gideros (18 items)

LUA


    application:getDeviceWidth()

Returns the device width in pixels

  Edit
    application:getDeviceHeight()

Returns the device height in pixels

  Edit
    stage:setBackgroundColor(0,0,0)

Sets the background color of the stage

  Edit
    stage:addChild(child)

Add specific child to the stage

  Edit
  Create simple shape
local shape = Shape.new()
shape:setFillStyle(Shape.SOLID, 0xff0000)
shape:beginPath(Shape.NON_ZERO)
shape:moveTo(0,0)
shape:lineTo(x,0)
shape:lineTo(x,y)
shape:lineTo(0,y)
shape:closePath()
shape:endPath()
  Edit
    stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)

Enter Frame listener for function onEnterFrame

  Edit
    stage:addEventListener(Event.ADDED_TO_STAGE, onAddedToStage)

Added to stage listener for function onAddedToStage

  Edit
    stage:addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage)

Removed from stage listener for function onRemovedFromStage

  Edit
    Ball = Core.class(Sprite)

Create new entity class

  Edit
    function Ball:init(x,y)

First class function, something like construct function on Gideros

  Edit
    local container = Sprite.new()

Create groups or layers

  Edit
    local bmp = Bitmap.new(Texture.new('ball.png', true))

Create bitmap from texture

  Edit
    local font = TTFont.new('tahoma.ttf', 50, true)

Create font

  Edit
    application:setOrientation(Application.LANDSCAPE_LEFT)

Set orientation on device

  Edit
    ball:setPosition(x,y)
/* Changes ball's position: */
ball:setPosition(100,100)
  Edit
    ball:setRotation(g)

Changes ball's rotation: <code>ball:setRotation(-90)</code>

  Edit
    local text - Textfield.new(font, "exemplo")

Texfield example

  Edit
    Timer.delayedCall(millisecs, callback)

Calls a function after some secs

  Edit