Is there a way to know how many controls are stacked in a node? I have a bunch of nodes with 0-1-2-3 controls attached to each of them, but it’s dynamic and I’m using an interface I made to manipulate them, so I kind of don’t know how many controls there are unless I make a variable in each of those classes and a getter function in the interface of those classes to obtain a handcoded value that I’d set myself. It’s pretty dirty.
I mean, the idea is something like this, but apparently, JME doesn’t like that:
// Remove all controls from entity to execute possible cleanups on every control
while(node.getNumControls() > 0) {
node.removeControl(node.getControl(0));
}
not confident about speed of this, @zzuegg 's version is probably faster
edit: mygame.Main.reposition_spatial_and_or_control(Main.java:7195)
oou, split it into standalone classes before its too late! 500 lines is optimal average i think
@zzuegg said:
From an api point of view i would probably prefer getControlsCount(), mainly because of alphabetical sorting in the javadocs.
And also when the SDK suggests while you type. That’s why at first I thought there was no such function, but again, maybe I stepped out of my chair a little too fast