Skip to content

Instantly share code, notes, and snippets.

@gelehrtecrest
Created October 6, 2017 05:55
Show Gist options
  • Save gelehrtecrest/8e78080dcf714c6f70ad89197a6782a1 to your computer and use it in GitHub Desktop.
Save gelehrtecrest/8e78080dcf714c6f70ad89197a6782a1 to your computer and use it in GitHub Desktop.
//ロゴを合成する処理
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