-
-
Save anonymous/428c8e87752bc8165c7d5a1f8f774d26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package classes.utils; | |
import flixel.ui.FlxBar; | |
@:enum | |
abstract BarType(Int) from Int to Int { | |
var GAME_STATE_SCORE_BAR = 0; | |
var SETTINGS_VOLUME_BAR = 1; | |
} | |
class ClassBar extends FlxBar | |
{ | |
@:isVar public var barID(get, set):BarType; | |
public function new(xpos:Float,ypos:Float,max:Int,barID:BarType) | |
{ | |
super(xpos, ypos); | |
FlxBarFillDirection.LEFT_TO_RIGHT; | |
this.min = 0; | |
this.max = max; | |
this.barID = barID; | |
setRange(min, max); | |
switch(barID) { | |
case GAME_STATE_SCORE_BAR: | |
{ | |
createImageBar(AssetPaths.emptyScoreStarBarBG__png, AssetPaths.fullScoreStarFG__png); | |
pxPerPercent = 4; | |
} | |
case SETTINGS_VOLUME_BAR: | |
{ | |
createImageBar(AssetPaths.emptyBar300x50__png, AssetPaths.fullBar300x50__png); | |
} | |
} | |
percent = 100; | |
} | |
public function getMax():Int | |
{ | |
return Math.floor(max); | |
} | |
public function setMax(Max:Int):Void | |
{ | |
max = Max; | |
setRange(min,max); | |
} | |
public function get_barID():BarType | |
{ | |
return barID; | |
} | |
public function set_barID(value:BarType):BarType | |
{ | |
return barID = value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment