Examples of MTRectangle


Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

      break;
    case MODE_WRAP:
      super.setHeightLocal(height);
      //if in MODE_WRAP also reset the size of the CLIP SHAPE!
      if (MT4jSettings.getInstance().isOpenGlMode() && this.getClip() != null && this.getClip().getClipShape() instanceof MTRectangle){
        MTRectangle clipRect = (MTRectangle)this.getClip().getClipShape();
        //        clipRect.setVertices(Vertex.getDeepVertexArrayCopy(this.getVerticesLocal()));
        clipRect.setVertices(this.getVerticesLocal());
      }
      this.updateLayout();
      break;
    default:
      break;
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

        break;
      case MODE_WRAP:
        super.setSizeLocal(width, height);
        //if in MODE_WRAP also reset the size of the CLIP SHAPE!
        if (MT4jSettings.getInstance().isOpenGlMode() && this.getClip() != null && this.getClip().getClipShape() instanceof MTRectangle){
          MTRectangle clipRect = (MTRectangle)this.getClip().getClipShape();
          //clipRect.setVertices(Vertex.getDeepVertexArrayCopy(this.getVerticesLocal()));
          clipRect.setVertices(this.getVerticesLocal());
        }
        this.updateLayout();
        break;
      default:
        break;
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

          break;
        }
          }});
       anim.setResetOnFinish(true);
      
       fullScreenQuad = new MTRectangle(0,0, app.width, app.height, app);
       fullScreenQuad.setFillColor(new MTColor(0,0,0,0));
       fullScreenQuad.setNoStroke(true);
  }
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

    app.getInputManager().disableGlobalInputProcessors(nextScene);
   
    app.invokeLater(new Runnable() {
      public void run() {
        lastSceneWindow = new MTSceneTexture(app,0, 0, Math.round(app.width/2f), Math.round(app.height/2f), lastScene);
        lastSceneRectangle = new MTRectangle(0,0, app.width, app.height, app);
       
        lastSceneRectangle.setGeometryInfo(lastSceneWindow.getGeometryInfo());
        lastSceneRectangle.setTexture(lastSceneWindow.getTexture());
        lastSceneRectangle.setStrokeColor(new MTColor(0,0,0,255));
        lastSceneRectangle.setVisible(false);
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

    app.invokeLater(new Runnable() {
      public void run() {
        lastSceneWindow = new MTSceneTexture(app,0, 0, lastScene);
        nextSceneWindow = new MTSceneTexture(app,0, 0, nextScene);

        lastSceneRectangle = new MTRectangle(0,0, app.width, app.height, app);
        lastSceneRectangle.setGeometryInfo(lastSceneWindow.getGeometryInfo());
        lastSceneRectangle.setTexture(lastSceneWindow.getTexture());
        lastSceneRectangle.setStrokeColor(new MTColor(0,0,0,255));

        nextSceneRectangle = new MTRectangle(0,0, app.width, app.height, app);
        nextSceneRectangle.setGeometryInfo(nextSceneWindow.getGeometryInfo());
        nextSceneRectangle.setTexture(nextSceneWindow.getTexture());
        nextSceneRectangle.setStrokeColor(new MTColor(0,0,0,255));

        getCanvas().addChild(lastSceneRectangle);
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

    app.invokeLater(new Runnable() {
      public void run() {
        lastSceneWindow = new MTSceneTexture(app,0, 0, lastScene);
        nextSceneWindow = new MTSceneTexture(app,0, 0, nextScene);

        lastSceneRectangle = new MTRectangle(0,0, app.width, app.height, app);
        lastSceneRectangle.setGeometryInfo(lastSceneWindow.getGeometryInfo());
        lastSceneRectangle.setTexture(lastSceneWindow.getTexture());
        lastSceneRectangle.setStrokeColor(new MTColor(0,0,0,255));

        nextSceneRectangle = new MTRectangle(0,0, app.width, app.height, app);
        nextSceneRectangle.setGeometryInfo(nextSceneWindow.getGeometryInfo());
        nextSceneRectangle.setTexture(nextSceneWindow.getTexture());
        nextSceneRectangle.setStrokeColor(new MTColor(0,0,0,255));

        getCanvas().addChild(lastSceneRectangle);
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

    goal2.setFillColor(new MTColor(255,0,0));
    goal2.setStrokeColor(new MTColor(255,0,0));
    physicsContainer.addChild(goal2);
   
    //Make two components for both game field sides to drag the puks upon
    MTRectangle leftSide = new MTRectangle(
        PhysicsHelper.scaleDown(0, scale), PhysicsHelper.scaleDown(0, scale),
        PhysicsHelper.scaleDown(app.width/2f, scale), PhysicsHelper.scaleDown(app.height, scale)
        , app);
    leftSide.setName("left side");
    leftSide.setNoFill(true); //Make it invisible -> only used for dragging
    leftSide.setNoStroke(true);
    leftSide.unregisterAllInputProcessors();
    leftSide.removeAllGestureEventListeners(DragProcessor.class);
    leftSide.registerInputProcessor(new DragProcessor(app));
    leftSide.addGestureListener(DragProcessor.class, new GameFieldHalfDragListener(blueCircle));
    physicsContainer.addChild(0, leftSide);
    MTRectangle rightSide = new MTRectangle(
        PhysicsHelper.scaleDown(app.width/2f, scale), PhysicsHelper.scaleDown(0, scale),
        PhysicsHelper.scaleDown(app.width, scale), PhysicsHelper.scaleDown(app.height, scale)
        , app);
    rightSide.setName("right Side");
    rightSide.setNoFill(true); //Make it invisible -> only used for dragging
    rightSide.setNoStroke(true);
    rightSide.unregisterAllInputProcessors();
    rightSide.removeAllGestureEventListeners(DragProcessor.class);
    rightSide.registerInputProcessor(new DragProcessor(app));
    rightSide.addGestureListener(DragProcessor.class, new GameFieldHalfDragListener(redCircle));
    physicsContainer.addChild(0, rightSide);
   
    //Display Score UI
    MTComponent uiLayer = new MTComponent(mtApplication, new MTCamera(mtApplication));
    uiLayer.setDepthBufferDisabled(true);
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

    this.setStrokeWeight(1);

    if (MT4jSettings.getInstance().isOpenGlMode()){
//      MTRectangle clipRect = new MTRectangle(x+0.25f, y+0.25f, z, width - 0.5f, height - 0.5f, applet);
      MTRectangle clipRect = new MTRectangle(x, y, z, width, height, applet);
      clipRect.setNoStroke(true);
      clipRect.setBoundsBehaviour(MTRectangle.BOUNDS_ONLY_CHECK);

      GL gl = ((PGraphicsOpenGL)applet.g).gl;
      Clip clipMask = new Clip(gl, clipRect);
      this.setChildClip(clipMask);
    }
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

   
    //CLOSE BUTTON
//    Vector3D a = new Vector3D(-width * 1.2f, height/2f);
    Vector3D a = new Vector3D(-width * 1.55f, 0);
    a.rotateZ(PApplet.radians(80));
    final MTRectangle closeButton = new MTRectangle(x + a.x, y + a.y, buttonWidth, buttonHeight, app);
   
    if (closeButtonImage == null){
      closeButtonImage = app.loadImage(MT4jSettings.getInstance().getDefaultImagesPath() +
//          "close_32.png"));
//          "126182-simple-black-square-icon-alphanumeric-circled-x3_cr.png"));
//          "124241-matte-white-square-icon-alphanumeric-circled-x3_cr.png");
          "closeButton64.png");
    }
   
    closeButton.setTexture(closeButtonImage);
    closeButton.setFillColor(new MTColor(255, 255, 255, buttonOpacity));
    closeButton.setNoStroke(true);
    closeButton.setVisible(false);
    this.addChild(closeButton);
   
    //Check if this menu belongs to a window Scene (MTSceneWindow)
    //or was added to a normal scene
    //-> if its not a windowed scene we dont display the Restore button
    if (this.windowedScene){
      //RESTORE BUTTON
      Vector3D b = new Vector3D(-width * 1.55f, 0);
      b.rotateZ(PApplet.radians(10));
      final MTRectangle restoreButton = new MTRectangle(x + b.x, y + b.y, buttonWidth, buttonHeight, app);
     
      if (restoreButtonImage == null){
        restoreButtonImage = app.loadImage(MT4jSettings.getInstance().getDefaultImagesPath() +
//            "window_app_32.png"));
//            "126630-simple-black-square-icon-business-document10-sc1_cr.png");
    //        restoreButton.setFillColor(new MTColor(150, 150, 250, 200));
            "restoreButton64.png");
      }
     
      restoreButton.setTexture(restoreButtonImage);
      restoreButton.setFillColor(new MTColor(255, 255, 255, buttonOpacity));
      restoreButton.setNoStroke(true);
      restoreButton.setVisible(false);
      this.addChild(restoreButton);
     
      menuShape.addGestureListener(DragProcessor.class, new IGestureEventListener() {
        public boolean processGestureEvent(MTGestureEvent ge) {
          DragEvent de = (DragEvent)ge;
          switch (de.getId()) {
          case MTGestureEvent.GESTURE_DETECTED:
            restoreButton.setVisible(true);
            closeButton.setVisible(true);
            unhighlightButton(closeButton, buttonOpacity);
            unhighlightButton(restoreButton, buttonOpacity);
            break;
          case MTGestureEvent.GESTURE_UPDATED:
            //Mouse over effect
            if (closeButton.containsPointGlobal(de.getTo())){
              highlightButton(closeButton);
            }else{
              unhighlightButton(closeButton, buttonOpacity);
            }
            if (restoreButton.containsPointGlobal(de.getTo())){
              highlightButton(restoreButton);
            }else{
              unhighlightButton(restoreButton, buttonOpacity);
            }
            break;
          case MTGestureEvent.GESTURE_ENDED:
            unhighlightButton(closeButton, buttonOpacity);
            unhighlightButton(restoreButton, buttonOpacity);
           
            InputCursor cursor = de.getDragCursor();
            Vector3D restoreButtonIntersection = restoreButton.getIntersectionGlobal(Tools3D.getCameraPickRay(getRenderer(), restoreButton, cursor.getCurrentEvtPosX(), cursor.getCurrentEvtPosY()));
            if (restoreButtonIntersection != null){
              logger.debug("--> RESTORE!");
              MTSceneMenu.this.sceneTexture.restore();
            }
            Vector3D closeButtonIntersection = closeButton.getIntersectionGlobal(Tools3D.getCameraPickRay(getRenderer(), closeButton, cursor.getCurrentEvtPosX(), cursor.getCurrentEvtPosY()));
            if (closeButtonIntersection != null){
//              if (app.popScene()){
//                app.removeScene(scene); //FIXME wont work if the scene has a transition because we cant remove the still active scene
////                destroy(); //this will be destroyed with the scene
//                sceneTexture.destroy(); //destroys also the MTSceneWindow and with it the scene
//                logger.debug("--> CLOSE!");
//              }
              if (sceneTexture.restore()){
//                app.removeScene(scene); //FIXME wont work if the scene has a transition because we cant remove the still active scene
//                destroy(); //this will be destroyed with the scene
                sceneTexture.destroy(); //destroys also the MTSceneWindow and with it the scene
                logger.debug("--> CLOSE!");
              }
            }
           
            restoreButton.setVisible(false);
            closeButton.setVisible(false);
            break;
          default:
            break;
          }
View Full Code Here

Examples of org.mt4j.components.visibleComponents.shapes.MTRectangle

            getCanvas().addChild(poly);
           
        MTLine line = new MTLine(getMTApplication(), new Vertex(30,30), new Vertex(150,110));
        getCanvas().addChild(line);
       
        MTRectangle r1 = new MTRectangle(10,10, 200,100, getMTApplication());
        getCanvas().addChild(r1);
        assertEquals(getCanvas().getChildren()[3], r1);
       
        MTRoundRectangle roundRect = new MTRoundRectangle(0,0,0, 160, 110, 30,30, getMTApplication());
            getCanvas().addChild(roundRect);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.