Back

AddGraphic

Hello World

Adds a basic shape object to the game.

gfx.AddGraphic( obj, x, y, w, h, angle, alpha )

See Also: CreateCircle, CreateEllipse, CreateRectangle, CreatePolygon

Example - Basic

cfg.Game;

function OnLoad()
{
    rect = gfx.CreateRectangle( 0.8, 0.1, 0xff, 3, 0x5555ff, 1, "floor" );
}

function OnReady()
{
    gfx.AddGraphic( rect, .1, 0.4 );
    gfx.Play();
}
    Copy     Copy All       Run      
object
number: fraction (0..1)
number: angle in radient (0..2*π)