-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsketch.js
More file actions
54 lines (41 loc) · 1.26 KB
/
sketch.js
File metadata and controls
54 lines (41 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var font;
var vehicles=[]
function preload()
{
font=loadFont('RAVIE.ttf'); //font is stored in same file as script and html
}
function createPoints(ptsi)
{
for(var i=0; i<(ptsi.length) ; i++)
{
var pnt=ptsi[i]
var Vehicle = new vehicle(pnt.x,pnt.y)
vehicles.push(Vehicle)
// stroke(getRandomColor(),getRandomColor(),getRandomColor()); //getting random colors everytime 😎
// strokeWeight(8)
// point(pnt.x,pnt.y)
}
}
function setup() {
createCanvas(2000, 1000) //Cnvas is created
background(51) //BGColor
textFont(font) //Preloded font is loaded here
// textSize(100)
// fill(255)
// noStroke()
// text('TheDeepEffect',100,200) //text is displayed to the html
var pts=font.textToPoints('T H E D E E P E F F E C T',75,300,100); //Array of points is created with p5 font library
console.log(pts);
var pts1=font.textToPoints('D E E P M A N E K',500,500,100);
createPoints(pts)
}
function draw() {
background(51)
for(var i=0;i<vehicles.length;i++)
{
var v=vehicles[i]
v.update();
v.show();
v.behavior();
}
}