A script that can be tied to a MultiSparrowCharacter, which persists across states. Create a scripted class that extends MultiSparrowCharacter, then call super('charId') in the constructor to use this.

Static methods

staticinit(clsName:String, id:String):ScriptedMultiSparrowCharacter

Initializes a scripted class instance using the given scripted class name and constructor arguments.

staticlistScriptClasses():Array<String>

Returns a list of all the scripted classes which extend this class.

staticscriptStaticCall(clsName:String, funcName:String):Dynamic

Call a custom static function on a scripted class, by the given name, with the given arguments.

staticscriptStaticGet(clsName:String, fieldName:String):Dynamic

Retrieves a custom static variable on a scripted class, by the given name.

@:value({ fieldValue : null })staticscriptStaticSet(clsName:String, fieldName:String, ?fieldValue:Dynamic):Dynamic

Sets the value of a custom static variable on a scripted class, by the given name.

Constructor

new(id:String)

Methods

@:value({ AdjustPosition : false })@:value({ AdjustPosition : false })centerOffsets(AdjustPosition:Bool = false):Void

Polymod HScriptedClass override of centerOffsets.

Helper function that adjusts the offset automatically to center the bounding box within the graphic.

Parameters:

AdjustPosition

Adjusts the actual X and Y position just once to match the offset change.

clone():FunkinSprite

Polymod HScriptedClass override of clone.

Ensure scale is applied when cloning a sprite.R The default clone() method acts kinda weird TBH.

Returns:

A clone of this sprite.

@:value({ force : false })@:value({ force : false })dance(force:Bool = false):Void

Polymod HScriptedClass override of dance.

destroy():Void

Polymod HScriptedClass override of destroy.

draw():Void

Polymod HScriptedClass override of draw.

@:value({ Force : false })@:value({ Force : false })drawFrame(Force:Bool = false):Void

Polymod HScriptedClass override of drawFrame.

Request (or force) that the sprite update the frame before rendering. Useful if you are doing procedural generation or other weirdness!

Parameters:

Force

Force the frame to redraw, even if its not flagged as necessary.

forceAnimationForDuration(name:String, duration:Float):Void

Polymod HScriptedClass override of forceAnimationForDuration.

Parameters:

name

The animation to play.

duration

The duration in which other (non-forced) animations will be skipped, in seconds (NOT MILLISECONDS).

getBaseScale():Float

Polymod HScriptedClass override of getBaseScale.

getCameras():Array<FlxCamera>

Polymod HScriptedClass override of getCameras.

The cameras that will draw this. Use this.cameras to set specific cameras for this object, otherwise the container's cameras are used, or the container's container and so on. If there is no container, say, if this is inside FlxGroups rather than a FlxContainer then the default draw cameras are returned.

Available since

5.7.0

.

getCurrentAnimation():String

Polymod HScriptedClass override of getCurrentAnimation.

Gets the current animation ID.

getDataFlipX():Bool

Polymod HScriptedClass override of getDataFlipX.

Gets the value of flipX from the character data. !getFlipX() is the direction Boyfriend should face.

getDeathCameraOffsets():Array<Float>

Polymod HScriptedClass override of getDeathCameraOffsets.

getDeathCameraZoom():Float

Polymod HScriptedClass override of getDeathCameraZoom.

getDeathPreTransitionDelay():Float

Polymod HScriptedClass override of getDeathPreTransitionDelay.

getDeathQuote():Null<String>

Polymod HScriptedClass override of getDeathQuote.

getDefaultAtlasSettings():AtlasSpriteSettings

Polymod HScriptedClass override of getDefaultAtlasSettings.

Gets the default settings for a texture atlas sprite.

Returns:

The default settings for a texture atlas sprite.

getDefaultCamera():FlxCamera

Polymod HScriptedClass override of getDefaultCamera.

The main camera that will draw this. Use this.cameras to set specific cameras for this object, otherwise the container's camera is used, or the container's container and so on. If there is no container, say, if this is inside FlxGroups rather than a FlxContainer then FlxG.camera is returned.

Available since

5.7.0

.

getDefaultSymbol():String

Polymod HScriptedClass override of getDefaultSymbol.

Returns the default symbol in the atlas.

getFirstElement(symbol:String):Null<Element>

Polymod HScriptedClass override of getFirstElement.

Returns the first element of a symbol in the atlas.

Parameters:

symbol

The symbol to get elements from.

Returns:

The first element of the symbol. WARNING: Can be null.

getFrameLabel(name:String):Null<Frame>

Polymod HScriptedClass override of getFrameLabel.

Gets a frame label by its name.

Parameters:

name

The name of the frame label to retrieve.

Returns:

The frame label, or null if it doesn't exist.

getFrameLabelList():Array<String>

Polymod HScriptedClass override of getFrameLabelList.

Gets a list of frame labels from the default timeline.

