[ImageView] added imageUrl field
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package haxework.gui;
|
package haxework.gui;
|
||||||
|
|
||||||
|
import haxework.net.ImageLoader;
|
||||||
import haxework.gui.utils.DrawUtil.FillType;
|
import haxework.gui.utils.DrawUtil.FillType;
|
||||||
import haxework.gui.skin.BitmapSkin;
|
import haxework.gui.skin.BitmapSkin;
|
||||||
import haxework.gui.skin.ButtonBitmapSkin;
|
import haxework.gui.skin.ButtonBitmapSkin;
|
||||||
@@ -8,6 +9,7 @@ import flash.display.BitmapData;
|
|||||||
class ImageView extends SpriteView {
|
class ImageView extends SpriteView {
|
||||||
|
|
||||||
public var image(default, set):BitmapData;
|
public var image(default, set):BitmapData;
|
||||||
|
public var imageUrl(default, set):String;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
super();
|
super();
|
||||||
@@ -21,4 +23,14 @@ class ImageView extends SpriteView {
|
|||||||
}
|
}
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function set_imageUrl(value:String):String {
|
||||||
|
if (imageUrl != value) {
|
||||||
|
imageUrl = value;
|
||||||
|
new ImageLoader().GET(imageUrl).success(function(data) {
|
||||||
|
image = data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return imageUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user