/**
 * Created by rockyl on 2020-01-21.
 */

export function getTexture(uuid) {
	return engine.Texture.from(getAssetByUUID(uuid).uuid);
}

export function getTextureByName(name) {
	return getTexture(engine.getAssetByName(name).uuid);
}

export function playSound(name) {
	engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
}
export function getStage(){
	return engine.gameStage.stage;
}

export function createSvga(name) {
	let inst = new svga.Svga();
	inst.source = engine.getAssetByName(name).uuid;
	// let anchor = props[(anchorName)];
	// if (anchor) {
	// 	inst.x = -anchor.x;
	// 	inst.y = -anchor.y;

	// 	inst.anchorX = anchor.x;
	// 	inst.anchorY = anchor.y;
	// }
	return inst;
}
