Codename LogoCodename Logo

funkin.game.HealthIcon

APIWikiTools

Constructor

View in GitHub

new(?char:String, isPlayer:Bool = false)

Variables

animated:Bool = false

Whenever or not the icon is animated or not

curAnimState:OneOfTwo<String, Int> = -1

Current animation state

curCharacter:String = null

The currently showing icon

defaultScale:Float = 1

The Default Scale For The Icon

This is what scale the icon should return to when its bump animation is finished

extraOffsets:FlxPoint = FlxPoint.get()

Extra offsets to add when updating the hitbox

healthSteps:Map<Int, OneOfTwo<String, Int>> = null

Health steps in this format:

Min Percentage => Frame Index / Animation Name

isPlayer:Bool

If the character is for the player

sprTracker:FlxSprite

Attaches the icon to a sprite, following it's position

sprTrackerAlignment:TrackerAlignment = RIGHT

Where to place the icon in relation to the sprite

LEFT: Left of the sprite

CENTER: Center of the sprite

RIGHT: Right of the sprite

sprTrackerOffset:FlxPoint = new FlxPoint(10, -30)

Offset of the icon in relation to the sprite

By default it is set to (10, -30) and is intended to be used with Alphabet

xmlData:Xml

XML Animated Icon data

null if the icon is not animated or its invalid

Methods

View in GitHub

dynamicbump():Void

Called every beat, and causes the icon to become bigger

View in GitHub

dynamicgetIconAnim(health:Float):IconAnimData

Gets the animation data for a specific health percentage

Parameters:

health

Health percentage

Returns:

Animation data (-1 if invalid)

View in GitHub

setIcon(char:String, allowAnimated:Bool = true):Void

Sets the icon to the specified character

Parameters:

char

Character to set the icon to

allowAnimated

Whenever the icon can be animated

View in GitHub

dynamicupdateBump():Void

Called every frame and causes the icon to become smaller

Inherited Variables

Defined by FunkinSprite

animDatas:Map<String, AnimData> = []

animOffsets:Map<String, FlxPoint> = new Map<String,FlxPoint>()

beatAnims:Array<BeatAnim> = []

beatInterval:Int = 2

ODD interval -> asynced; EVEN interval -> synced

beatOffset:Int = 0

debugMode:Bool = false

extra:Map<String, Dynamic> = []

initialZoom:Float = 1

name:String

skipNegativeBeats:Bool = false

zoomFactor:Float = 1

Inherited Methods

Defined by FunkinSprite

View in GitHub

inlineaddAnim(name:String, prefix:String, frameRate:Float = 24, ?looped:Bool, ?forced:Bool, ?indices:Array<Int>, x:Float = 0, y:Float = 0, animType:XMLAnimType = NONE):ErrorCode

View in GitHub

addOffset(name:String, x:Float = 0, y:Float = 0):Void

View in GitHub

beatHit(curBeat:Int):Void

View in GitHub

getAnim(name:String):OneOfTwo<FlxAnimation, FlxSymbolAnimation>

View in GitHub

inlinegetAnimName():Null<String>

View in GitHub

inlinegetAnimOffset(name:String):Null<FlxPoint>

View in GitHub

inlinegetNameList():Array<String>

View in GitHub

inlinehasAnim(AnimName:String):Bool

View in GitHub

inlinehasAnimation(AnimName:String):Bool

View in GitHub

loadSprite(path:String, Unique:Bool = false, ?Key:String):Void

View in GitHub

measureHit(curMeasure:Int):Void

View in GitHub

onPropertySet(property:String, value:Dynamic):Void

View in GitHub

playAnim(AnimName:String, ?Force:Bool, Context:PlayAnimContext = NONE, Reversed:Bool = false, Frame:Int = 0):Void

View in GitHub

inlineremoveAnim(name:String):Void

View in GitHub

inlineremoveAnimation(name:String):Void

View in GitHub

stepHit(curBeat:Int):Void

View in GitHub

switchOffset(anim1:String, anim2:String):Void