23 lines
641 B
Haxe
Executable File
23 lines
641 B
Haxe
Executable File
package haxework.gui.skin;
|
|
|
|
import flash.display.Graphics;
|
|
import flash.display.Sprite;
|
|
import haxework.gui.skin.ISkin;
|
|
|
|
class ProgressSkin implements ISkin<ProgressView> {
|
|
|
|
public var foreColor:Int;
|
|
public var backColor:Int;
|
|
|
|
public function new() {}
|
|
|
|
public function draw(view:ProgressView):Void {
|
|
var graphics:Graphics = view.contentAsSprite.graphics;
|
|
graphics.clear();
|
|
graphics.beginFill(backColor);
|
|
graphics.drawRect(0, 0, view.width, view.height);
|
|
graphics.beginFill(foreColor);
|
|
graphics.drawRect(0, 0, view.width * (view.max > 0 ? view.value / view.max : 0), view.height);
|
|
graphics.endFill();
|
|
}
|
|
} |