NEWS COMMUNITY STORE TUTORIALS ROKOJORI ACTION LIBRARY ROKOJORI ACTION LIBRARY TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS ROKOJORI ACTION LIBRARY ROKOJORI ACTION LIBRARY TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS image/svg+xml image/svg+xml image/svg+xml CUSTOM ACTIONS
How to write custom Actions
image/svg+xml image/svg+xml How to write custom Actions image/svg+xml






WRITING A CUSTOM ACTION

Actions are easy to write. You just need a to implement one function in C#: _OnTrigger()

Or the same in GDScript. You additionally get the C# node to get access to some C# features. _onTrigger( action:GDScriptAction )


C#: using Godot; using Rokojori; [Tool, GlobalClass] public partial class MyAction:Action { protected override void _OnTrigger() { GD.Print( "Hello World!" ); } }

GDScript: ## -- ## -- @tool class_name MyAction extends RJ_Action func _onTrigger( action:GDScriptAction ) -> void: print( "Hello World!" ); ## ---




WRITING A PARAMETRIC ACTION

To add parameters, simply use members that you export.

If the parameters don't change, this Action is also network-ready.


C#: using Godot; using Rokojori; [Tool, GlobalClass] public partial class MyAction:Action { [Export] public string loggingText; protected override void _OnTrigger() { GD.Print( loggingText ); } }

GDScript: ## -- ## -- @tool class_name MyAction extends RJ_Action @export var loggingText: String func _onTrigger( action:GDScriptAction ) -> void: print( loggingText ); ## ---












TO ROKOJORI ACTION LIBRARY TUTORIALS







All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...