mirror of
https://github.com/ysoftdevs/pf2016.git
synced 2026-01-11 22:41:34 +01:00
fix buttons in level selector
This commit is contained in:
@@ -5,13 +5,22 @@ levelSelectorState.preload = function() {
|
||||
}
|
||||
|
||||
levelSelectorState.create = function() {
|
||||
var counterX = 0;
|
||||
var counterY = 0;
|
||||
for (var i=1; i<levels.length+1; i++) {
|
||||
var text = new Kiwi.GameObjects.Textfield( this, "Level " + i.toString(), 16+(i-1)*140, 60, "#000", 32, 'normal', 'Impact' );
|
||||
var sprite = new Kiwi.GameObjects.Sprite(this, this.textures.button, (i-1)*140, 50);
|
||||
|
||||
var text = new Kiwi.GameObjects.Textfield( this, "Level " + i.toString(), 16+counterX*140, 60+counterY*80, "#000", 32, 'normal', 'Impact' );
|
||||
var sprite = new Kiwi.GameObjects.Sprite(this, this.textures.button, counterX*140, 50+counterY*80);
|
||||
sprite.levelIndex = i;
|
||||
sprite.input.onUp.add( this.buttonReleased, this );
|
||||
this.addChild( sprite );
|
||||
this.addChild( text );
|
||||
|
||||
counterX++;
|
||||
if (counterX > 4) {
|
||||
counterX = 0;
|
||||
counterY++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user