function preload (){
this.load.atlas('fronts', 'img/fronts2.png', 'js/fronts2.json');
}
createで表示
function create (){
var scene = this;
var frames = scene.textures.get('fronts').getFrameNames();
for(var s=1;s<=4;s++){
for(var c=1;c<=13;c++){
var x = c * 75 - 30;
var y = s * 114 - 50;
var fname = frames[(s-1)*13+c-1];
scene.add.image(x, y, 'fronts', fname);
}
}
var back = scene.add.image(45, 500, 'fronts', 'back');
}
分割して表示された結果が以下になります。
This entry was posted on 金曜日, 10月 30th, 2020 at 16:39 and is filed under 未分類. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.