added resources & bitmap skin

This commit is contained in:
2013-11-22 16:27:43 +04:00
parent 7d45f0fac7
commit cba776ec51
12 changed files with 173 additions and 9 deletions

View File

@@ -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 {