Package org.mt4j.components.visibleComponents.widgets

Examples of org.mt4j.components.visibleComponents.widgets.MTTextArea$ArtificalLineBreak


   
//    getCanvas().addChild(rect);
    */
   
    ///Add scene title
    MTTextArea text = new MTTextArea(app, font);
    text.setFillColor(new MTColor(150,150,250,200));
    text.setNoFill(true);
    text.setNoStroke(true);
    text.setText(sceneToCreate.getTitle());
    text.rotateZ(text.getCenterPointLocal(), 90, TransformSpace.LOCAL);
    cell.addChild(text);
   
//    text.setAnchor(PositionAnchor.CENTER);
//    PositionAnchor oldCellAnchor = cell.getAnchor();
//    cell.setAnchor(PositionAnchor.CENTER);
//    text.setPositionRelativeToParent(cell.getPosition(TransformSpace.LOCAL));
//    text.translate(new Vector3D(realListCellWidth - topShift, 0));
//    cell.setAnchor(oldCellAnchor);
   
    text.setPositionRelativeToParent(cell.getCenterPointLocal());
    text.translate(new Vector3D(realListCellWidth*0.5f - text.getHeightXY(TransformSpace.LOCAL)*0.5f, 0));
    ///
  }
View Full Code Here


    final MTListCell cell = new MTListCell(cellWidth, cellHeight, p);
   
    cell.setChildClip(null); //FIXME TEST, no clipping for performance!
   
    cell.setFillColor(cellFillColor);
    MTTextArea listLabel = new MTTextArea(p, font);
    listLabel.setNoFill(true);
    listLabel.setNoStroke(true);
    listLabel.setText(label);
    cell.addChild(listLabel);
    listLabel.setPositionRelativeToParent(cell.getCenterPointLocal());
    cell.unregisterAllInputProcessors();
    cell.registerInputProcessor(new TapProcessor(p, 15));
    cell.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
View Full Code Here

  private MTRoundRectangle getRoundRectWithText(float x, float y, float width, float height, String text, IFont font){
    MTRoundRectangle r = new MTRoundRectangle(x, y, 0, width, height, 12, 12, getMTApplication());
    r.unregisterAllInputProcessors();
    r.setFillColor(MTColor.BLACK);
    r.setStrokeColor(MTColor.BLACK);
    MTTextArea rText = new MTTextArea(getMTApplication(), font);
    rText.unregisterAllInputProcessors();
    rText.setPickable(false);
    rText.setNoFill(true);
    rText.setNoStroke(true);
    rText.setText(text);
    r.addChild(rText);
    rText.setPositionRelativeToParent(r.getCenterPointLocal());
    return r;
  }
