Character's inventory

Hi there!



I

my guess is that the picking is a bit off.  Can you print out which item slot is being clicked on and test that?

The mouse picking is fine. Sometimes,  after the compile and run procedures, the problem hapens even when I don

When you set the new texture on the cursor, are you calling updateRenderState on the cursor?

Yes, if I didn

Look, I didn

When I create a Quad instance, where is it's center coordinates?



For example:

When I create the following quad:



quad = new quad("test", 56, 56);

quad.setLocalTranslation(new Vector3f(150f, 400f, 0f));



Is the quad's center coordinates the values (150f, 400f)??

yes.  and the opposite corners of the quad are 94,344,0  and  206,456,0

Hi!



I note that the error occur if I move the mouse when the game is loading…Why?



Sorry for my spelling…

Sorry, no idea just from those clues.  :?

Hi!!!



No, no renanse…I Thank you for all!!! I will try another way…



Thank you so much!!! :wink:

I assume you use an AbsoluteMouse for displaying the cursor? Do you use the getLocalTranslation() method of that AbsoluteMouse or do you use MouseInput.get().get… methods?

In the case you use AbsoluteMouse and MouseInput for cursor location, this might be the problem - they can differ! And that would explain the effect you described (moving mouse while loading). You have two options: use getLocalTranslation() of the AbsoluteMouse or write a Mouse that uses MouseInput…



As soon as I have time for this I will improve the mouse stuff…

Hi!!!



Yes, now its working!!!



I chage the lines of code:



x = mouse.getMouseInput().getXAbsolute()

y = mouse.getMouseInput().getYAbsolute()



for



x = mouse.getLocalTranslation().x

y = mouse.getLocalTranslation().y



…and the problem is solved!!!



Thx guys!!!



PS: But why?  :stuck_out_tongue:

Using local coordinates could create problems if something was not updated(worldTranslation of the Node maybe).

So it could be that u clicked on an Item but u selected another one.



I underline maybe   :smiley: