Skip to content

Return table with lua functions #1166

Answered by SquidDev
SirEndii asked this question in Q&A
Discussion options

You must be logged in to vote

* In order to provide a custom object with methods, one may return a {@link IDynamicLuaObject}, or an arbitrary
* class with {@link LuaFunction} annotations. Anything else will be converted to {@code nil}.

I assume this is what you want - you should just be able to create a class for panels (or whatever) and add @LuaFunctions to it:

class PanelElement {
  @LuaFunction
  public final PanelElement addPanel(String name) {
    return new PanelElement();
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SirEndii
Comment options

Answer selected by SirEndii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants