
Untitled
By: a guest on
May 30th, 2012 | syntax:
None | size: 2.28 KB | hits: 16 | expires: Never
if (_selections.length > 0){
selectionsY = string.y + string.height;
if (selectionGraphic.visible == false ){
selectionGraphic.y = string.y + string.height;
}
selectionGraphic.visible = true;
for (var selectionsKey:String in _selections) {
FlxG.state.add(selections = new FlxText(0,selectionsY,FlxG.width,_selections[selectionsKey]));
selectionsY += 16;
selections.alignment = "center";
}
if (FlxG.keys.justReleased("DOWN")){
selectionKey += 1;
selectionGraphic.y += 16;
if (selectionKey > _selections.length-1){
selectionGraphic.y = string.y + string.height;
selectionKey = 0;
}
}
if (FlxG.keys.justReleased("UP")){
selectionGraphic.y -= 16;
selectionKey -= 1;
if (selectionKey < 0){
selectionKey = _selections.length-1;
selectionGraphic.y = string.y + string.height + 16*(_selections.length-1);
}
}
if (FlxG.keys.justReleased("X")){
selection = _selections[selectionKey];
dialogBox = false;
}
}