static SimpleWindow.create with keyword args
This commit is contained in:
@@ -26,6 +26,23 @@ using StringTools;
|
||||
|
||||
typedef ShortcutAction = Void->Void;
|
||||
typedef Action = FlxSprite->Void;
|
||||
typedef ConstructorArgs = {
|
||||
?title:String,
|
||||
?bgColor:FlxColor,
|
||||
?textColor:FlxColor,
|
||||
?percentWidth:Float,
|
||||
?percentHeight:Float,
|
||||
?xButton:Bool,
|
||||
?xKey:String,
|
||||
?leftKey:String,
|
||||
?rightKey:String,
|
||||
?upKey:String,
|
||||
?downKey:String,
|
||||
?enterKey:String,
|
||||
?onClose:ShortcutAction,
|
||||
?selectionMarker:FlxSprite,
|
||||
?screenReaderAudioFolder:String
|
||||
};
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class SimpleWindow extends FlxSprite {}
|
||||
|
@@ -148,6 +148,10 @@
|
||||
(set SimpleWindow.defaultDownKey "down")
|
||||
(set SimpleWindow.defaultEnterKey "enter"))
|
||||
|
||||
(function create [:ConstructorArgs args]
|
||||
(new SimpleWindow args.title args.bgColor args.textColor args.percentWidth args.percentHeight args.xButton args.xKey
|
||||
args.leftKey args.rightKey args.upKey args.downKey args.enterKey args.onClose args.selectionMarker args.screenReaderAudioFolder))
|
||||
|
||||
(defNew [&opt :String _title
|
||||
:FlxColor bgColor
|
||||
:FlxColor _textColor
|
||||
|
Reference in New Issue
Block a user