-
example: package testingLMAOHEHE;
class RedBox extends flixel.FlxSprite {
public function new(x:Float = 0, y:Float = 0, width:Int = 100, height:Int = 100) : Void {
super(x, y);
makeGraphic(width, height, 0xFFFF0000);
}
}
function create()
{
var e = new RedBox();
trace('create');
} |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 13 replies
-
Yes. I recommend using the
var scriptedInstance = new ScriptedSubClass('a.b.c.HelloWorld', [1, 'Script']);
import rulescript.scriptedClass.RuleScriptedClass;
import rulescript.types.ScriptedTypeUtil;
// Get scripted class
var cl = new Access(ScriptedTypeUtil.resolveScript('scriptedClass.RuleScriptedClass.ScriptedClassStrict'));
// Create scripted class instance
var instance = cl.createInstance(['hello']); |
Beta Was this translation helpful? Give feedback.
-
Hi, thank you for your response. This isn't JUST for specific scripts that are using classes—my main use for this is softmodding. I should've specified, but I sent the script as a sort of state-specific script that's automatically loaded by a handler. I made that class to see if I could add a red box, lol. Thank you for responding so quickly—I really appreciate it. |
Beta Was this translation helpful? Give feedback.
-
Yeah, the question remains unresolved.
|
Beta Was this translation helpful? Give feedback.
I think this example can answer your questions.
example.zip