/**
 * 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 createSvga(name, anchorName?) {
	let inst = new svga.Svga();
	inst.source = 'asset://' + engine.getAssetByName(name).uuid;
	return inst;
}

export function getIndexFromRC(row,col,maxCol){
	let index;
	index = row * maxCol + col ;
	return index
}




export function getRandomArray(array){
	array.sort(function() {
		return .5 - Math.random();
	});
}