Esempio n. 1
0
void draw()
{
    background(gray(122));
    if (Soloud_getActiveVoiceCount(soloud) > 0)
    {
        float * v = Soloud_calcFFT(soloud);
        int p = (int)(v[10] * 30);
        rect(10, 10, p * 10, 30);
    }

    if (keyReleased)
    {
        char sentence[20];
        sprintf(sentence, "%c", key);
        destroyAudio(keySound);
        keySound = loadSpeech(sentence);
        playAudio(keySound);
    }

    textFont(font);
    textAlign(NVG_ALIGN_LEFT);
    textSize(30);
    textLeading(5);
    text(sentence, 10, 100);
}
Esempio n. 2
0
void draw()
{
    background(gray(122));

    if (mousePressed)
    {
        image(img1, mouseX, mouseY, img1.width, img1.height);
    }
    else
    {
        image(img2, mouseX, mouseY, img2.width, img2.height);
    }

    textFont(font);
    textAlign(NVG_ALIGN_CENTER);
    textSize(30);
    textLeading(5);
    text("test everything here", width/2, height/2);
}