Package org.mt4j.util

Examples of org.mt4j.util.MTColor


  private TouchTailComponent tails;
 
  public TouchTailScene(MTApplication mtApplication, String name) {
    super(mtApplication, name);
    this.mtApp = mtApplication;
    this.setClearColor(new MTColor(140, 140, 110, 255));
   
    //Create tail component
    tails = new TouchTailComponent(mtApp);
    this.getCanvas().addChild(tails);
   
View Full Code Here


    exists = false;
    jumpDx = 0;
    jumpDy = 0;
   
//    this.color = new MTColor(Tools3D.getRandom(50, 255), Tools3D.getRandom(50, 255), Tools3D.getRandom(50, 255), 255);
    this.color = new MTColor(ToolsMath.getRandom(0, 255), ToolsMath.getRandom(0, 255), ToolsMath.getRandom(0, 255), 255);
  }
View Full Code Here

  private Map<Integer, AbstractShape> fiducialIDToComp;
 
  public FiducialScene(MTApplication mtApplication, String name) {
    super(mtApplication, name);
    this.app = mtApplication;
    this.setClearColor(new MTColor(220, 220, 200, 255));
   
    //Listen to _all_ fiducial events
    RawFiducialProcessor fiducialProcessor = new RawFiducialProcessor();
    fiducialProcessor.addProcessorListener(this);
    registerGlobalInputProcessor(fiducialProcessor);
   
    //Maps the fiducial IDs to the visible component so we can keep track
    fiducialIDToComp = new HashMap<Integer, AbstractShape>();
   
    font = FontManager.getInstance().createFont(app, "arial.ttf", 30,
        new MTColor(255,255,255,255), //Fill color
        new MTColor(255,255,255,255)); //Stroke color
  }
View Full Code Here

    MTEllipse comp = new MTEllipse(app, new Vector3D(pos), 50,50, 50);
    comp.setNoFill(false);
    float r = ToolsMath.getRandom(20, 255);
    float g = ToolsMath.getRandom(20, 255);
    float b = ToolsMath.getRandom(20, 255);
    comp.setFillColor(new MTColor(r, g, b, 200));
    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

  public Scene3(MTApplication mtApplication, String name) {
    super(mtApplication, name);
    this.mtApp = mtApplication;
   
    //Set the background color
    this.setClearColor(new MTColor(150, 188, 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 3");
    this.getCanvas().addChild(textField);
    textField.setPositionGlobal(new Vector3D(mtApplication.width/2f, mtApplication.height/2f));
View Full Code Here

          //we should wrap the actions into an invokeLater runnable which
          //will be executed the next time the mt4j thread runs.
          instance.invokeLater(new Runnable() {
            public void run() {
              MTRectangle r = new MTRectangle(0,0,ToolsMath.getRandom(50, 250),ToolsMath.getRandom(50, 250), instance);
              r.setFillColor(new MTColor(ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255)));
              r.addGestureListener(DragProcessor.class, new InertiaDragAction());
              instance.getCurrentScene().getCanvas().addChild(r);
              r.setPositionGlobal(new Vector3D(ToolsMath.getRandom(0, instance.width), ToolsMath.getRandom(0, instance.height)));
            }
          });
         
        }
      }
    });
        menu.add(addRectItem);
       
        JMenuItem addRoundRectItem = new JMenuItem("MTRoundRectangle", KeyEvent.VK_E);
        addRoundRectItem.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        if (instance.getCurrentScene() != null){
          //If we want to modify the MT4j applet from the swing thread
          //we should wrap the actions into an invokeLater runnable which
          //will be executed the next time the mt4j thread runs.
          instance.invokeLater(new Runnable() {
            public void run() {
              float arc = ToolsMath.getRandom(8, 25);
              MTRoundRectangle r = new MTRoundRectangle(0,0,0, ToolsMath.getRandom(50, 250),ToolsMath.getRandom(50, 250), arc, arc, instance);
              r.setFillColor(new MTColor(ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255)));
              r.addGestureListener(DragProcessor.class, new InertiaDragAction());
              instance.getCurrentScene().getCanvas().addChild(r);
              r.setPositionGlobal(new Vector3D(ToolsMath.getRandom(0, instance.width), ToolsMath.getRandom(0, instance.height)));
            }
          });
         
        }
      }
    });
        menu.add(addRoundRectItem);
       
        JMenuItem addEllItem = new JMenuItem("MTEllipse", KeyEvent.VK_E);
        addEllItem.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        if (instance.getCurrentScene() != null){
          //If we want to modify the MT4j applet from the swing thread
          //we should wrap the actions into an invokeLater runnable which
          //will be executed the next time the mt4j thread runs.
          instance.invokeLater(new Runnable() {
            public void run() {
              MTEllipse e = new MTEllipse(instance, new Vector3D(0,0), ToolsMath.getRandom(50, 150),ToolsMath.getRandom(50, 150));
              e.setFillColor(new MTColor(ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255)));
              e.addGestureListener(DragProcessor.class, new InertiaDragAction());
              instance.getCurrentScene().getCanvas().addChild(e);
              e.setPositionGlobal(new Vector3D(ToolsMath.getRandom(0, instance.width), ToolsMath.getRandom(0, instance.height)));
            }
          });
View Full Code Here

  public Scene2(MTApplication mtApplication, String name) {
    super(mtApplication, name);
    this.mtApp = mtApplication;
   
    //Set the background color
    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));
View Full Code Here

    CursorTracer c = new CursorTracer(mtApplication, this);
    registerGlobalInputProcessor(c);
    int count = 2;
    for (int i = 0; i < count; i++) {
      MTRectangle r = new MTRectangle(0,0,ToolsMath.getRandom(50, 250),ToolsMath.getRandom(50, 250),mtApplication);
      r.setFillColor(new MTColor(ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255),ToolsMath.getRandom(50,255)));
      r.addGestureListener(DragProcessor.class, new InertiaDragAction());
      getCanvas().addChild(r);
      r.setPositionGlobal(new Vector3D(ToolsMath.getRandom(0, mtApplication.width), ToolsMath.getRandom(0, mtApplication.height)));
    }
  }
View Full Code Here

public class HelloWorldScene extends AbstractScene {

  public HelloWorldScene(MTApplication mtApplication, String name) {
    super(mtApplication, name);
   
    MTColor white = new MTColor(255,255,255);
    this.setClearColor(new MTColor(146, 150, 188, 255));
    //Show touches
    this.registerGlobalInputProcessor(new CursorTracer(mtApplication, this));
   
    IFont fontArial = FontManager.getInstance().createFont(mtApplication, "arial.ttf",
        50,   //Font size
View Full Code Here

       
        //Create bitmap font character
        String StringChar = new Character(c).toString();
        BitmapFontCharacter character = new BitmapFontCharacter(charImage, pa, StringChar, leftExtend, topOffset, widthDisplacement);
        character.setName(StringChar);
        character.setFillColor(new MTColor(fillColor));
        if (MT4jSettings.getInstance().isOpenGlMode()){
          character.generateAndUseDisplayLists();
        }
        bitMapCharacters.add(character);
        //logger.debug("Char: " + c + " charWidth: " + charWidth +  " leftExtend: " + leftExtend + " widthDisplacement: " + widthDisplacement + " imageHeight: " + charImage.height + " charHeight: " + charHeight +  " topExtent: " + topExtend);
View Full Code Here

TOP

Related Classes of org.mt4j.util.MTColor

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.