Package org.mt4j.util

Examples of org.mt4j.util.MTColor


  private String svgPath =  "basic" + MTApplication.separator + "svgExample" + MTApplication.separator + "data" + MTApplication.separator;

  public SVGScene(MTApplication mtApplication, String name) {
    super(mtApplication, name);
   
    this.setClearColor(new MTColor(255, 255, 255, 255));
    //Show touches
    this.registerGlobalInputProcessor(new CursorTracer(mtApplication, this));
   
    MTSvg svg = new MTSvg(mtApplication, svgPath + "windmill.svg");
    svg.setPositionGlobal(new Vector3D(mtApplication.width/2, mtApplication.height/2,0));
View Full Code Here


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

//    this.pgraphics3D = (PGraphics3D)pApplet.g;
    if (openGl){
      this.pgl = ((PGraphicsOpenGL)pa.g);
    }
   
    this.setStrokeColor(new MTColor(0, 0, 0, 200));
    this.setFillColor(new MTColor(200, 200, 210, 200));
    this.setNoStroke(false);
    this.setDrawSmooth(true);
   
   
    this.setGestureAllowance(DragProcessor.class, false);
    this.setGestureAllowance(RotateProcessor.class, false);
    this.setGestureAllowance(ScaleProcessor.class, false);
    this.setGestureAllowance(TapProcessor.class, false);
   
    if (font == null)
      this.setDrawActionText(false);
    else
      this.setDrawActionText(true);
   
    b =  new Vector3D(this.getWidthXY(TransformSpace.RELATIVE_TO_PARENT)/2, this.getHeightXY(TransformSpace.RELATIVE_TO_PARENT)/2, 0);
   
    outerBar = new MTRectangle(0, 0, 0, 200, 30, pa);
    outerBar.setStrokeWeight(1);
//    outerBar.setNoStroke(true);
    outerBar.setStrokeColor(new MTColor(0, 0, 0, 255));
    outerBar.setFillColor(new MTColor(100, 100, 100, 200));
   
    outerBar.setGestureAllowance(DragProcessor.class, false);
    outerBar.setGestureAllowance(RotateProcessor.class, false);
    outerBar.setGestureAllowance(ScaleProcessor.class, false);
    outerBar.setGestureAllowance(TapProcessor.class, false);
   
    c = new Vector3D(b.x -  outerBar.getWidthXY(TransformSpace.RELATIVE_TO_PARENT)/2, b.y - outerBar.getHeightXY(TransformSpace.RELATIVE_TO_PARENT)/2, 0);
    outerBar.translate(c);
    outerBar.setName("MTProgressbar outer bar");
    this.addChild(outerBar);
   
    innerBar = new MTRectangle(0, 0, 0, 199, 29, pa);
    innerBar.setStrokeWeight(1);
    innerBar.setNoStroke(true);
    innerBar.setStrokeColor(new MTColor(255, 255, 255, 200));
    innerBar.setFillColor(new MTColor(250, 150, 150, 200));
   
    innerBar.setGestureAllowance(DragProcessor.class, false);
    innerBar.setGestureAllowance(RotateProcessor.class, false);
    innerBar.setGestureAllowance(ScaleProcessor.class, false);
   
View Full Code Here

        this.drawPureGl(gl);
      }
      Tools3D.endGL(renderer);
     
    }else{ //Draw with pure proccessing commands...
      MTColor fillColor = this.getFillColor();
      MTColor strokeColor = this.getStrokeColor();
      g.fill(fillColor.getR(), fillColor.getG(), fillColor.getB(), fillColor.getAlpha());
      g.stroke(strokeColor.getR(), strokeColor.getG(), strokeColor.getB(), strokeColor.getAlpha());
      g.strokeWeight(this.getStrokeWeight());

      if (MT4jSettings.getInstance().isOpenGlMode())
        if (this.isDrawSmooth())
          g.smooth();
        else      
          g.noSmooth();

      //NOTE: if noFill() and noStroke()->absolutely nothing will be drawn-even when texture is set
      if (this.isNoFill()) 
        g.noFill();
      if (this.isNoStroke())  
        g.noStroke();

      //Set the tint values
      g.tint(fillColor.getR(), fillColor.getG(), fillColor.getB(), fillColor.getAlpha());

      //handles the drawing of the vertices with the texture coordinates
      //try doing a smoothed poly outline with opengl
      if (
        MT4jSettings.getInstance().isOpenGlMode()  &&
         this.isDrawSmooth() &&
         !this.isNoStroke() &&
         !this.isUseDirectGL()
      ){
        //draw FILL of polygon, without smooth or stroke
        g.noStroke();
        g.noSmooth();
        drawWithProcessing(g);
       
        // DRAW SMOOTHED THE STROKE outline OF THE POLYGON WIHTOUT FILL OR TEXTURE
        g.smooth();
        g.noFill();
        g.stroke(strokeColor.getR(), strokeColor.getG(), strokeColor.getB(), strokeColor.getAlpha());
        drawWithProcessing(g);

        g.noSmooth();
//        //restore fill color
//        g.fill(fillColor.getR(), fillColor.getG(), fillColor.getB(), fillColor.getAlpha());
View Full Code Here

    this.setChildClip(this.clip);
    this.drawInnerBorder = true;
   
    //Add window background
    final MTRectangle windowBackGround = new MTRectangle(x, y, z, 100, 200, applet);
    windowBackGround.setFillColor(new MTColor(200,200,200,255));
    windowBackGround.setNoStroke(true);
    windowBackGround.setPickable(false);
    this.addChild(windowBackGround);
   
    this.removeAllGestureEventListeners(ScaleProcessor.class);
View Full Code Here

   */
  public MTImage(PImage texture, PApplet pApplet) {
    super(-7, -7, texture.width + 14, texture.height + 14, pApplet);
   
    image = new MTRectangle(texture, pApplet);
    image.setStrokeColor(new MTColor(255,255,255,255));
    image.setPickable(false);
    this.addChild(image);
   
    //Draw this component and its children above
    //everything previously drawn and avoid z-fighting
View Full Code Here

    float inc = degrees / (float)resolution;
   
    double cosTheta = Math.cos(theta);
    double sinTheta = Math.sin(theta);
   
    MTColor fillColor = this.getFillColor();
   
    for (int i = 0; i < resolution; i++){
      t = 0 + (i * inc);
//      float x = (float) (centerPoint.x + (radiusX * Math.cos(t) * cosTheta) //TODO remove theta stuff? oder enablen als parameter?
//            - (radiusY * Math.sin(t) * sinTheta) );
//      float y = (float) (centerPoint.y + (radiusX * Math.cos(t) * sinTheta)
//            + (radiusY * Math.sin(t) * cosTheta) );
      float x = (float) (centerPoint.x - (radiusX * Math.cos(t) * cosTheta)
          + (radiusY * Math.sin(t) * sinTheta) );
      float y = (float) (centerPoint.y - (radiusX * Math.cos(t) * sinTheta)
          - (radiusY * Math.sin(t) * cosTheta) );
     
      verts[i] = new Vertex(x, y, centerPoint.z, fillColor.getR(), fillColor.getG(), fillColor.getB(), fillColor.getAlpha());
    }
    verts[verts.length-1] = (Vertex) verts[0].getCopy(); //NEED TO USE COPY BECAUSE TEX COORDS MAY GET SCALED DOUBLE IF SAME VERTEX OBJECT!
//    System.out.println("Points: " + verts.length);
   
    //Create tex coords
View Full Code Here

extends MTClipRectangle{


  public MTListCell(float width, float height, PApplet applet) {
    super(0, 0, 0, width, height, applet);
    this.setStrokeColor(new MTColor(0,0,0));
    this.setComposite(true);
   
  }
View Full Code Here

   
    if (MT4jSettings.getInstance().isOpenGlMode())
      character.setUseDirectGL(true);

    //Color
    character.setStrokeColor(new MTColor(strokeColor.getR(), strokeColor.getG(), strokeColor.getB(), strokeColor.getAlpha()));
    character.setFillColor(new MTColor(fillColor.getR(), fillColor.getG(), fillColor.getB(), fillColor.getAlpha()));
   
    character.setStrokeWeight(0.7f);
    character.setPickable(false);
   
    if (!antiAliased){
View Full Code Here

   
    this.setNoFill(true);
    this.setPickable(true);
   
    if (MT4jSettings.getInstance().isOpenGlMode()){
      this.getGeometryInfo().generateOrUpdateBuffersLocal(new StyleInfo(new MTColor(255,255,255,255), new MTColor(startPoint.getR(), startPoint.getG(), startPoint.getB(), startPoint.getA()), this.isDrawSmooth(), this.isNoStroke(), this.isNoFill(), this.getStrokeWeight(), this.getFillDrawMode(), this.getLineStipple()));
    }
//    this.setBoundsBehaviour(AbstractShape.BOUNDS_DONT_USE);
    this.setBoundsBehaviour(BOUNDS_ONLY_CHECK);
   
    this.setName("unnamed MTLine");
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.