Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
//ロゴを合成する処理
function genImage (imageIni){
//合成画像の設定
//回転
img.rotation = imageIni.rotation;
//回転の中心は、画像の中央
img.regX = img.getBounds().width / 2;
img.regY = img.getBounds().height / 2;
//上下は10ピクセルごと移動
// 中央点からの補正
img.x = imageIni.xPos * 10 + img.getBounds().width / 2 * (1 + imageIni.Scale / 10);
img.y = imageIni.yPos * 10 + img.getBounds().height / 2 * (1 + imageIni.Scale / 10);
//拡縮は10%ずつ
img.scaleX = img.scaleX * (1 + imageIni.Scale / 10);
img.scaleY = img.scaleY * (1 + imageIni.Scale / 10);
//ステージ生成
stage.addChild(img2);
stage.addChild(img);
//ステージ反映
stage.update();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment