Menu In Processing

edited May 2015 in How To...

Hello,

I'm trying to put together a Menu for applications exported Processing, but I'm having trouble, I'll try to explain.

For example, I exported several sketches for Windows application (application for Export option), when I open executable by Windows Explorer, works normal perfectly.

But when I try to use another program to make the call executable, does not open, for example, created a program in Delphi to make the call of the executable in processing, to use only a set menu.

The question then would be: It is possible through the Processing using multiple independent sketches? I could create a type of menu, just to make the call to other programs?

Thanks in advance and excuse the English, I'm escrenvendo with the help of Google translator ...

Thanks,

Answers

  • Hello again,

    Trying to better convey the idea annexed is the program print I made in Delphi, just to make the call to the executable as select the picture, open the animation ...

    I did some tests with openFrameworks, works well to make the call, but had some problems to work using shapes, design quality was not as good as in Processing, so the idea of creating a direct Menu it ...

    Thank you,

    Menu_Exemplo

  • Hello, I again ...

    Moving on previous experience, I tried to use a menu options using the Controlp5 library, even managed to do something, but the code was getting too complicated to manipulate the extent that increased the options.

    So the idea of letting each separate sketch, the medium I found was exporting, and then do something to make the call of each independent.

    So would program01, program02, program03 ... etc ..

    Ha yes, this project aims to be a "kind of workshop" where the idea is to give chance to a person who has restricted movement (in a wheelchair for example) and with minimal movement, through the Arduino or direct the processing, connecting devices to interact, thus giving the possibility of "a bit of fun", and even assist in physical therapy ...

    Thank you very much for now ...

    Menu_Exemplo_Ant

  • Answer ✓

    I was reading this a few times now and still hard to grasp what you want---

    • you can use open() to run an exe-file (under windows they are called this) so your menu would have different open() calls to other sketches you already exported (paths must be full and right)

    • you can join your sketches into one. All classes all functions. One setup() where you join all previous setups and one draw() where the menu decides which sub-sketch to run.... using states.

    when you want I can provide a demo

    ;-)

  • Hello,

    Thanks for the feedback, truly believe that should have had some trouble understanding what I'm trying to say, it's the same when I translate the original texts in English ... My native language is Portuguese, I live in Brazil ...

    Anyway, but you get exactly what I'm intending to do, which is to create a Menu to call the various scketch separately.

    I tried to do in a single sketch, with control by choice (states) but it gets a little complicated to deal with all this, as it increases the options.

    I managed to solve the problem by exporting each sketch, and then built a program just to make the call, and is working as expected.

    Annex has a print of how was the application, each image draws the corresponding schetch, and ease of use ...

    Many of the sample took the OpenProcessing site ...

    Thank you,PrintScreen01

  • Answer ✓

    so you made it!

    Great!

  • Answer ✓

    I managed to solve the problem by exporting each sketch, and then built a program just to make the call, and is working as expected.

    Can you show us the program that you built just to make the call?

    ;-)

  • tchii eu tambem tenho esse problema, mete ai o codigo please!!

  • Hello Chrisir,

    It was a middle solution "improvised", after all did the Menus in Delphi (which is a language that I schedule some time, I'm starting with Processing), calling each exe exported by Processing ... but it was functional ...

    Thanks for the feedback,

    thank you

  • Sorry, I did not understand what they wanted ...

    In fact I did it in Delphi, which is relatively simple, because in Delphi has the ease of working with native components, to call to other programs, split tabs, etc ...

    But in Processing we have the facildade to work with animation / interaction, so to use what one has to "best" ...

    I do not know if it will help ... but I'm leaving attached the sources, it was compiled in Delphi 2006, but may be in another version.

    Each sketch in Processing was exported (In File menu, Export Application), and in Delphi I called each as "click" on the image.

    I set a folder where the exported executable, in my case is in:

    'D:\Projetos\Exe\Processing'

    No caso esta pasta ( Processing ) se observarem, além dos executáveis, tem a pasta lib, que são os arquivos .jar

    Annex are also executable exported Processing, as well as the sources ... as mentioned before, most sources are extracted from OpenPrecessing site.

    Notes: The examples that use Kinect is not opening the exported executable, must be direct even to the Processing function.

    And as I said, excuse my english ... in verdar is google translator ...

    If you need help, I will gladly share something that can help ...

    Thank you,

  • thank you!

    ;-)

  • Hmmm ... is to attach files in Post?

    It means "ugly" so the code in Delphi, but I'll put here ... in the case would have to create a project in Delphi, and "Paste" this code in the form (pas) ...

    If quizerem to send the attached project, ask this email: j.aparecido.p@gmail.com

    Code in Delphi

    unit UMenu;

    interface

    uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Buttons, ExtCtrls, StdCtrls, ComCtrls, jpeg, ShellApi;

    type TfrmMenu = class(TForm) PageControl1: TPageControl; TabSheet1: TTabSheet; lblTitulo: TLabel; ScrollBox1: TScrollBox; TabSheet2: TTabSheet; Panel3: TPanel; Image2: TImage; Panel1: TPanel; Image3: TImage; Panel2: TPanel; Label2: TLabel; Panel4: TPanel; Image1: TImage; Panel5: TPanel; Image4: TImage; Panel7: TPanel; Image6: TImage; Panel8: TPanel; Image7: TImage; TabSheet3: TTabSheet; TabSheet4: TTabSheet; TabSheet5: TTabSheet; Panel9: TPanel; Image8: TImage; Panel10: TPanel; Image9: TImage; Panel11: TPanel; Image10: TImage; Panel12: TPanel; Image11: TImage; Panel16: TPanel; Image15: TImage; Panel17: TPanel; Image16: TImage; Panel6: TPanel; Image5: TImage; Panel20: TPanel; Image19: TImage; Panel21: TPanel; Image20: TImage; Panel14: TPanel; Image13: TImage; Panel13: TPanel; Image99: TImage; procedure Image99Click(Sender: TObject); procedure Image13Click(Sender: TObject); procedure Image20Click(Sender: TObject); procedure Image19Click(Sender: TObject); procedure Image5Click(Sender: TObject); procedure Image15Click(Sender: TObject); procedure Image14Click(Sender: TObject); procedure Image12Click(Sender: TObject); procedure Image11Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Image10Click(Sender: TObject); procedure Image9Click(Sender: TObject); procedure Image8Click(Sender: TObject); procedure Image7Click(Sender: TObject); procedure Image6Click(Sender: TObject); procedure Image4Click(Sender: TObject); procedure Image1Click(Sender: TObject); procedure FormKeyPress(Sender: TObject; var Key: Char); procedure Image2Click(Sender: TObject); procedure Image3Click(Sender: TObject); private { Private declarations } function ExecExplorer(OpenAtPath: string; OpenWithExplorer, OpenAsRoot: Boolean): Boolean; procedure CloseForm(Caption: String); procedure ExecutaPrograma(sExecutavel, sCaminho: String); public { Public declarations } end;

    var frmMenu: TfrmMenu; sCaminho: String;

    implementation

    {$R *.dfm}

    procedure TfrmMenu.FormCreate(Sender: TObject); begin sCaminho := 'D:\Projetos\Exe\Processing'; end;

    procedure TfrmMenu.FormKeyPress(Sender: TObject; var Key: Char); begin if Key = #13 then begin if not ( ActiveControl is TMemo ) then begin Key := #0; Perform( WM_NEXTDLGCTL,0,0 ); end; end else if Key = #27 then begin if MessageDlg('Confirma a Saída?', mtConfirmation, [mbYes, mbNo], 1) = mrYes then Close; end; end;

    procedure TfrmMenu.Image10Click(Sender: TObject); begin ExecutaPrograma('asteroids.exe', sCaminho); end;

    procedure TfrmMenu.Image11Click(Sender: TObject); begin ExecutaPrograma('Objetos_Ellipse01.exe', sCaminho); end;

    procedure TfrmMenu.Image12Click(Sender: TObject); begin //ExecutaPrograma('Exemplo03.exe', sCaminho); ExecExplorer('D:\Kinect\Exemplos\Processing\Exemplo03\', True, True); end;

    procedure TfrmMenu.Image13Click(Sender: TObject); begin ExecutaPrograma('Analisador_de_Sinal.exe', sCaminho); end;

    procedure TfrmMenu.Image14Click(Sender: TObject); begin //ExecutaPrograma('Movimento_Dedos01.exe', sCaminho); ExecExplorer('D:\Kinect\Processing\Movimento_Dedos01\', True, True); end;

    procedure TfrmMenu.Image15Click(Sender: TObject); begin ExecutaPrograma('Ellipse_Aceleracao02.exe', sCaminho); end;

    procedure TfrmMenu.Image19Click(Sender: TObject); begin //ExecutaPrograma('Movimento_Dedos01.exe', sCaminho); ExecExplorer('D:\Kinect\Processing\Movimento_Corpo02\', True, True); end;

    procedure TfrmMenu.Image1Click(Sender: TObject); begin ExecutaPrograma('Formas_Arte01.exe', sCaminho); end;

    procedure TfrmMenu.Image20Click(Sender: TObject); begin ExecutaPrograma('Efeito_Som01.exe', sCaminho); end;

    procedure TfrmMenu.Image2Click(Sender: TObject); begin try //lblTitulo.Enabled := False; //lblOpcao.Caption := 'Interação Ellipse';

    //ExecutaPrograma('Ellipse_Interacao.exe', 'D:\Projetos\Exe\Processing');
    ExecutaPrograma('Ellipse_Interacao.exe', sCaminho);
    //MessageDlg( 'Pressione ENTER ou Selecione OK para Continuar...',mtInformation,[mbOK],0 );
    

    finally //lblTitulo.Enabled := True; //lblOpcao.Caption := ''; end; end;

    procedure TfrmMenu.Image3Click(Sender: TObject); begin try //lblTitulo.Enabled := False; //lblOpcao.Caption := 'Pressione a Tecla R para recomeçar...'; //lblOpcao.Refresh;

    ExecutaPrograma('Ellipse_BolaQuicando.exe', sCaminho);
    //MessageDlg( 'Pressione ENTER ou Selecione OK para Continuar...',mtInformation,[mbOK],0 );
    

    finally //lblTitulo.Enabled := True; //lblOpcao.Caption := ''; end; end;

    procedure TfrmMenu.Image4Click(Sender: TObject); begin ExecutaPrograma('Formas_Artes03.exe', sCaminho); end;

    procedure TfrmMenu.Image5Click(Sender: TObject); begin //ExecutaPrograma('Movimento_Dedos01.exe', sCaminho); ExecExplorer('D:\Kinect\Processing\Movimento_Corpo01\', True, True); end;

    procedure TfrmMenu.Image6Click(Sender: TObject); begin ExecutaPrograma('Formas04.exe', sCaminho); end;

    procedure TfrmMenu.Image7Click(Sender: TObject); begin ExecutaPrograma('Ellipse_Aceleracao.exe', sCaminho); end;

    procedure TfrmMenu.Image8Click(Sender: TObject); begin ExecutaPrograma('Animacao_Interacao.exe', sCaminho); end;

    procedure TfrmMenu.Image99Click(Sender: TObject); begin ExecutaPrograma('Animacao_Interacao.exe', sCaminho); end;

    procedure TfrmMenu.Image9Click(Sender: TObject); begin ExecutaPrograma('fireworks01.exe', sCaminho); end;

    procedure TfrmMenu.ExecutaPrograma( sExecutavel, sCaminho: String); begin try ShellExecute (Application.Handle, 'open', PChar(sExecutavel), '', PChar(sCaminho), SW_SHOWNORMAL); //SW_SHOWMAXIMIZED except MessageDlg( 'Erro ao Abrir Programa! Tente novamente...',mtInformation,[mbOK],0 ); end; end;

    function TfrmMenu.ExecExplorer(OpenAtPath: string; OpenWithExplorer, OpenAsRoot: Boolean): Boolean; var s : string; begin if OpenWithExplorer then begin if OpenAsRoot then s := ' /e,/root,"' + OpenAtPath + '"' else s := ' /e,"' + OpenAtPath + '"'; end else s := '"' + OpenAtPath + '"';

    Result := ShellExecute(Application.Handle, PChar('open'), PChar('explorer.exe'), PChar(s), nil, SW_NORMAL) > 32; end;

    procedure TfrmMenu.CloseForm(Caption: String); var h: THandle; begin while (True) do begin h := FindWindow(nil, PChar(Caption));

    if (h <> 0) then
    begin
      PostMessage(h, WM_CLOSE, 0, 0);
      Break;
    end;
    
    if (h = 0) then
      Break;
    

    end; end;

    { //Testes para abertura de executável

    //Abrindo a calculadora do windows
    //ShellExecute (Application.Handle, 'open', 'calc.exe', '', nil, SW_SHOWNORMAL);
    
    //winexec('D:\Processing\Exe\Ellipse01\Ellipse_BolaQuicando.exe', 1);
    //ExecExplorer('D:\Projetos\', True, True);
    //CloseForm('Projetos');
    
     Fonte : http://showdelphi.com.br/dica-como-abrir-o-windows-explorer-em-uma-pasta-especifica-delphi/
      Handle da aplicação, Instrução, open para abrir,  Arquivo a ser aberto,
      parâmetros para a chamada do arquivo (exe, jar, etc),
      Diretório, geralmente informo nil,
      Formato da janela: normal, maximizada, minimizada, oculta e etc
    
      //ShowMessage(PChar(ExtractFilePath(Application.ExeName)));
    
      //ShellExecute(Application.Handle, 'open',
      //  PChar(ExtractFilePath(Application.ExeName) + sExecutavel),
      //  nil, nil, SW_SHOWNORMAL);
    

    }

    end.>

    Unfortunately did not yield to send the attachment, to see how the test was, but as I said, if there is any way to send attachment on the site, please report thus gives to get a better idea.

    Sincerely,

  • thank you!

  • Hello Chrisir,

    I'm trying to make this menu Call in Java, may be more familiar for those who program in Processing, if it works well, then post here ...

  • Perhaps you should take a peek at @druid's discussion for other multiple windows techniques:
    http://forum.processing.org/two/discussion/10937/multiple-sketches

  • Hello,

    Thanks for the tip, appears to be functional in this way, I better study the code ...

    Actually, I was thinking of putting together a sketch menu only, may be able to leave each call a new "tab" separate, and call each one on an individual moment.

    I will check better, then post the results here ...

    thank you very much

  • Hello Chrisir,

    Thanks for return again ... so it was much more "clean" code, can you use perfectly.

    One question in the case when you use buttons, you can load an image "inside" of it?

    ... Just as observations, I made a controlled program option (state) as earlier suggestion, got a little "monster", but it was pretty cool operation, has four options, which changes some things, sharing the same class.

    It is that also put the libraries to capture audio from the microphone, Kinect, and all simultaneously by was slightly complex code ...

    This way gives to organize better, and let the friendliest code ...

    Thanks,

    Thanks a lot!

  • you can load images in the buttons...

  • Hello Chrisir,

    Thanks for the link to the example ...

    Maybe I did not express myself well, what you mean is whether the Menu button could be used, a close example of this is how this other link that you indicated:

    http://www.openprocessing.org/sketch/77843

    But from what you can see, does not use button, but rectangles .. although in practice it seems are similar, in another example, it seems to give better control the application.

    I will try to adapt in this way in the programs I'm doing, then post here some news.

    thank you very much

  • Answer ✓

    you can also use image()

  • Hello Chrisir,

    Sorry, only post now ...

    The idea is that, instead of text on the button, use an image thus intuitively, the person choose the option you want.

    I'm adapting the model you suggested, then you could do something more concrete

    thank you very much

  • here comes a version with images.

    the images must be in the sketch folder.

    they must be called 0.jpg, 1.jpg, 2.jpg (exactly like that)

    did you mean that?

    ;-)

    // states -------------------------------
    // consts: possible values 
    final int normal = 0;
    final int program0 = 1;
    final int program1 = 2;
    final int program2 = 3;
    int state = normal; // var: current value
    
    // buttons --------------------------
    Button[] buttons;
    
    // Misc for programs ------------------------------ 
    PVector helpPoint =new PVector();  // for Line etc., Point #1
    PVector helpPoint2=new PVector();  // Point #2
    PVector helpPointAdd;     // vector for moving Point #1
    PVector helpPoint2Add;    // vector for moving Point #2
    
    //-------------------------------------------------
    // the core functions 
    
    void setup() {
      size(400, 700);
    
      // these are local vars (their scope is only setup()
      int countButton = 3;
      int sizeButton = 45;
      PImage[] images = new PImage[3];
    
      // declare the array of the buttons
      buttons = new Button[countButton];
    
      // read images for the buttons --------------------------
      for (int i = 0; i < countButton; i++) {
        images[i] = loadImage(trim(str(i)) + ".jpg");
        images[i].resize(sizeButton, sizeButton);
      } // for 
    
      // creating the buttons ---------------------------
      for (int i = 0; i < countButton; i++) {
        buttons[i] = new Button(66, i*55+33, 
        sizeButton, 
        color(255, 0, 0), color(0, 255, 0), color(0, 0, 255), 
        i, 
        images[i]);
      } // for 
      //
    } // func 
    
    void draw() {
      background(0, 0, 0);
      // eval state 
      if (state==normal) {
        text("Please select one sketch to show", 17, 17);
        // short version of a for-loop
        for (Button but : buttons) {
          but.update();
          but.display();
        }
      } else if (state==program0) {
        draw0();
      } else if (state==program1) {
        draw1();
      } else if (state==program2) {
        draw2();
      } else {
        // error 
        println ("Unknown state (error #965)");
      }
    } // func 
    
    //-------------------------------------------------
    // Inputs 
    
    void mousePressed() {
      // eval state 
      if (state==program0 || state==program1 || state==program2) {
        // in the sub-sketches: go back to normal 
        state = normal;
      } else if (state==normal) {
        // in the main sketch: eval buttons 
        for (Button but : buttons) {
          but.press();
          if (but.pressed) {
            evalButton(but); 
            break; // Other buttons won't be pressed, just stop
          } // if
        } // for
      } // else if
      else {
        // error 
        println ("Unknown state (error #1065)");
      }
    } // func 
    
    void evalButton(Button but) {
      println(but.index);
      if (but.index==0) { 
        setup0(); 
        state=program0;
      } else if (but.index==1) { 
        setup1(); 
        state=program1;
      } else if (but.index==2) { 
        setup2(); 
        state=program2;
      } else {
        println ("Unknown button index (error #1165)");
      }
    } // func 
    
    void mouseReleased() {
      for (Button but : buttons) {
        but.release();
      }
    } // func 
    
    void keyPressed() {
      state=normal; // return to normal state 
      key=0; // kill escape
    } // func 
    
    // --------------------------------------------
    // the sub-sketches we want to start 
    
    void setup0() {
      initPointsForLine();
    } // func 
    
    void draw0() {
      stroke(0, 255, 0);
      line (helpPoint.x, helpPoint.y, 
      helpPoint2.x, helpPoint2.y );
      checkHelpPointsForLine();
    } // func 
    
    // ---
    
    void setup1() {
      initPointsForLine();
    } // func 
    
    void draw1() {
      stroke(0, 255, 0);
      ellipse (helpPoint.x, helpPoint.y, 10, 10);
      ellipse (helpPoint2.x, helpPoint2.y, 10, 10 );
      checkHelpPointsForLine();
    } // func 
    
    // ---
    
    void setup2() {
      initPointsForLine();
    } // func 
    
    void draw2() {
      stroke(0, 255, 0);
      rect (helpPoint.x, helpPoint.y, 
      helpPoint2.x-helpPoint.x, helpPoint2.y-helpPoint.y );
      checkHelpPointsForLine();
    } // func 
    
    // ----------------------------------------------
    // help funcs for the sub-sketches
    
    void initPointsForLine() {
      // invisible help lines on the left side leading to green line 
      helpPoint = new PVector(random(width), random(height));
      helpPoint2 = new PVector(random(width), random(height));
      helpPointAdd = new PVector(random(-2, 2), random(-2, 2));
      helpPoint2Add = new PVector(random(-2, 2), random(-2, 2));
    } // func 
    
    void checkHelpPointsForLine() {
      // lines on the left side leading to green line on page 1
      helpPoint.add(helpPointAdd);
      helpPoint2.add(helpPoint2Add);
    
      // check helpPoint ----------------------------
      helpPointAdd.x = keepInBoundary(helpPoint.x, 12, width-13, helpPointAdd.x);
      helpPointAdd.y = keepInBoundary(helpPoint.y, 13, height -13, helpPointAdd.y);
      // check helpPoint2 ----------------------------
      helpPoint2Add.x = keepInBoundary(helpPoint2.x, 12, width-13, helpPoint2Add.x);  
      helpPoint2Add.y = keepInBoundary(helpPoint2.y, 13, height -13, helpPoint2Add.y);
    } // func 
    
    float keepInBoundary(float testPoint, float lowerBoundary, float upperBoundary, float valueToAdd) {
      // Situation: testPoint is a ball position and valueToAdd gets added to it, so testPoint flies. 
      // Now testPoint must stay within lowerBoundary and upperBoundary (e.g. screen). 
      // ValueToAdd gets changed accordingly and is returned as return value.
      if (testPoint<lowerBoundary) {
        valueToAdd=abs(valueToAdd);
      }
      if (testPoint>upperBoundary) {
        valueToAdd=-1*abs(valueToAdd);
      } 
      return valueToAdd;
    } // func 
    
    
    // ------------------------------------------
    // classes 
    
    class Button {
    
      int x, y; // The x- and y-coordinates
      int size; // Dimension (width and height)
      color baseGray; // Default gray value
      color overGray; // Value when mouse is over the button
      color pressGray; // Value when mouse is over and pressed
      boolean over = false; // True when the mouse is over
      boolean pressed = false; // True when the mouse is over and pressed
      int index; // index 
      PImage img; // image 
    
      // the constructor (the underscore _ says I'm temp)
      Button(int xp_, int yp_, 
      int s_, 
      color b_, 
      color o_, 
      color p_, 
      int index_, 
      PImage img_ ) {
        x = xp_;
        y = yp_;
        size = s_;
        baseGray = b_;
        overGray = o_;
        pressGray = p_;
        index=index_;
        img=img_;
      } // the constructor 
    
      // Updates the over field every frame
      void update() {
        if ((mouseX >= x) && (mouseX <= x + size) &&
          (mouseY >= y) && (mouseY <= y + size)) {
          over = true;
        } else {
          over = false;
        }
      }
    
      boolean press() {
        if (over == true) {
          pressed = true;
          return true;
        } else {
          pressed = false;
          return false;
        }
      }
    
      void release() {
        // Set to false when the mouse is released
        pressed = false;
      }
    
      void display() {
        //    if (pressed == true) {
        //      fill(pressGray);
        //    } else if (over == true) {
        //      fill(overGray);
        //    } else {
        //      fill(baseGray);
        //    }
        // rect 
        //  stroke(255);
        //  rect(x, y, size, size);
        // image 
        image(img, x, y);  
        // text to the right
        fill(0, 255, 0);
        text(index, x+size+17, y+size/2);
      }
    }
    // ==============================================
    
  • Oh yes, perfect, exactly what we were trying to do ...

    Thank you very much for the time being, I now start developing a project, the way I was thinking.

    Abusing a little (laughs ...) I will open another topic, making reference to another, it would be the sequence of work, about voice library ... but as I said, I will further explain the idea in another Post .

    Thank you very much. :) :)

  • Answer ✓

    great!

  • all images are set to

    sizeButton x sizeButton

    45 x 45 atm

    ;-)

  • Hello Chrisir,

    I had faced me with this problem, and had to make an adjustment on the images to stay cool ...

    Follows a print to get an idea of ​​how the project is getting. I found it interesting load the buttons changing positions at random.

    The tip of the programs call the function separately draw was very good ... I'm leaving each program in a "tab" separate, so the code is more organized.

    Has a lot more things to see, as I mentioned before, we are developing this project seeking in order to use for people with limited mobility, such as a wheelchair for example ... and even with limited movement of hands, can do some kind of interaction with the computer ...

    So the idea of ​​using multiple devices as input, such as mouse, microphone, Kinect, Arduino, etc ...

    To control what device I'm using, I made a similar validation of programs in the draw function.

    Not everything is working yet, but this is getting much foma be structured.

    Below is a code snippet of how it's getting (the comenáriois are in Portuguese ... sorry ... rsss ...)

    Thank you very much for now ... ;) Programas Programas2

    Code snippet (draw function)

     //Loop enquanto a aplicação estiver em execução - Cria animação 
    void draw() {
      if (limpaTela) background(R, G, B);
    
      if (option > 0){ //Se estiver executando, verifica qual dispositivo está ativo para interação
        if (dispositivo == 1 ){ //Interação com Mouse 
          pX = mouseX;
          pY = mouseY;
        }else if (dispositivo == 2){ //Interação com Microfone ( Áudio )
          atualizaMicrofone();
        }else if (dispositivo == 3){ //Interação  Kinect
          atualizaKinect();
        }else if (dispositivo == 4){ //Interação pelo Serial ( USB - Arduino, etc... )
          atualizaSerial();
        }else{
          println("Não definido dispositivo para Interação!");
        }
      }
    
      //Compara opções para executar programa conforme definido ao selecionar o Botão 
      if (option == start) {
        for (Button but : buttons) {
          but.update();
          but.display();
        }
        fill(#1273C1); 
        text("Selecione uma Opção para Começar...", 10, 30);
      } else if (option == program1) {
        draw1();
      } else if (option == program2) {
        draw2();
      } else if (option == program3) {
        draw3();
      } else if (option == program4) {
        draw4();
      } else {
        println ("Opção não Encontrada (erro #965)");
      }
    
      //Desenha Ellipse, referente as coordenadas capturadas
      ellipse(pX, pY, 30, 30); 
    
      //Atualiza informações sobre configurações
      lblInfoDisp.setText(infoDispositivo); 
    }
    
  • sounds great!

Sign In or Register to comment.