[signal] add Signal0
This commit is contained in:
@@ -23,6 +23,17 @@ class BaseSignal<R> {
|
||||
}
|
||||
}
|
||||
|
||||
typedef Receiver0 = Void -> Void;
|
||||
|
||||
class Signal0 extends BaseSignal<Receiver0> {
|
||||
|
||||
public function emit():Void {
|
||||
for (receiver in receivers) {
|
||||
receiver();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef Receiver1<A> = A -> Void;
|
||||
|
||||
class Signal1<A> extends BaseSignal<Receiver1<A>> {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package haxework.view.skin;
|
||||
|
||||
import haxework.view.utils.DrawUtil.FillType;
|
||||
import haxework.view.layout.ILayout;
|
||||
import haxework.view.core.Geometry;
|
||||
import flash.display.BitmapData;
|
||||
@@ -10,8 +11,8 @@ class Skin {
|
||||
return new GeometrySkin(new Geometry().setSize(width, height));
|
||||
}
|
||||
|
||||
public static function bitmap(image:BitmapData):ISkin<SpriteView> {
|
||||
return new BitmapSkin(image);
|
||||
public static function bitmap(image:BitmapData, fillType:FillType = null):ISkin<SpriteView> {
|
||||
return new BitmapSkin(image, fillType);
|
||||
}
|
||||
|
||||
public static function color(color:Int, alpha:Float = 1.0):ISkin<SpriteView> {
|
||||
@@ -30,8 +31,8 @@ class Skin {
|
||||
return new ButtonColorSkin(color, alpha);
|
||||
}
|
||||
|
||||
public static function buttonBitmap(image:BitmapData):ISkin<ButtonView> {
|
||||
return new ButtonBitmapSkin(image);
|
||||
public static function buttonBitmap(image:BitmapData, fillType:FillType = null):ISkin<ButtonView> {
|
||||
return new ButtonBitmapSkin(image, fillType);
|
||||
}
|
||||
|
||||
public static function tabColor(color:Int, alpha:Float = 1.0):ISkin<ButtonView> {
|
||||
|
||||
Reference in New Issue
Block a user