View Full Code Here

 
 
  private MTListCell createListCell(final String imageName, IFont font, float cellWidth, float cellHeight, final MTColor cellFillColor, final MTColor cellPressedFillColor){
    final MTListCell cell = new MTListCell(cellWidth, cellHeight, getMTApplication());
    cell.setFillColor(cellFillColor);
    MTTextArea listLabel = new MTTextArea(getMTApplication(), font);
    listLabel.setNoFill(true);
    listLabel.setNoStroke(true);
    listLabel.setText(imageName);
    cell.addChild(listLabel);
    listLabel.setPositionRelativeToParent(cell.getCenterPointLocal());
    cell.unregisterAllInputProcessors();
    cell.registerInputProcessor(new TapProcessor(getMTApplication(), 15));
    cell.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
View Full Code Here

   
    IFont font = FontManager.getInstance().createFont(app, "arial.ttf", 35, white, white);
   
    //Add canvas background gestures
    //Zoom gesture
    MTTextArea backgroundZoom = new MTTextArea(mtApplication, font);
    backgroundZoom.setFillColor(new MTColor(150,150,150));
    backgroundZoom.setNoFill(true);
    backgroundZoom.setNoStroke(true);
    backgroundZoom.setText("Zoom anywhere on the background!");
    backgroundZoom.setPickable(false);
    this.getCanvas().addChild(backgroundZoom);
    backgroundZoom.setPositionGlobal(new Vector3D(app.width/2f, app.height/2f,0));
    getCanvas().registerInputProcessor(new ZoomProcessor(app));
    getCanvas().addGestureListener(ZoomProcessor.class, new DefaultZoomAction());
   
    //2 finger pan gesture
    MTTextArea backgroundPan = new MTTextArea(mtApplication, font);
    backgroundPan.setFillColor(new MTColor(150,150,150));
    backgroundPan.setNoFill(true);
    backgroundPan.setNoStroke(true);
    backgroundPan.setText("Pan anywhere on the background!");
    backgroundPan.setPickable(false);
    this.getCanvas().addChild(backgroundPan);
    backgroundPan.setPositionGlobal(new Vector3D(app.width/2f, app.height/2f + 1*verticalPad,0));
    getCanvas().registerInputProcessor(new PanProcessorTwoFingers(app));
    getCanvas().addGestureListener(PanProcessorTwoFingers.class, new DefaultPanAction());
   
    //Add component multi-touch gestures
    MTTextArea dragOnly = new MTTextArea(mtApplication, font);
    dragOnly.setFillColor(textAreaColor);
    dragOnly.setStrokeColor(textAreaColor);
    dragOnly.setText("Drag me!");
    this.clearAllGestures(dragOnly);
    dragOnly.registerInputProcessor(new DragProcessor(app));
    dragOnly.addGestureListener(DragProcessor.class, new DefaultDragAction());
    dragOnly.addGestureListener(DragProcessor.class, new InertiaDragAction()); //Add inertia to dragging
    this.getCanvas().addChild(dragOnly);
   
    MTTextArea rotateOnly = new MTTextArea(mtApplication, font);
    rotateOnly.setFillColor(textAreaColor);
    rotateOnly.setStrokeColor(textAreaColor);
    rotateOnly.setText("Rotate me!");
    this.clearAllGestures(rotateOnly);
    rotateOnly.registerInputProcessor(new RotateProcessor(app));
    rotateOnly.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
    this.getCanvas().addChild(rotateOnly);
    rotateOnly.setAnchor(PositionAnchor.UPPER_LEFT);
    rotateOnly.setPositionGlobal(new Vector3D(0, verticalPad,0));
   
    MTTextArea scaleOnly = new MTTextArea(mtApplication, font);
    scaleOnly.setFillColor(textAreaColor);
    scaleOnly.setStrokeColor(textAreaColor);
    scaleOnly.setText("Scale me!");
    this.clearAllGestures(scaleOnly);
    scaleOnly.registerInputProcessor(new ScaleProcessor(app));
    scaleOnly.addGestureListener(ScaleProcessor.class, new DefaultScaleAction());
    this.getCanvas().addChild(scaleOnly);
    scaleOnly.setAnchor(PositionAnchor.UPPER_LEFT);
    scaleOnly.setPositionGlobal(new Vector3D(0, 2*verticalPad,0));
   
    MTTextArea dragAndRotate = new MTTextArea(mtApplication, font);
    dragAndRotate.setFillColor(textAreaColor);
    dragAndRotate.setStrokeColor(textAreaColor);
    dragAndRotate.setText("Drag and Rotate me!");
    this.clearAllGestures(dragAndRotate);
    dragAndRotate.registerInputProcessor(new RotateProcessor(app));
    dragAndRotate.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
    dragAndRotate.registerInputProcessor(new DragProcessor(app));
    dragAndRotate.addGestureListener(DragProcessor.class, new DefaultDragAction());
    this.getCanvas().addChild(dragAndRotate);
    dragAndRotate.setAnchor(PositionAnchor.UPPER_LEFT);
    dragAndRotate.setPositionGlobal(new Vector3D(0, 3*verticalPad,0));
   
    MTTextArea dragAndScale = new MTTextArea(mtApplication, font);
    dragAndScale.setFillColor(textAreaColor);
    dragAndScale.setStrokeColor(textAreaColor);
    dragAndScale.setText("Drag and Scale me!");
    this.clearAllGestures(dragAndScale);
    dragAndScale.registerInputProcessor(new ScaleProcessor(app));
    dragAndScale.addGestureListener(ScaleProcessor.class, new DefaultScaleAction());
    dragAndScale.registerInputProcessor(new DragProcessor(app));
    dragAndScale.addGestureListener(DragProcessor.class, new DefaultDragAction());
    this.getCanvas().addChild(dragAndScale);
    dragAndScale.setAnchor(PositionAnchor.UPPER_LEFT);
    dragAndScale.setPositionGlobal(new Vector3D(0, 8*verticalPad,0));
   
    MTTextArea rotateAndScale = new MTTextArea(mtApplication, font);
    rotateAndScale.setFillColor(textAreaColor);
    rotateAndScale.setStrokeColor(textAreaColor);
    rotateAndScale.setText("Rotate and Scale me!");
    this.clearAllGestures(rotateAndScale);
    rotateAndScale.registerInputProcessor(new ScaleProcessor(app));
    rotateAndScale.addGestureListener(ScaleProcessor.class, new DefaultScaleAction());
    rotateAndScale.registerInputProcessor(new RotateProcessor(app));
    rotateAndScale.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
    this.getCanvas().addChild(rotateAndScale);
    rotateAndScale.setAnchor(PositionAnchor.UPPER_LEFT);
    rotateAndScale.setPositionGlobal(new Vector3D(0,9*verticalPad,0));
   
    MTTextArea dragRotScale = new MTTextArea(mtApplication, font);
    dragRotScale.setFillColor(textAreaColor);
    dragRotScale.setStrokeColor(textAreaColor);
    dragRotScale.setText("Drag, Rotate and Scale me!");
    this.clearAllGestures(dragRotScale);
    dragRotScale.registerInputProcessor(new ScaleProcessor(app));
    dragRotScale.addGestureListener(ScaleProcessor.class, new DefaultScaleAction());
    dragRotScale.registerInputProcessor(new RotateProcessor(app));
    dragRotScale.addGestureListener(RotateProcessor.class, new DefaultRotateAction());
    dragRotScale.registerInputProcessor(new DragProcessor(app));
    dragRotScale.addGestureListener(DragProcessor.class, new DefaultDragAction());
    this.getCanvas().addChild(dragRotScale);
    dragRotScale.setAnchor(PositionAnchor.UPPER_LEFT);
    dragRotScale.setPositionGlobal(new Vector3D(0,10*verticalPad,0));
   
    //Tap gesture
    final MTTextArea tapOnly = new MTTextArea(mtApplication, font);
    tapOnly.setFillColor(textAreaColor);
    tapOnly.setStrokeColor(textAreaColor);
    tapOnly.setText("Tap me! ---");
    this.clearAllGestures(tapOnly);
    tapOnly.registerInputProcessor(new TapProcessor(app));
    tapOnly.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
        switch (te.getId()) {
        case MTGestureEvent.GESTURE_DETECTED:
          tapOnly.setFillColor(new MTColor(220,220,220,255));
          break;
        case MTGestureEvent.GESTURE_UPDATED:
          break;
        case MTGestureEvent.GESTURE_ENDED:
          if (te.isTapped()){
            if (tapOnly.getText().endsWith("--"))
              tapOnly.setText("Tap me! -|-");
            else
              tapOnly.setText("Tap me! ---")
          }
          tapOnly.setFillColor(textAreaColor);
          break;
        }
        return false;
      }
    });
    this.getCanvas().addChild(tapOnly);
    tapOnly.setAnchor(PositionAnchor.UPPER_LEFT);
    tapOnly.setPositionGlobal(new Vector3D(1*horizontalPad,0,0));
   
    //Double Tap gesture
    final MTTextArea doubleTap = new MTTextArea(mtApplication, font);
    doubleTap.setFillColor(textAreaColor);
    doubleTap.setStrokeColor(textAreaColor);
    doubleTap.setText("Double Tap me! ---");
    this.clearAllGestures(doubleTap);
    doubleTap.registerInputProcessor(new TapProcessor(app, 25, true, 350));
    doubleTap.addGestureListener(TapProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapEvent te = (TapEvent)ge;
        if (te.isDoubleTap()){
          if (doubleTap.getText().endsWith("--"))
            doubleTap.setText("Double Tap me! -|-");
          else
            doubleTap.setText("Double Tap me! ---")
        }
        return false;
      }
    });
    this.getCanvas().addChild(doubleTap);
    doubleTap.setAnchor(PositionAnchor.UPPER_LEFT);
    doubleTap.setPositionGlobal(new Vector3D(1*horizontalPad,1*verticalPad,0));
   
    //Tap and Hold gesture
    final MTTextArea tapAndHoldOnly = new MTTextArea(mtApplication, font);
    tapAndHoldOnly.setFillColor(textAreaColor);
    tapAndHoldOnly.setStrokeColor(textAreaColor);
    tapAndHoldOnly.setText("Tap&Hold me!  ---");
    this.clearAllGestures(tapAndHoldOnly);
    tapAndHoldOnly.registerInputProcessor(new TapAndHoldProcessor(app, 2000));
    tapAndHoldOnly.addGestureListener(TapAndHoldProcessor.class, new TapAndHoldVisualizer(app, getCanvas()));
    tapAndHoldOnly.addGestureListener(TapAndHoldProcessor.class, new IGestureEventListener() {
      public boolean processGestureEvent(MTGestureEvent ge) {
        TapAndHoldEvent th = (TapAndHoldEvent)ge;
        switch (th.getId()) {
        case TapAndHoldEvent.GESTURE_DETECTED:
          break;
        case TapAndHoldEvent.GESTURE_UPDATED:
          break;
        case TapAndHoldEvent.GESTURE_ENDED:
          if (th.isHoldComplete()){
            if (tapAndHoldOnly.getText().endsWith("--"))
              tapAndHoldOnly.setText("Tap&Hold me!  -|-");
            else
              tapAndHoldOnly.setText("Tap&Hold me!  ---")
          }
          break;
        default:
          break;
        }
        return false;
      }
    });
    this.getCanvas().addChild(tapAndHoldOnly);
    tapAndHoldOnly.setAnchor(PositionAnchor.UPPER_LEFT);
    tapAndHoldOnly.setPositionGlobal(new Vector3D(1*horizontalPad,2*verticalPad,0));
   
    //Arcball gesture
    MTTextArea arcballOnly = new MTTextArea(mtApplication, font);
    arcballOnly.setFillColor(textAreaColor);
    arcballOnly.setStrokeColor(textAreaColor);
    arcballOnly.setText("Arcball rotate me!");
    this.clearAllGestures(arcballOnly);
    arcballOnly.registerInputProcessor(new ArcballProcessor(app, arcballOnly));
    arcballOnly.addGestureListener(ArcballProcessor.class, new DefaultArcballAction());
    this.getCanvas().addChild(arcballOnly);
    arcballOnly.setAnchor(PositionAnchor.UPPER_LEFT);
    arcballOnly.setPositionGlobal(new Vector3D(1*horizontalPad,3*verticalPad,0));
   
    //Lasso gesture
    MTTextArea lassoUs1 = new MTTextArea(mtApplication, font);
    lassoUs1.setFillColor(textAreaColor);
    lassoUs1.setStrokeColor(textAreaColor);
    lassoUs1.setText("Lasso select us!");
    this.clearAllGestures(lassoUs1);
    this.getCanvas().addChild(lassoUs1);
    lassoUs1.setAnchor(PositionAnchor.UPPER_LEFT);
    lassoUs1.setPositionGlobal(new Vector3D(1f*horizontalPad,8*verticalPad,0));
   
    MTTextArea lassoUs2 = new MTTextArea(mtApplication, font);
    lassoUs2.setFillColor(textAreaColor);
    lassoUs2.setStrokeColor(textAreaColor);
    lassoUs2.setText("Lasso select us!");
    this.clearAllGestures(lassoUs2);
    this.getCanvas().addChild(lassoUs2);
    lassoUs2.setAnchor(PositionAnchor.UPPER_LEFT);
    lassoUs2.setPositionGlobal(new Vector3D(1f*horizontalPad,9*verticalPad,0));
   
    MTTextArea lassoUs3 = new MTTextArea(mtApplication, font);
    lassoUs3.setFillColor(textAreaColor);
    lassoUs3.setStrokeColor(textAreaColor);
    lassoUs3.setText("Lasso select us!");
    this.clearAllGestures(lassoUs3);
    this.getCanvas().addChild(lassoUs3);
    lassoUs3.setAnchor(PositionAnchor.UPPER_LEFT);
    lassoUs3.setPositionGlobal(new Vector3D(1f*horizontalPad,10*verticalPad,0));
   
    //Create the lasso processor and add the components which can be lassoed
    LassoProcessor lassoProcessor = new LassoProcessor(app, getCanvas(), getSceneCam());
    lassoProcessor.addClusterable(lassoUs1);
    lassoProcessor.addClusterable(lassoUs2);
View Full Code Here

    comp.setNoStroke(false);
    comp.setStrokeWeight(1);
    comp.setStrokeColor(new MTColor(r, g, b, 200));
    comp.unregisterAllInputProcessors(); //Dont process input/gestures on this component
   
    MTTextArea text = new MTTextArea(app, font);
    text.appendText(new Integer(id).toString());
    text.setFillColor(new MTColor(0, 0, 0, 0));
    text.setStrokeColor(new MTColor(0, 0, 0, 0));
    text.unregisterAllInputProcessors();
    comp.addChild(text);
    text.setPositionRelativeToParent(comp.getCenterPointLocal());
    return comp;
  }
View Full Code Here

          //Flickr Keyboard
              MTKeyboard keyb = new MTKeyboard(app);
              keyb.setFillColor(new MTColor(30, 30, 30, 210));
              keyb.setStrokeColor(new MTColor(0,0,0,255));
             
              final MTTextArea t = new MTTextArea(app, FontManager.getInstance().createFont(app, "arial.ttf", 50,
                  new MTColor(0,0,0,255), //Fill color
              new MTColor(0,0,0,255))); //Stroke color
              t.setExpandDirection(ExpandDirection.UP);
          t.setStrokeColor(new MTColor(0,0 , 0, 255));
          t.setFillColor(new MTColor(205,200,177, 255));
          t.unregisterAllInputProcessors();
          t.setEnableCaret(true);
          t.snapToKeyboard(keyb);
          keyb.addTextInputListener(t);
             
              //Flickr Button for the keyboard
              MTSvgButton flickrButton = new MTSvgButton( "advanced" + MTApplication.separator +  "flickrMT" + MTApplication.separator + "data" + MTApplication.separator
              + "Flickr_Logo.svg", app);
              flickrButton.scale(0.4f, 0.4f, 1, new Vector3D(0,0,0), TransformSpace.LOCAL);
              flickrButton.translate(new Vector3D(0, 15,0));
              flickrButton.setBoundsPickingBehaviour(AbstractShape.BOUNDS_ONLY_CHECK);
             
              //Add actionlistener to flickr button
              flickrButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
              if (arg0.getSource() instanceof MTComponent){
                //MTBaseComponent clickedComp = (MTBaseComponent)arg0.getSource();
                switch (arg0.getID()) {
                case TapEvent.BUTTON_CLICKED:
                  //Get current search parameters
                      SearchParameters sp = new SearchParameters();
                      //sp.setSafeSearch("213on");
                      /*
                      DateFormat dateFormat = new SimpleDateFormat ("yyyy/MM/dd HH:mm:ss");
                      java.util.Date date = new java.util.Date ();
                      String dateStr = dateFormat.format (date);
                      System.out.println("Date: " + dateStr);
                      try{
                        Date date2 = dateFormat.parse (dateStr);
                        sp.setInterestingnessDate(date2);
                      }catch(ParseException pe){
                        pe.printStackTrace();
                      }
                      */
                     
                      //sp.setMachineTags(new String[]{"geo:locality=\"san francisco\""});
                      sp.setText(t.getText());
                      //sp.setTags(new String[]{t.getText()});
                      sp.setSort(SearchParameters.RELEVANCE);
                     
                      System.out.println("Flickr search for: \"" + t.getText() + "\"");
                     
                      //Load flickr api key from file
                      String flickrApiKey = "";
                      String flickrSecret = "";
                      Properties properties = new Properties();
                      try {
                        InputStream in = null;
                        try {
                          in = new FileInputStream( "examples" + MTApplication.separator + "advanced" + MTApplication.separator + "flickrMT" + MTApplication.separator + "data" + MTApplication.separator + "FlickrApiKey.txt");
                    } catch (Exception e) {
                      System.err.println(e.getLocalizedMessage());
                    }
                   
                        if (in == null){
                          try {
                            in = Thread.currentThread().getContextClassLoader().getResourceAsStream("advanced" + MTApplication.separator + "flickrMT" + MTApplication.separator + "data" + MTApplication.separator + "FlickrApiKey.txt");
                      } catch (Exception e) {
                        System.err.println(e.getLocalizedMessage());
                      }
                        }
                        properties.load(in);

                        flickrApiKey = properties.getProperty("FlickrApiKey", " ");
                        flickrSecret = properties.getProperty("FlickrSecret", " ");
                    } catch (Exception e) {
                      System.err.println("Error while loading FlickrApiKey.txt file.");
                      e.printStackTrace();
                     
                    }
                     
                      //Create flickr loader thread
                      final FlickrMTFotoLoader flickrLoader = new FlickrMTFotoLoader(app, flickrApiKey, flickrSecret, sp, 300);
                      flickrLoader.setFotoLoadCount(5);
                      //Define action when loader thread finished
                      flickrLoader.addProgressFinishedListener(new IMTEventListener(){
                    public void processMTEvent(MTEvent mtEvent) {
                      //Add the loaded fotos in the main drawing thread to
                      //avoid threading problems
                      registerPreDrawAction(new IPreDrawAction(){
                        public void processAction() {
                          MTImage[] fotos = flickrLoader.getMtFotos();
                          for (int i = 0; i < fotos.length; i++) {
                            MTImage card = fotos[i];
                            card.setUseDirectGL(true);
                            card.setDisplayCloseButton(true);
                            card.setPositionGlobal(new Vector3D(ToolsMath.getRandom(10, MT4jSettings.getInstance().getWindowWidth()-100), ToolsMath.getRandom(10, MT4jSettings.getInstance().getWindowHeight()-50),0 )  );
                            card.scale(0.6f, 0.6f, 0.6f, card.getCenterPointLocal(), TransformSpace.LOCAL);
                            card.addGestureListener(DragProcessor.class, new InertiaDragAction());
                            lassoProcessor.addClusterable(card); //make fotos lasso-able
                            pictureLayer.addChild(card);
                          }
                          progressBar.setVisible(false);
                        }
                       
                        public boolean isLoop() {
                          return false;
                        }
                      });
                    }
                      });
                      progressBar.setProgressInfoProvider(flickrLoader);
                      progressBar.setVisible(true);
                      //Run the thread
                      flickrLoader.start();
                      //Clear textarea
                      t.clear();
                  break;
                default:
                  break;
                }
              }
View Full Code Here

    this.setClearColor(new MTColor(188, 150, 146, 255));
   
    this.registerGlobalInputProcessor(new CursorTracer(mtApp, this));
   
    //Create a textfield
    MTTextArea textField = new MTTextArea(mtApplication, FontManager.getInstance().createFont(mtApplication, "arial.ttf",
        50, new MTColor(255, 255, 255, 255), new MTColor(255, 255, 255, 255)));
    textField.setNoFill(true);
    textField.setNoStroke(true);
    textField.setText("Scene 2");
    this.getCanvas().addChild(textField);
    textField.setPositionGlobal(new Vector3D(mtApplication.width/2f, mtApplication.height/2f));
   
    //Button to change to the previous scene on the scene stack
    PImage arrow = mtApplication.loadImage(imagePath + "arrowRight.png");
    MTImageButton previousSceneButton = new MTImageButton(arrow, mtApplication);
    previousSceneButton.setNoStroke(true);
View Full Code Here

    IFont fontArial = FontManager.getInstance().createFont(mtApplication, "arial.ttf",
        50,   //Font size
        white,  //Font fill color
        white)//Font outline color
    //Create a textfield
    MTTextArea textField = new MTTextArea(mtApplication, fontArial);
   
    textField.setNoStroke(true);
    textField.setNoFill(true);
   
    textField.setText("Hello World!");
    //Center the textfield on the screen
    textField.setPositionGlobal(new Vector3D(mtApplication.width/2f, mtApplication.height/2f));
    //Add the textfield to our canvas
    this.getCanvas().addChild(textField);
  }
View Full Code Here

    this.setClearColor(new MTColor(146, 150, 188, 255));
   
    this.registerGlobalInputProcessor(new CursorTracer(mtApp, this));
   
    //Create a textfield
    MTTextArea textField = new MTTextArea(mtApplication, FontManager.getInstance().createFont(mtApp, "arial.ttf",
        50, new MTColor(255, 255, 255, 255), new MTColor(255, 255, 255, 255)));
    textField.setNoFill(true);
    textField.setNoStroke(true);
    textField.setText("Scene 1");
    this.getCanvas().addChild(textField);
    textField.setPositionGlobal(new Vector3D(mtApp.width/2f, mtApp.height/2f));
   
    //Button to get to the next scene
    PImage arrow = mtApplication.loadImage(imagePath +  "arrowRight.png");
    MTImageButton nextSceneButton = new MTImageButton(arrow, mtApplication);
    nextSceneButton.setNoStroke(true);
View Full Code Here

TOP

Related Classes of org.mt4j.components.visibleComponents.widgets.MTTextArea$ArtificalLineBreak

Copyright © 2018 www.massapicom. 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.