qc.GameObjectFactory.clone

Prototype

Parameters

Parameter Type Description
node qc.Node or qc.Prefab The object to clone.
parent qc.Node The parent node.

Description

Clones the object original and returns the clone. This function makes a copy of an object in a similar way to the Duplicate command in the editor.

Example

    game.assets.load('test_prefab', 'Assets/prefabs/bullet.bin', function(asset) {
        // clone this asset
        var o = game.add.clone(asset);
    })