Package org.mt4j.components

Examples of org.mt4j.components.MTComponent.addChild()


    //Inverts the normals, if they are calculated pointing inside of the mesh instead of outside
    boolean invertNormals = true;
   
    for (int i = 0; i < meshes.length; i++) {
      MTTriangleMesh mesh = meshes[i];
      meshGroup.addChild(mesh);
      mesh.unregisterAllInputProcessors(); //Clear previously registered input processors
      mesh.setPickable(true);

      if (invertNormals){
        Vector3D[] normals = mesh.getGeometryInfo().getNormals();
View Full Code Here


        earth.scaleGlobal(se.getScaleFactorX(), se.getScaleFactorY(), se.getScaleFactorX(), earth.getCenterPointGlobal());
        return false;
      }
    });
    this.getCanvas().addChild(group);
        group.addChild(earth);
       
        //Create the moon
        final MTSphere moonSphere = new MTSphere(pa, "moon", 35, 35, 25, TextureMode.Polar);
         moonSphere.setMaterial(material);
        moonSphere.translate(new Vector3D(earth.getRadius() + moonSphere.getRadius() + 50, 0,0));
View Full Code Here

    keyboardButton.setFillColor(new MTColor(255,255,255,200));
    keyboardButton.setName("KeyboardButton");
    keyboardButton.setNoStroke(true);
//    keyboardButton.translateGlobal(new Vector3D(5,5,0));
    keyboardButton.translateGlobal(new Vector3D(-2,app.height-keyboardButton.getWidthXY(TransformSpace.GLOBAL)+2,0));
    topLayer.addChild(keyboardButton);

//    progressBar = new MTProgressBar(app, app.loadFont(MT4jSettings.getInstance().getDefaultFontPath()+ "Ziggurat.vlw"));
    progressBar = new MTProgressBar(app, app.createFont("arial", 18));
   
    progressBar.setDepthBufferDisabled(true);
View Full Code Here

//    progressBar = new MTProgressBar(app, app.loadFont(MT4jSettings.getInstance().getDefaultFontPath()+ "Ziggurat.vlw"));
    progressBar = new MTProgressBar(app, app.createFont("arial", 18));
   
    progressBar.setDepthBufferDisabled(true);
    progressBar.setVisible(false);
    topLayer.addChild(progressBar);
   
    keyboardButton.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent ae) {
        switch (ae.getID()) {
        case TapEvent.BUTTON_CLICKED:
View Full Code Here

    //Now get the position where the global center will be after setting the shape at the desired position
    this.setPositionGlobal(scaledPos);
    Vector3D meshCenterAtPosition = this.getCenterPointGlobal();
   
    if (parent != null){
      parent.addChild(this);//TODO add at same index
    }

    //Compute the distance we would have to move the vertices for the body creation
    //so that the body.position(center) is at the same position as our mesh center
    Vector3D realBodyCenterToMeshCenter = meshCenterAtPosition.getSubtracted(realBodyCenter);
View Full Code Here

            TapAndHoldVisualizer.this.app.invokeLater(new Runnable() {
              public void run(){
                MTComponent parent = e.getParent();
                if (parent != null){
                  parent.removeChild(e);
                  parent.addChild(e);
                }
              }
            });
          }
        }
View Full Code Here

          MTOverlayContainer.this.app.invokeLater(new Runnable() {
            public void run(){
              MTComponent parent = getParent();
              if (parent != null){
                parent.removeChild(MTOverlayContainer.this);
                parent.addChild(MTOverlayContainer.this);
              }
            }
          });
        }else{
          //last component in canvas already is a different overlay container:
View Full Code Here

    t1 = new MTTextArea(mtApplication, font);
    t1.setPickable(false);
    t1.setNoFill(true);
    t1.setNoStroke(true);
    t1.setPositionGlobal(new Vector3D(5,30,0));
    uiLayer.addChild(t1);
   
    t2 = new MTTextArea(mtApplication, font);
    t2.setPickable(false);
    t2.setNoFill(true);
    t2.setNoStroke(true);
View Full Code Here

    t2 = new MTTextArea(mtApplication, font);
    t2.setPickable(false);
    t2.setNoFill(true);
    t2.setNoStroke(true);
    t2.setPositionGlobal(new Vector3D(mtApplication.width - 65 , 30,0));
    uiLayer.addChild(t2);
    this.updateScores();
   
    //Set up check for collisions between objects
    this.addWorldContactListener(world);
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.