Back

AddGraphic

JS Py
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();
}
# cfg.Game

def OnLoad():
    global rect
    rect = gfx.CreateRectangle(0.8, 0.1, 0xff, 3, 0x5555ff, 1, "floor")

def OnReady():
    gfx.AddGraphic(rect, .1, 0.4)
    gfx.Play()
    Copy     Copy All       Run      
Object
Number: fraction (0..1)
Number: angle in radient (0..2*π)