added resources & bitmap skin
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package haxework.gui;
|
||||
|
||||
import haxework.gui.skin.ISize;
|
||||
import haxework.gui.core.SizeType;
|
||||
import haxework.gui.core.HAlign;
|
||||
import haxework.gui.core.VAlign;
|
||||
@@ -61,6 +62,10 @@ class View implements IView<Sprite> {
|
||||
hAlign = HAlign.NONE;
|
||||
}
|
||||
|
||||
private function currentSkin():ISkin<Sprite, IView<Sprite>> {
|
||||
return skin;
|
||||
}
|
||||
|
||||
private function invalidate():Void {
|
||||
updater.invalidate(this);
|
||||
}
|
||||
@@ -73,7 +78,12 @@ class View implements IView<Sprite> {
|
||||
public function update():Void {
|
||||
content.x = x;
|
||||
content.y = y;
|
||||
skin.draw(this);
|
||||
if (contentSize && skin != null && Std.is(skin, ISize)) {
|
||||
var size:ISize = cast(skin, ISize);
|
||||
if (!Math.isNaN(size.width)) width = size.width;
|
||||
if (!Math.isNaN(size.height)) height = size.height;
|
||||
}
|
||||
currentSkin().draw(this);
|
||||
}
|
||||
|
||||
private function set_x(value:Float):Float {
|
||||
|
||||
Reference in New Issue
Block a user