proscene 1.95 to proscene 2

hello Jean Pierre,

I'm trying to understand how certain low-level features of the new released proscene 2 work.

1. I work with custom GrabberObjects but in this new version I found a bit confusing the way they work. More specifically I do not know how to achieve this in proscene 2: setGrabsMouse(true). I used this method because I implemented a "selection box" such that any target falling within a box that is drawn on the screen would get selected...

2. to check whether there was any frame or mousegrabbable being grabbed I used this line: scene.mouseGrabber() == null. I could not find a suitable method, I'd thought it would involve the new motionAgent but I can't figure it out.

3. I also can't find a suitable method to set a frame as the InteractiveFrame associated to this Scene: scene.setInteractiveFrame(iFrame)

Tagged:

Answers

  • Answer ✓

    Hi Gennaro,

    1. scene.motionAgent().setDefaultGrabber(mySelectionBox).
    2. scene.motionAgent().inputGrabber() == null.
    3. The scene.interactiveFrame(). It was a bit akward and overkill. You emulate it using a combination of: scene.motionAgent().setDefaultGrabber(), scene.motionAgent().enableTracking() and scene.motionAgent().disableTracking(). Please refer to the Frame.Frameinteraction axample whih illustrates all of this.

    Ypu may also refer to the Agent API which covers all the topics discussed here.

    jp

  • edited June 2014 Answer ✓

    Hi Gennaro,

    1. scene.motionAgent().setDefaultGrabber(mySelectionBox)
    2. scene.motionAgent().inputGrabber() == null.

    You may also refer to the Agent API which covers all the topics discussed here.

  • Answer ✓

    (sorry for reposting, not very skilled with this markdown version)

    1. The scene.interactiveFrame() is gone. It was a bit awkward and overkill. You may emulate it using a combination of: scene.motionAgent().setDefaultGrabber(), scene.motionAgent().enableTracking() and scene.motionAgent().disableTracking(). Please refer to the Frame.FrameInteraction axample which illustrates all of this.
  • hi Jean Pierre, thanks for your answers. I managed to upgrade almost all the previous methods.

    I need to change the color of the drawZoomWindow. Differently from the method "drawShooterTarget" you left stroke and strokeWeight in the method so I have to override. However the fields fCorner and lCorner are not visible so the method can't be overridden. Same applies for the method "drawScreenRotateLineHint()".

    In addition, I need to change the color of the "anchor". I tried to override both drawAnchorHint() and drawPointUnderPixelHint() but the color is still white, any idea ? On this regard and as you probably already know the ANCHOR_FROM_PIXEL does not work (I think you mentioned there were a few issues with GL, I've emailed Andres). Please confirm this is the reason whey it is not working, thanks.

    let me know

  • hi Jean Pierre,

    please ignore entirely the 2nd paragraph above , it is all working fine in terms of setting/resetting the anchor point and changing its color. I instead confirm the issues described in the 1st paragraph regards

  • Answer ✓

    There's no need for these variables to be able to override the methods. You could build them as:

    void mousePressed() {
      fCorner.set(mouseX, mouseY);
    }
    

    and the other one as:

    float p2x = mouseX;
    float p2y = mouseY;
    

    I already completed the example here.

  • I see...I was being being lazy as myscene is a different class in my application...thanks for your answers.

Sign In or Register to comment.