0

I have an arrow:

Arrow ballArrow =  new Arrow("Ball Arrow", 2, 0.175f);

And I want to resize it to make it longer whenever a key is pressed (say Key_5).

Which method would I call to resize it as when i'm calling .setLength() and .setWidth() they keep getting slashed out and i'm not sure what that means.

BTW i'm using jMonkeyEngine 2 not 3.

Dan W
  • 5,718
  • 4
  • 33
  • 44
Mike
  • 109
  • 2
  • 10
  • Slashed out usually means deprecated and that you should use a newer version of the method. – Dan W Mar 13 '12 at 13:54

1 Answers1

0

Looking at the Arrow API, setLength and setWidth are deprecated. To do the resizing, you should be doing:

Arrow ballArrow = new Arrow("Ball Arrow", 2, 0.175f);
....
float newLength = (somevalue);
float newWidth = (somevalue);
ballArrow.updateGeometry(newLength, newWidth);

Hope this helps.

Dan W
  • 5,718
  • 4
  • 33
  • 44
  • Yea I think that's it, but whenever I call it (i.e. I press Key_7) the arrow dissapears. Do I have to reattach it to the rootNode everytime I update it? – Mike Mar 13 '12 at 14:03