Last active
May 16, 2017 20:36
-
-
Save volkanozcan2/a9649de0202f2f588590caf21c2908bb to your computer and use it in GitHub Desktop.
p5js:şablon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
x = $("#myContainer").width(); /* myContainerı istediğinle değiştir */ | |
y = $("#myContainer").height(); /* bunuda */ | |
var mycanvas = createCanvas(x, y); | |
mycanvas.parent("myContainer"); /* id ile seçiyor classla değil */ | |
fill("#FF9F1C"); | |
/*istersen gölge ekle */ | |
// drawingContext.shadowOffsetX = 1; | |
// drawingContext.shadowOffsetY = -1; | |
// drawingContext.shadowBlur = 5; | |
// drawingContext.shadowColor = "black"; | |
} | |
function draw() { | |
clear(); | |
_F(); | |
} | |
function getRandomColor() { | |
var letters = '0123456789ABCDEF'.split(''); | |
var color = '#'; | |
for (var i = 0; i < 6; i++) { | |
color += letters[Math.floor(Math.random() * 16)]; | |
} | |
return color; | |
} | |
function windowResized() { | |
resizeCanvas(windowWidth, windowHeight); | |
} | |
_F = () => { | |
if (panel) { | |
panel.setValue("FPS", ~~getFrameRate()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment