Package processing.core

Examples of processing.core.PApplet


 
 
 
  @SuppressWarnings("static-access")
  public static void warn(String type, String loc, String msg) {
    PApplet app = H.app();
    app.println("[Warning: "+type+" @ "+loc+"]");
    if( msg!=null && msg.length()>0 ) app.println("\t"+msg);
  }
View Full Code Here


  public void run() {
    if(_isRecording) {
      if(_end < 0) {
        if(H.app().frameCount >= _end) _isRecording = false;
      } else {
        PApplet app = H.app();
//        if(app.key )
//        _capturer = H.app().beginRecord(_renderer,_filename);
        //
      }
      if(!_isRecording) {
View Full Code Here

  public String text() {
    return _text;
  }
 
  public HText font(Object arg) {
    PApplet app = H.app();
   
    if(arg instanceof PFont) {
      _font = (PFont) arg;
    } else if(arg instanceof String) {
      String str = (String) arg;
      _font = (str.indexOf(".vlw",str.length()-4) > 0)?
        app.loadFont(str) : app.createFont(str,64);
    } else if(arg instanceof HText) {
      _font = ((HText) arg)._font;
    } else if(arg == null) {
      _font = app.createFont("SansSerif",64);
    }
    adjustMetrics();
    return this;
  }
View Full Code Here

  public float fontSize() {
    return _height;
  }
 
  private void adjustMetrics() {
    PApplet app = H.app();
    app.pushStyle();
    app.textFont(_font,(_height < 0)? -_height : _height);
   
    _descent = app.textDescent();
    _width = (_text==null)? 0 :
      (_width<0)? -app.textWidth(_text) : app.textWidth(_text);
   
    app.popStyle();
  }
View Full Code Here

    return (_extras==null)? false : _extras.bool(key);
  }
 
  @Override
  public boolean contains(float absX, float absY, float absZ) {
    PApplet app = H.app();
    absZ -= _z;
    return contains(
      app.screenX(absX,absY,absZ),
      app.screenY(absX,absY,absZ));
  }
View Full Code Here

    return containsRel(rel[0], rel[1]);
  }
 
  @Override
  public boolean containsRel(float relX, float relY, float relZ) {
    PApplet app = H.app();
    relZ -= _z;
    return containsRel(
      app.screenX(relX,relY,relZ),
      app.screenY(relX,relY,relZ));
  }
View Full Code Here

        if (args.size() % 2 == 1 || args.contains("--help") || args.contains("-h")) {
            usage();
            return;
        }

        PApplet processing = new PApplet();

        processing.init();
        processing.start();

        try {
            WordCram wordCram = new WordCram(processing)
                    .fromTextString(PApplet.loadStrings(System.in))
                    .withColorer(Colorers.twoHuesRandomSats(processing))
                    .withAngler(Anglers.mostlyHoriz())
                    .withWordPadding(4)
                    .withPlacer(Placers.centerClump());

            ImageConfiguration imageConfig = parseArgs(args, wordCram);

            PGraphics image = processing.createGraphics(imageConfig.width, imageConfig.height, JAVA2D);
            try {
                wordCram.withCustomCanvas(image);

                image.beginDraw();
                wordCram.drawAll();
                image.endDraw();

                image.save(imageConfig.fileName);

            } finally {
                image.dispose();
            }

            processing.stop();
            System.exit(0);

        } catch (Throwable t) {
            System.err.println(t.getMessage());
            System.exit(1);
View Full Code Here

    super("Embedded PApplet");

    setLayout(new BorderLayout());
    setSize(1200, 700); // setup and OPENGL window

    PApplet p5sketch = new main();
    add(p5sketch, BorderLayout.CENTER);
   
    /*
    PApplet p5UIFrame = new UIFrame();
    add(p5UIFrame,BorderLayout.SOUTH);
*/
   
   
    GLOBAL.frame = this;
    //p5UIFrame.init();
    p5sketch.init();
    show();
    //p5sketch.setup();

    // allow window and application to be closed
    addWindowListener(new WindowAdapter() {
View Full Code Here

  PApplet _sketch;
 
  @Before
  public void setUp() {
    _sketch = new PApplet();
    Hermes.setPApplet(_sketch);
  }
View Full Code Here

   
  }
 
  @Before
  public void setup() {
    PApplet applet = new PApplet();
    applet.g = new PGraphics();
    Hermes.setPApplet(applet);
    applet.rectMode(PApplet.CENTER);
  }
View Full Code Here

TOP

Related Classes of processing.core.PApplet

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.