No tienes permiso para modificar esta página, por los siguientes motivos:
Guardar la página
Texto libre:
<div id="pantalla" style="font-family: monospace, mono; text-align: center; white-space: nowrap"></div> {{#widget:P5 |id = ascii |code = /* video de caracteres */ let textInput; let btn1, btn2; let video; let asciiDiv; const W = 100; const H = 40; let grays = [ ' ./', ' ._/#', ' •●', ' ░▒▓', ' ▪️◾️◼️⬛️', ' ⟥⟤✚✚⫸⫷⧭▪️◾️◼️' ] let x = 0; function setup() { noCanvas(); video = createCapture(VIDEO); video.size(W,H); video.hide(); asciiDiv = createDiv(''); asciiDiv.id('ascii'); asciiDiv.parent('pantalla'); asciiDiv.style('line-height', '95%'); asciiDiv.style('font-size', '12px'); textInput = createInput(grays[x]); textInput.style('font-family', 'monospace'); textInput.style('font-size', '16px'); textInput.style('text-align', 'center'); textInput.style('width', '70%'); textInput.style('border', '1px solid transparent'); textInput.style('background-color', '#F6F7F3'); textInput.style('border-radius', '4px'); textInput.style('margin', '1em 0'); btn1 = createButton('+'); btn1.parent('pantalla'); textInput.parent('pantalla'); btn1.style('margin', '0 1em 0 0'); btn1.mousePressed(addVal); btn2 = createButton('→'); btn2.style('margin', '0 0 0 1em'); btn2.parent('pantalla'); btn2.mousePressed(next); btn1.style('border', 'none'); btn1.style('position', 'relative'); btn1.style('padding', '.1ex 1em'); btn1.style('border-radius', '4px'); btn2.style('border', 'none'); btn2.style('position', 'relative'); btn2.style('padding', '.1ex 1em'); btn2.style('border-radius', '4px'); } function next(){ let l = grays.length; x++; x %= l; textInput.value(grays[x]); } function addVal(){ let txt = textInput.value(); grays.push(txt); textInput.value(''); } function draw() { let txt = textInput.value(); background(255); fill(0); video.loadPixels(); let output = ''; for (let j = 0; j < H; j++) { for (let i = 0; i < W; i++) { let index = (i + j * W) * 4; let r = video.pixels[index + 0]; let g = video.pixels[index + 1]; let b = video.pixels[index + 2]; let bright = (r + g + b) / 3; let bindex = map(bright, 0, 255, txt.length, 0); let ch = txt.charAt(floor(bindex)); if (ch == ' ') { output += ' '; } else { output += ch; } } output += '<br/>'; } asciiDiv.html(output); } function keyTyped(){ if(keyCode === RIGHT_ARROW){ next(); } print(key); } }} ==Herramietas== * [http://processing.org Processing.org] * [https://editor.p5js.org/ Editor en línea de P5js] * [http://thecodingtrain.com/ The Coding Train, Dan Shiffman] - [https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw Canal de Youtube] * [http://openprocessing.org Open Processing] {{Los Cursos}}
Guardar la página Mostrar previsualización Mostrar los cambios Cancelar