26 lines
785 B
Haxe
Executable File
26 lines
785 B
Haxe
Executable File
package haxework.gui.list;
|
|
|
|
import haxework.gui.skin.ISkin;
|
|
import flash.display.Sprite;
|
|
import flash.display.Graphics;
|
|
|
|
class VScrollSkin implements ISkin<Sprite, ScrollView> {
|
|
|
|
public var foreColor(default, default):Int;
|
|
public var backColor(default, default):Int;
|
|
|
|
public function new(?foreColor:Int = 0xffffff, ?backColor:Int = 0x707070) {
|
|
this.foreColor = foreColor;
|
|
this.backColor = backColor;
|
|
}
|
|
|
|
public function draw(view:ScrollView):Void {
|
|
var graphics:Graphics = view.content.graphics;
|
|
graphics.clear();
|
|
graphics.beginFill(backColor);
|
|
graphics.drawRect(0, 0, view.width, view.height);
|
|
graphics.beginFill(foreColor);
|
|
graphics.drawRect(0, view.height * view.position, view.width, view.height * view.ratio);
|
|
graphics.endFill();
|
|
}
|
|
} |