Introduction: Writing a Short Message by Processing(java)
We will learn how to write short message by Processing(java). I have used color in my instructable so that my text looks attractive. The dots in the background will also move.
Step 1: Ramadan Mubarak
This is my second instructable. In this instructacle I will tell how to write short message by processing(java)
The code:
import processing.sound.*;
SoundFile file;
int unit = 40; int count; Module[] mods;
void setup() { size(640, 360); file = new SoundFile(this, "o Mon Romjaner Oi Rozar Sheshe.mp3"); file.play(); noStroke();
int wideCount = width / unit; int highCount = height / unit; count = wideCount * highCount; mods = new Module[count];
int index = 0; for (int y = 0; y < highCount; y++) { for (int x = 0; x < wideCount; x++) { mods[index++] = new Module(x*unit, y*unit, unit/2, unit/2, random(0.05, 0.8), unit); } } }
void draw() { background(0); fill(255,255,255); ellipse(56, 46, 55, 55); textSize(60);
text("Ramadan Mubarak", 10, 130); fill(0, 102, 153); text("Ramadan Mubarak", 10, 160); fill(0, 102, 153, 51); text("Ramadan Mubarak", 10, 190); for (Module mod : mods) { mod.update(); mod.display(); } }
We have used sound in this instructable. So we will have to download sound from youtube and convert it into
mp3.
The link for downloading the song:
https://www.youtube.com/watch?v=Mmn0h1PSfrU