You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An arbitrary list of method arguments, each with a name and a type (String, Number, Vector2, etc)
When defined, the method definition is stored in the Block Coding resource, like current variables definitions.
After defined, the Block Picker should be refreshed and present the defined methods as blocks under category "Communication | Methods". One "Define FOO" block and one "Call FOO" block (where "FOO" is the method name).
"Define FOO" should have arguments that can be dragged to the snapped blocks below. See block "when this node collides with (something)" for reference.
"Call FOO" should have input slots for each argument. And each input slot should only accept the corresponding type.
Note that this is for defining/calling methods in the same Block Coding node. Not for passing arguments to methods defined in other Block Coding nodes.
Original report below:
What Happened
im trying to call a method with arguments but there are no inputs to put the argument values..
after some digging on the code i wanted to add it myself, but i got stuck cuz idk what to put as the type on the block format, it could be just VARIANT or something but idk for sure
The text was updated successfully, but these errors were encountered:
@Melon-The-Dev thanks. Yes this is something we need to think about. I am researching how to enhace blocks with overloading. For instance, the current Print block only takes a String, but it should be able to take any Variant as argument.
@Melon-The-Dev thanks. Yes this is something we need to think about. I am researching how to enhace blocks with overloading. For instance, the current Print block only takes a String, but it should be able to take any Variant as argument.
ahh i see, i might tinker around the code of the addon and see if i can do smth
Here is a reference for someone wanting to implement this: https://youtu.be/FARjoscK0vw?t=1650 . That video shows how a function can be defined with arguments in MakeCode Arcade.
Spec
Add a new mini editor dialog for defining a method, similar to the current one for defining variables. The dialog should let the user set:
When defined, the method definition is stored in the Block Coding resource, like current variables definitions.
After defined, the Block Picker should be refreshed and present the defined methods as blocks under category "Communication | Methods". One "Define FOO" block and one "Call FOO" block (where "FOO" is the method name).
Note that this is for defining/calling methods in the same Block Coding node. Not for passing arguments to methods defined in other Block Coding nodes.
Original report below:
What Happened
im trying to call a method with arguments but there are no inputs to put the argument values..
after some digging on the code i wanted to add it myself, but i got stuck cuz idk what to put as the type on the block format, it could be just VARIANT or something but idk for sure
The text was updated successfully, but these errors were encountered: