class ScriptedFlxBasic
package funkin.modding.base
extends FlxBasic
implements HScriptedClass
Available on all platforms
A script that can be tied to an FlxBasic. Create a scripted class that extends FlxBasic to use this.
Static methods
staticinit(clsName:String):ScriptedFlxBasic
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.
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
Methods
destroy():Void
Polymod HScriptedClass override of destroy.
WARNING: A destroyed FlxBasic can't be used anymore.
It may even cause crashes if it is still part of a group or state.
You may want to use kill() instead if you want to disable the object temporarily only and revive() it later.
This function is usually not called manually (Flixel calls it automatically during state switches for all add()ed objects).
Override this function to null out variables manually or call destroy() on class members if necessary.
Don't forget to call super.destroy()!
draw():Void
Polymod HScriptedClass override of draw.
Override this function to control how the object is drawn. Doing so is rarely necessary, but can be very useful.
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.
5.7.0
.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.
5.7.0
.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.
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().
scriptCall(funcName:String, ?funcArgs:Array<Dynamic>):Dynamic
Calls a function of the scripted class with the given name and arguments.
scriptSet(varName:String, ?varValue:Dynamic):Dynamic
Directly modifies the value of a local variable of a scripted class.
update(elapsed:Float):Void
Polymod HScriptedClass override of update.
Override this function to update your class's position and appearance. This is where most of your game rules and behavioral code will go.