Groovy Dependency for Lemur Unrecognized?

The issue is pretty simple. I’m trying to use the styling language by including Groovy as a dependency, but this syntax:

selector('glass') {
    fontSize = 20
}

is unrecognized. That and the Lemur guide says to use this import:

import com.simsilica.component.*;

but jme3 only recognizes “lemur” as a package after simsilica. Hence it can’t compile. I’ve included groovy-all-2.4.6.jar as a dependency.

Also, I’ve read a lot of topics where people wanting to put their game on Android have run into compilation issues with Android. I haven’t tested it myself yet, but is it something I should be wary of?

What’s complaining about it being unrecognized? It’s not pure groovy as it relies on the built in API. So you can’t just run it like a .groovy file, you have to load it through the style loader.

Yeah, the guide has a typo I guess. That should be com.simsilica.lemur.component.*
…but you only need that if you want to define components. Like QuadBackgroundComponent and so on.

On this forum, there was only one topic. And that person ultimately converted to using Java-based styling instead of the groovy DSL. However, his limitation on getting groovy to run on Android could be because he wasn’t able to use the gradle plugin. (because he wasn’t using gradle)

There must be ways to make groovy work on Android… I’m just not that familiar with Android development.

At any rate, if you really get stuck then you can always convert the styling over to straight Java… it will just be a lot more verbose.

Well, specifically with that syntax “selector” is an “unclosed character literal.” Maybe I missed something in the docs, but how do I load it through a style loader?

Also, even if I do not use the style language, this syntax:

Styles styles = GuiGlobals.getInstance().getStyles();
Attributes attrs;
attrs = styles.selector("glass");
attrs.set("fontSize", 14);

throws an error at the styles.selector saying that it cannot find a method “selector” for styles.

I’ve imported all the necessary dependencies.

Like this:

Yeah, apparently when I created that section of the docs I was trying to make it too similar to the groovy styling. Sorry about that. The real call is getSelector().

http://jmonkeyengine-contributions.github.io/Lemur/javadoc/Lemur/com/simsilica/lemur/style/Styles.html#getSelector(java.lang.String)

Given that my examples are a bit broken, you might have to compare the intent with the javadoc to work through it until I can correct it.

Oh, that works. The styling language still doesn’t work, but I can run with the regular java syntax for now. Thanks!