getFramesWithKeyword(keyword:String):Array<Frame>

Polymod HScriptedClass override of getFramesWithKeyword.

Gets every frame on every symbol that starts with the given keyword.

Parameters:

keyword

The keyword to search for.

Returns:

An array of frames.

@:value({ rect : null })getGraphicBounds(?rect:FlxRect):FlxRect

Polymod HScriptedClass override of getGraphicBounds.

Retrieves the world bounds of this sprite's graphic Note: Ignores scrollFactor, to get the screen position of the graphic use getScreenBounds

Parameters:

rect

The resulting rect, if null a new one is created

Available since

5.9.0

.

@:value({ point : null })getGraphicMidpoint(?point:FlxPoint):FlxPoint

Polymod HScriptedClass override of getGraphicMidpoint.

Retrieve the midpoint of this sprite's graphic in world coordinates.

Parameters:

point

The resulting point, if null a new one is created

getHealthIconId():String

Polymod HScriptedClass override of getHealthIconId.

@:value({ rect : null })getHitbox(?rect:FlxRect):FlxRect

Polymod HScriptedClass override of getHitbox.

@:value({ point : null })getMidpoint(?point:FlxPoint):FlxPoint

Polymod HScriptedClass override of getMidpoint.

Retrieve the midpoint of this object in world coordinates.

Parameters:

point

Allows you to pass in an existing FlxPoint object if you're so inclined. Otherwise a new one is created.

Returns:

A FlxPoint object containing the midpoint of this object in world coordinates.

@:value({ camera : null })getPixelAt(worldPoint:FlxPoint, ?camera:FlxCamera):Null<FlxColor>

Polymod HScriptedClass override of getPixelAt.

Determines which of this sprite's pixels are at the specified world coordinate, if any. Factors in scale, angle, offset, origin, and scrollFactor.

Parameters:

worldPoint

The point in world space

camera

The camera, used for scrollFactor. If null, getDefaultCamera() is used.

Returns:

a FlxColor, if the point is in the sprite's graphic, otherwise null is returned.

Available since

5.0.0

.

@:value({ camera : null })getPixelAtScreen(screenPoint:FlxPoint, ?camera:FlxCamera):Null<FlxColor>

Polymod HScriptedClass override of getPixelAtScreen.

Determines which of this sprite's pixels are at the specified screen coordinate, if any. Factors in scale, angle, offset, origin, and scrollFactor.

Parameters:

screenPoint

The point in screen space

camera

The desired "screen" space. If null, getDefaultCamera() is used

Returns:

a FlxColor, if the point is in the sprite's graphic, otherwise null is returned.

Available since

5.0.0

.

@:value({ result : null })getPosition(?result:FlxPoint):FlxPoint

Polymod HScriptedClass override of getPosition.

Returns the world position of this object.

Parameters:

result

Optional arg for the returning point.

Returns:

The world position of this object.

@:value({ newRect : null })getRotatedBounds(?newRect:FlxRect):FlxRect

Polymod HScriptedClass override of getRotatedBounds.

Calculates the smallest globally aligned bounding box that encompasses this sprite's width and height, at its current rotation. Note, if called on a FlxSprite, the origin is used, but scale and offset are ignored. Use getScreenBounds to use these properties.

Parameters:

newRect

The optional output FlxRect to be returned, if null, a new one is created.

Returns:

A globally aligned FlxRect that fully contains the input object's width and height.

Available since

4.11.0

.

@:value({ camera : null, newRect : null })getScreenBounds(?newRect:FlxRect, ?camera:FlxCamera):FlxRect

Polymod HScriptedClass override of getScreenBounds.

@:value({ camera : null, result : null })getScreenPosition(?result:FlxPoint, ?camera:FlxCamera):FlxPoint

Polymod HScriptedClass override of getScreenPosition.

getSymbolElements(symbol:String):Array<Element>

Polymod HScriptedClass override of getSymbolElements.

Returns the elements of a symbol in the atlas.

Parameters:

symbol

The symbol to get elements from.

graphicLoaded():Void

Polymod HScriptedClass override of graphicLoaded.

Called whenever a new graphic is loaded for this sprite (after loadGraphic(), makeGraphic() etc).

hasAnimation(id:String):Bool

Polymod HScriptedClass override of hasAnimation.

Whether or not this sprite has an animation with the given ID.

Parameters:

id

The ID of the animation to check.

@:haxe.warning("-WDeprecated")hasColorTransform():Bool

Polymod HScriptedClass override of hasColorTransform.

Whether this sprite has a color transform, menaing any of the following: less than full alpha, a color tint, or a colorTransform whos values are not the default.

hurt(damage:Float):Void

Deprecated: <![CDATA["object.hurt is deprecated, add <haxedef name=\"FLX_HEALTH\"/> in your project.xml to continue using it"]]>

Polymod HScriptedClass override of hurt.

Reduces the health variable of this object by the amount specified in Damage. Calls kill() if health drops to or below zero.

Parameters:

Damage

How much health to take away (use a negative number to give a health bonus).

initHealthIcon(isOpponent:Bool):Void

Polymod HScriptedClass override of initHealthIcon.

isAnimationDynamic(id:String):Bool

Polymod HScriptedClass override of isAnimationDynamic.

Parameters:

id

The animation ID to check.

Returns:

Whether the animation is dynamic (has multiple frames). false for static, one-frame animations.

isAnimationFinished():Bool

Polymod HScriptedClass override of isAnimationFinished.

Whether or not the current animation is finished.

@:value({ camera : null })isOnScreen(?camera:FlxCamera):Bool

Polymod HScriptedClass override of isOnScreen.

Check and see if this object is currently on screen. Differs from FlxObject's implementation in that it takes the actual graphic into account, not just the hitbox or bounding box or whatever.

Parameters:

camera

Specify which game camera you want. If null, getDefaultCamera() is used

Returns:

Whether the object is on screen or not.

@:value({ camera : null })isPixelPerfectRender(?camera:FlxCamera):Bool

Polymod HScriptedClass override of isPixelPerfectRender.

Check if object is rendered pixel perfect on a specific camera.

@:value({ camera : null })isSimpleRender(?camera:FlxCamera):Bool

Polymod HScriptedClass override of isSimpleRender.

Returns the result of isSimpleRenderBlit() if FlxG.renderBlit is true, or false if FlxG.renderTile is true.

@:value({ camera : null })isSimpleRenderBlit(?camera:FlxCamera):Bool

Polymod HScriptedClass override of isSimpleRenderBlit.

Determines the function used for rendering in blitting: copyPixels() for simple sprites, draw() for complex ones. Sprites are considered simple when they have an angle of 0, a scale of 1, don't use blend and pixelPerfectRender is true.

Parameters:

camera

If a camera is passed its pixelPerfectRender flag is taken into account

isSinging():Bool

Polymod HScriptedClass override of isSinging.

kill():Void

Polymod HScriptedClass override of kill.

Handy function for "killing" game objects. Use reset() to revive them. Default behavior is to flag them as nonexistent AND dead. However, if you want the "corpse" to remain in the game, like to animate an effect or whatever, you should override this, setting only alive to false, and leaving exists true.

listAnimations():Array<String>

Polymod HScriptedClass override of listAnimations.

Returns:

A list of all the animations this sprite has available.

@:value({ cache : true })@:value({ cache : true })loadBitmapData(input:BitmapData, cache:Bool = true):FunkinSprite

Polymod HScriptedClass override of loadBitmapData.

Apply an OpenFL BitmapData to this sprite.

Parameters:

input

The OpenFL BitmapData to apply

Returns:

This sprite, for chaining

@:value({ key : null, unique : false, frameHeight : 0, frameWidth : 0, animated : false })@:value({ unique : false, frameHeight : 0, frameWidth : 0, animated : false })loadGraphic(graphic:FlxGraphicAsset, animated:Bool = false, frameWidth:Int = 0, frameHeight:Int = 0, unique:Bool = false, ?key:String):FlxSprite

Polymod HScriptedClass override of loadGraphic.

Load an image from an embedded graphic file.

HaxeFlixel's graphic caching system keeps track of loaded image data. When you load an identical copy of a previously used image, by default HaxeFlixel copies the previous reference onto the pixels field instead of creating another copy of the image data, to save memory.

NOTE: This method updates hitbox size and frame size.

Parameters:

graphic

The image you want to use.

animated

Whether the Graphic parameter is a single sprite or a row / grid of sprites.

frameWidth

Specify the width of your sprite (helps figure out what to do with non-square sprites or sprite sheets).

frameHeight

Specify the height of your sprite (helps figure out what to do with non-square sprites or sprite sheets).

unique

Whether the graphic should be a unique instance in the graphics cache. Set this to true if you want to modify the pixels field without changing the pixels of other sprites with the same BitmapData.

key

Set this parameter if you're loading BitmapData.

Returns:

This FlxSprite instance (nice for chaining stuff together, if you're into that).

loadGraphicFromSprite(Sprite:FlxSprite):FlxSprite

Polymod HScriptedClass override of loadGraphicFromSprite.

Load graphic from another FlxSprite and copy its tile sheet data. This method can be useful for non-flash targets.

Parameters:

Sprite

The FlxSprite from which you want to load graphic data.

Returns:

This FlxSprite instance (nice for chaining stuff together, if you're into that).

loadPacker(key:String):FunkinSprite

Polymod HScriptedClass override of loadPacker.

Load an animated texture (Packer atlas spritesheet) as the sprite's texture.

Parameters:

key

The key of the texture to load.

Returns:

This sprite, for chaining.

@:value({ autoBuffer : false, antiAliasing : false, rotations : 16 })@:value({ autoBuffer : false, antiAliasing : false, rotations : 16 })loadRotatedFrame(frame:FlxFrame, rotations:Int = 16, antiAliasing:Bool = false, autoBuffer:Bool = false):FlxSprite

Polymod HScriptedClass override of loadRotatedFrame.

Helper method which allows using FlxFrame as graphic source for sprite's loadRotatedGraphic() method.

Parameters:

frame

Frame to load into this sprite.

rotations

The number of rotation frames the final sprite should have. For small sprites this can be quite a large number (360 even) without any problems.

antiAliasing

Whether to use high quality rotations when creating the graphic. Default is false.

autoBuffer

Whether to automatically increase the image size to accommodate rotated corners. Will create frames that are 150% larger on each axis than the original frame or graphic.

Returns:

this FlxSprite with loaded rotated graphic in it.

@:value({ Key : null, AutoBuffer : false, AntiAliasing : false, Frame : -1, Rotations : 16 })@:value({ AutoBuffer : false, AntiAliasing : false, Frame : -1, Rotations : 16 })loadRotatedGraphic(Graphic:FlxGraphicAsset, Rotations:Int = 16, Frame:Int = -1, AntiAliasing:Bool = false, AutoBuffer:Bool = false, ?Key:String):FlxSprite

Polymod HScriptedClass override of loadRotatedGraphic.

Create a pre-rotated sprite sheet from a simple sprite. This can make a huge difference in graphical performance on blitting targets!

Parameters:

Graphic

The image you want to rotate and stamp.

Rotations

The number of rotation frames the final sprite should have. For small sprites this can be quite a large number (360 even) without any problems.

Frame

If the Graphic has a single row of square animation frames on it, you can specify which of the frames you want to use here. Default is -1, or "use whole graphic."

AntiAliasing

Whether to use high quality rotations when creating the graphic. Default is false.

AutoBuffer

Whether to automatically increase the image size to accommodate rotated corners. Will create frames that are 150% larger on each axis than the original frame or graphic.

Key

Optional, set this parameter if you're loading BitmapData.

Returns:

This FlxSprite instance (nice for chaining stuff together, if you're into that).

loadSparrow(key:String):FunkinSprite

Polymod HScriptedClass override of loadSparrow.

Load an animated texture (Sparrow atlas spritesheet) as the sprite's texture.

Parameters:

key

The key of the texture to load.

Returns:

This sprite, for chaining.

loadTexture(key:String):FunkinSprite

Polymod HScriptedClass override of loadTexture.

Load a static image as the sprite's texture.

Parameters:

key

The key of the texture to load.

Returns:

This sprite, for chaining.

@:value({ fade : false })@:value({ fade : false })loadTextureAsync(key:String, fade:Bool = false):Void

Polymod HScriptedClass override of loadTextureAsync.

@:value({ settings : null, assetLibrary : null })loadTextureAtlas(key:Null<String>, ?assetLibrary:String, ?settings:AtlasSpriteSettings):FunkinSprite

Polymod HScriptedClass override of loadTextureAtlas.

Loads an Adobe Animate texture atlas as the sprite's texture.

Parameters:

key

The key of the texture to load.

settings

Additional settings for loading the atlas.

Returns:

This sprite, for chaining.

loadTextureBase(input:TextureBase):Null<FunkinSprite>

Polymod HScriptedClass override of loadTextureBase.

Apply an OpenFL TextureBase to this sprite.

Parameters:

input

The OpenFL TextureBase to apply

Returns:

This sprite, for chaining

@:value({ key : null, unique : false, color : -1 })@:value({ unique : false, color : FlxColor.WHITE })makeGraphic(width:Int, height:Int, color:FlxColor = -1, unique:Bool = false, ?key:String):FlxSprite

Polymod HScriptedClass override of makeGraphic.

This function creates a flat colored rectangular image dynamically.

HaxeFlixel's graphic caching system keeps track of loaded image data. When you make an identical copy of a previously used image, by default HaxeFlixel copies the previous reference onto the pixels field instead of creating another copy of the image data, to save memory.

NOTE: This method updates hitbox size and frame size.

Parameters:

Width

The width of the sprite you want to generate.

Height

The height of the sprite you want to generate.

Color

Specifies the color of the generated block (ARGB format).

Unique

Whether the graphic should be a unique instance in the graphics cache. Default is false. Set this to true if you want to modify the pixels field without changing the pixels of other sprites with the same BitmapData.

Key

An optional String key to identify this graphic in the cache. If null, the key is determined by Width, Height and Color. If Unique is true and a graphic with this Key already exists, it is used as a prefix to find a new unique name like "Key3".

Returns:

This FlxSprite instance (nice for chaining stuff together, if you're into that).

@:value({ color : -1 })@:value({ color : FlxColor.WHITE })makeSolidColor(width:Int, height:Int, color:FlxColor = -1):FunkinSprite

Polymod HScriptedClass override of makeSolidColor.

Acts similarly to makeGraphic, but with improved memory usage, at the expense of not being able to paint onto the resulting sprite.

Parameters:

width

The target width of the sprite.

height

The target height of the sprite.

color

The color to fill the sprite with.

Returns:

This sprite, for chaining.

onAdd(event:ScriptEvent):Void

Polymod HScriptedClass override of onAdd.

Called when this prop is added to the stage.

Parameters:

null

event

onBeatHit(event:SongTimeScriptEvent):Void

Polymod HScriptedClass override of onBeatHit.

onCountdownEnd(event:CountdownScriptEvent):Void

Polymod HScriptedClass override of onCountdownEnd.

onCountdownStart(event:CountdownScriptEvent):Void

Polymod HScriptedClass override of onCountdownStart.

onCountdownStep(event:CountdownScriptEvent):Void

Polymod HScriptedClass override of onCountdownStep.

onCreate(event:ScriptEvent):Void

Polymod HScriptedClass override of onCreate.

onDestroy(event:ScriptEvent):Void

Polymod HScriptedClass override of onDestroy.

onGameOver(event:ScriptEvent):Void

Polymod HScriptedClass override of onGameOver.

onNoteGhostMiss(event:GhostMissNoteScriptEvent):Void

Polymod HScriptedClass override of onNoteGhostMiss.

Every time a wrong key is pressed, play the miss animation if we are Boyfriend.

onNoteHit(event:HitNoteScriptEvent):Void

Polymod HScriptedClass override of onNoteHit.

Every time a note is hit, check if the note is from the same strumline. If it is, then play the sing animation.

onNoteHoldDrop(event:HoldNoteScriptEvent):Void

Polymod HScriptedClass override of onNoteHoldDrop.

onNoteIncoming(event:NoteScriptEvent):Void

Polymod HScriptedClass override of onNoteIncoming.

onNoteMiss(event:NoteScriptEvent):Void

Polymod HScriptedClass override of onNoteMiss.

Every time a note is missed, check if the note is from the same strumline. If it is, then play the sing animation.

onPause(event:PauseScriptEvent):Void

Polymod HScriptedClass override of onPause.

onResume(event:ScriptEvent):Void

Polymod HScriptedClass override of onResume.

onScriptEvent(event:ScriptEvent):Void

Polymod HScriptedClass override of onScriptEvent.

onSongEnd(event:ScriptEvent):Void

Polymod HScriptedClass override of onSongEnd.

onSongEvent(event:SongEventScriptEvent):Void

Polymod HScriptedClass override of onSongEvent.

onSongLoaded(event:SongLoadScriptEvent):Void

Polymod HScriptedClass override of onSongLoaded.

onSongRetry(event:SongRetryEvent):Void

Polymod HScriptedClass override of onSongRetry.

onSongStart(event:ScriptEvent):Void

Polymod HScriptedClass override of onSongStart.

onStepHit(event:SongTimeScriptEvent):Void

Polymod HScriptedClass override of onStepHit.

Called once every step of the song.

onUpdate(event:UpdateScriptEvent):Void

Polymod HScriptedClass override of onUpdate.

@:value({ camera : null, inScreenSpace : false })@:value({ inScreenSpace : false })@:access(flixel.group.FlxTypedGroup)overlaps(objectOrGroup:FlxBasic, inScreenSpace:Bool = false, ?camera:FlxCamera):Bool

Polymod HScriptedClass override of overlaps.

Checks to see if some FlxObject overlaps this FlxObject or FlxGroup. If the group has a LOT of things in it, it might be faster to use FlxG.overlap(). WARNING: Currently tilemaps do NOT support screen space overlap checks!

Parameters:

objectOrGroup

The object or group being tested.

inScreenSpace

Whether to take scroll factors into account when checking for overlap. Default is false, or "only compare in world space."

camera

The desired "screen" space. If null, getDefaultCamera() is used

Returns:

Whether or not the two objects overlap.

@:value({ camera : null, inScreenSpace : false })@:value({ inScreenSpace : false })@:access(flixel.group.FlxTypedGroup)overlapsAt(x:Float, y:Float, objectOrGroup:FlxBasic, inScreenSpace:Bool = false, ?camera:FlxCamera):Bool

Polymod HScriptedClass override of overlapsAt.

Checks to see if this FlxObject were located at the given position, would it overlap the FlxObject or FlxGroup? This is distinct from overlapsPoint(), which just checks that point, rather than taking the object's size into account. WARNING: Currently tilemaps do NOT support screen space overlap checks!

Parameters:

x

The X position you want to check. Pretends this object (the caller, not the parameter) is located here.

y

The Y position you want to check. Pretends this object (the caller, not the parameter) is located here.

objectOrGroup

The object or group being tested.

inScreenSpace

Whether to take scroll factors into account when checking for overlap. Default is false, or "only compare in world space."

camera

The desired "screen" space. If null, getDefaultCamera() is used

Returns:

Whether or not the two objects overlap.

@:value({ camera : null, inScreenSpace : false })@:value({ inScreenSpace : false })overlapsPoint(point:FlxPoint, inScreenSpace:Bool = false, ?camera:FlxCamera):Bool

Polymod HScriptedClass override of overlapsPoint.

Checks to see if a point in 2D world space overlaps this FlxObject.

Parameters:

point

The point in world space you want to check.

inScreenSpace

Whether to take scroll factors into account when checking for overlap.

camera

The desired "screen" space. If null, getDefaultCamera() is used

Returns:

Whether or not the point overlaps this object.

@:value({ camera : null, alphaTolerance : 255 })@:value({ alphaTolerance : 0xFF })pixelsOverlapPoint(worldPoint:FlxPoint, alphaTolerance:Int = 255, ?camera:FlxCamera):Bool

Polymod HScriptedClass override of pixelsOverlapPoint.

Checks to see if a point in 2D world space overlaps this FlxSprite object's current displayed pixels. This check is ALWAYS made in screen space, and factors in scale, angle, offset, origin, and scrollFactor.

Parameters:

worldPoint

point in world space you want to check.

alphaTolerance

Used to determine what counts as solid.

camera

The desired "screen" space. If null, getDefaultCamera() is used

Returns:

Whether or not the point overlaps this object.

@:value({ reversed : false, ignoreOther : false, restart : false })@:value({ reversed : false, ignoreOther : false, restart : false })playAnimation(name:String, restart:Bool = false, ignoreOther:Bool = false, reversed:Bool = false):Void

Polymod HScriptedClass override of playAnimation.

@:value({ suffix : "", miss : false })@:value({ suffix : "", miss : false })playSingAnimation(dir:NoteDirection, miss:Bool = false, suffix:String = ""):Void

Polymod HScriptedClass override of playSingAnimation.

Play the appropriate singing animation, for the given note direction.

Parameters:

dir

The direction of the note.

miss

If true, play the miss animation instead of the sing animation.

suffix

A suffix to append to the animation name, like alt.

@:value({ FetchPositions : false })@:value({ FetchPositions : false })replaceColor(Color:FlxColor, NewColor:FlxColor, FetchPositions:Bool = false):Array<FlxPoint>

Polymod HScriptedClass override of replaceColor.

Replaces all pixels with specified Color with NewColor pixels. WARNING: very expensive (especially on big graphics) as it iterates over every single pixel.

Parameters:

Color

Color to replace

NewColor

New color

FetchPositions

Whether we need to store positions of pixels which colors were replaced.

Returns:

Array with replaced pixels positions

@:value({ adjustScale : true, graphic : null })@:value({ adjustScale : true })replaceSymbolGraphic(symbol:String, ?graphic:FlxGraphicAsset, adjustScale:Bool = true):Void

Polymod HScriptedClass override of replaceSymbolGraphic.

Replaces the graphic of a symbol in the atlas.

Parameters:

symbol

The symbol to replace.

graphic

The new graphic to use.

adjustScale

Whether to adjust the scale of new frame to match the old one.

reset(x:Float, y:Float):Void

Polymod HScriptedClass override of reset.

Handy function for reviving game objects. Resets their existence flags and position.

Parameters:

x

The new X position of this object.

y

The new Y position of this object.

resetCameraFocusPoint():Void

Polymod HScriptedClass override of resetCameraFocusPoint.

@:value({ resetCamera : true })@:value({ resetCamera : true })resetCharacter(resetCamera:Bool = true):Void

Polymod HScriptedClass override of resetCharacter.

Reset the character so it can be used at the start of the level. Call this when restarting the level.

resetPosition():Void

Polymod HScriptedClass override of resetPosition.

If this Bopper was defined by the stage, return the prop to its original position.

revive():Void

Polymod HScriptedClass override of revive.

Handy function for bringing game objects "back to life". Just sets alive and exists back to true. In practice, this function is most often called by FlxObject#reset().

@:value({ scaleEverything : false, positionOffset : 0 })@:value({ scaleEverything : false, positionOffset : 0 })scaleElement(element:Element, scale:Float, positionOffset:Float = 0, scaleEverything:Bool = false):Void

Polymod HScriptedClass override of scaleElement.

Scales an element by a certain multiplier.

Parameters:

element

The element to scale.

scale

The scale multiplier.

positionOffset

The offset to apply to tx and ty after scaling. (Or in other words, the position of the element.)

@:value({ funcArgs : null })scriptCall(funcName:String, ?funcArgs:Array<Dynamic>):Dynamic

Calls a function of the scripted class with the given name and arguments.

scriptGet(varName:String):Dynamic

Retrieves the value of a local variable of a scripted class.

@:value({ varValue : null })scriptSet(varName:String, ?varValue:Dynamic):Dynamic

Directly modifies the value of a local variable of a scripted class.

setAnimationOffsets(name:String, xOffset:Float, yOffset:Float):Void

Polymod HScriptedClass override of setAnimationOffsets.

@:value({ alphaOffset : 0.0, blueOffset : 0.0, greenOffset : 0.0, redOffset : 0.0, alphaMultiplier : 1.0, blueMultiplier : 1.0, greenMultiplier : 1.0, redMultiplier : 1.0 })@:value({ alphaOffset : 0.0, blueOffset : 0.0, greenOffset : 0.0, redOffset : 0.0, alphaMultiplier : 1.0, blueMultiplier : 1.0, greenMultiplier : 1.0, redMultiplier : 1.0 })@:haxe.warning("-WDeprecated")setColorTransform(redMultiplier:Float = 1.0, greenMultiplier:Float = 1.0, blueMultiplier:Float = 1.0, alphaMultiplier:Float = 1.0, redOffset:Float = 0.0, greenOffset:Float = 0.0, blueOffset:Float = 0.0, alphaOffset:Float = 0.0):Void

Polymod HScriptedClass override of setColorTransform.

Sets the sprite's color transformation with control over color offsets. With FlxG.renderTile, offsets are only supported on OpenFL Next version 3.6.0 or higher.

Parameters:

redMultiplier

The value for the red multiplier, in the range from 0 to 1.

greenMultiplier

The value for the green multiplier, in the range from 0 to 1.

blueMultiplier

The value for the blue multiplier, in the range from 0 to 1.

alphaMultiplier

The value for the alpha transparency multiplier, in the range from 0 to 1.

redOffset

The offset value for the red color channel, in the range from -255 to 255.

greenOffset

The offset value for the green color channel, in the range from -255 to 255.

blueOffset

The offset for the blue color channel value, in the range from -255 to 255.

alphaOffset

The offset for alpha transparency channel value, in the range from -255 to 255.

@:value({ saveAnimations : true })@:value({ saveAnimations : true })@:access(flixel.animation.FlxAnimationController)setFrames(Frames:FlxFramesCollection, saveAnimations:Bool = true):FlxSprite

Polymod HScriptedClass override of setFrames.

Sets frames and allows you to save animations in sprite's animation controller

Parameters:

Frames

Frames collection to set for this sprite.

saveAnimations

Whether to save animations in animation controller or not.

Returns:

This sprite with loaded frames

@:value({ height : 0.0, width : 0.0 })@:value({ height : 0.0, width : 0.0 })setGraphicSize(width:Float = 0.0, height:Float = 0.0):Void

Polymod HScriptedClass override of setGraphicSize.

Helper function to set the graphic's dimensions by using scale, allowing you to keep the current aspect ratio should one of the numbers be <= 0. It might make sense to call updateHitbox() afterwards!

Parameters:

width

How wide the graphic should be. If <= 0, and height is set, the aspect ratio will be kept.

height

How high the graphic should be. If <= 0, and width is set, the aspect ratio will be kept.

@:value({ y : 0.0, x : 0.0 })@:value({ y : 0.0, x : 0.0 })setPosition(x:Float = 0.0, y:Float = 0.0):Void

Polymod HScriptedClass override of setPosition.

Helper function to set the coordinates of this object. Handy since it only requires one line of code.

Parameters:

x

The new x position

y

The new y position

setScale(scale:Null<Float>):Void

Polymod HScriptedClass override of setScale.

Set the character's sprite scale to the appropriate value.

Parameters:

scale

The desired scale.

setSize(width:Float, height:Float):Void

Polymod HScriptedClass override of setSize.

Shortcut for setting both width and Height.

Parameters:

width

The new hitbox width.

height

The new hitbox height.

@:value({ Y : 0, X : 0 })@:value({ Y : 0, X : 0 })stamp(Brush:FlxSprite, X:Int = 0, Y:Int = 0):Void

Polymod HScriptedClass override of stamp.

Stamps / draws another FlxSprite onto this FlxSprite. This function is NOT intended to replace draw()!

Parameters:

Brush

The sprite you want to use as a brush or stamp or pen or whatever.

X

The X coordinate of the brush's top left corner on this sprite.

Y

They Y coordinate of the brush's top left corner on this sprite.

@:value({ result : null, camera : null })transformScreenToPixels(screenPoint:FlxPoint, ?camera:FlxCamera, ?result:FlxPoint):FlxPoint

Polymod HScriptedClass override of transformScreenToPixels.

Converts the point from screen coordinates to this sprite's pixel coordinates where (0,0) is the top left of the graphic. Factors in scale, angle, offset, origin, and scrollFactor.

Parameters:

screenPoint

The screen coordinates

camera

The desired "screen" space. If null, getDefaultCamera() is used

result

Optional arg for the returning point

@:value({ result : null, camera : null })transformWorldToPixels(worldPoint:FlxPoint, ?camera:FlxCamera, ?result:FlxPoint):FlxPoint

Polymod HScriptedClass override of transformWorldToPixels.

Converts the point from world coordinates to this sprite's pixel coordinates where (0,0) is the top left of the graphic. Factors in scale, angle, offset, origin, and scrollFactor.

Parameters:

worldPoint

The world coordinates

camera

The camera, used for scrollFactor. If null, getDefaultCamera() is used

result

Optional arg for the returning point

@:value({ result : null })transformWorldToPixelsSimple(worldPoint:FlxPoint, ?result:FlxPoint):FlxPoint

Polymod HScriptedClass override of transformWorldToPixelsSimple.

Converts the point from world coordinates to this sprite's pixel coordinates where (0,0) is the top left of the graphic. Same as worldToPixels but never uses a camera, therefore scrollFactor is ignored

Parameters:

worldPoint

The world coordinates.

result

Optional arg for the returning point

update(elapsed:Float):Void

Polymod HScriptedClass override of update.

updateFramePixels():BitmapData

Polymod HScriptedClass override of updateFramePixels.

updateHitbox():Void

Polymod HScriptedClass override of updateHitbox.

Updates the sprite's hitbox (width, height, offset) according to the current scale. Also calls centerOrigin().

Inherited Variables

Defined by BaseCharacter

@:value(new FlxPoint(0, 0))read onlycameraFocusPoint:FlxPoint = new FlxPoint(0, 0)

Returns the point the camera should focus on. Should be approximately centered on the character, and should not move based on the current animation.

Set the position of this rather than reassigning it, so that anything referencing it will not be affected.

read onlycharacterId:String

read onlycharacterName:String

read onlycharacterOrigin:FlxPoint

The offset between the corner of the sprite and the origin of the sprite (at the character's feet). cornerPosition = stageData - characterOrigin

@:value(OTHER)characterType:CharacterType = OTHER

Whether the player is an active character (Boyfriend) or not.

read onlycomboNoteCounts:Array<Int>

This character plays a given animation when hitting these specific combo numbers.

cornerPosition:FlxPoint

The absolute position of the top-left of the character. @return

curNoteKind:NoteKind

The current note kind.

@:value(false)debug:Bool = false

Set to true when the character being used in a special way. This includes the Chart Editor and the Animation Editor.

Used by scripts to ensure that they don't try to run code to interact with the stage when the stage doesn't actually exist.

read onlydropNoteCounts:Array<Int>

This character plays a given animation when dropping combos larger than these numbers.

read onlyfeetPosition:FlxPoint

The absolute position of the character's feet, at the bottom-center of the sprite.

@:value(0)holdTimer:Float = 0

Tracks how long, in seconds, the character has been playing the current sing animation. This is used to ensure that characters play the sing animations for at least one beat, preventing them from reverting to the idle animation between notes.

@:value(false)isDead:Bool = false

Set to true when the character dead. Part of the handling for death animations.

Defined by Bopper

@:value(new Map<String,Array<Float>>())animationOffsets:Map<String, Array<Float>> = new Map<String,Array<Float>>()

Offset the character's sprite by this much when playing each animation.

@:value(true)canPlayOtherAnims:Bool = true

@:value(0.0)danceEvery:Float = 0.0

The bopper plays the dance animation once every danceEvery beats. Set to 0 to disable idle animation. Supports up to 0.25 precision.

@:value([0, 0])globalOffsets:Array<Float> = [0, 0]

The offset of the character relative to the position specified by the stage.

@:value("")idleSuffix:String = ""

Add a suffix to the idle animation (or danceLeft and danceRight animations) that this bopper will play.

@:value([])ignoreExclusionPref:Array<String> = []

@:value(false)isPixel:Bool = false

If this bopper is rendered with pixel art, disable anti-aliasing.

@:value(new FlxPoint(0, 0))originalPosition:FlxPoint = new FlxPoint(0, 0)

@:value(null)shouldAlternate:Null<Bool> = null

Whether the bopper should dance left and right. - If true, alternate playing danceLeft and danceRight. - If false, play idle every time.

You can manually set this value, or you can leave it as null to determine it automatically.

@:value(true)shouldBop:Bool = true

Whether this bopper should bop every beat. By default it's true, but when used for characters/players, it should be false so it doesn't cut off their animations!!!!!

Defined by StageProp

@:value("")name:String = ""

An internal name for this prop.

Inherited Methods