https://editor.p5js.org/illus0r/sketches/NHBATASC7

  1. Переменные, строки, цикл
  2. Шрифт
  3. Перемещение
  4. Альфа

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/66d5ed84-ee05-430f-9b0a-0dc07f84796f/Untitled.png

//https://editor.p5js.org/illus0r/sketches/w7cKGBPM-
let myFont
let str

function preload() {
  myFont = loadFont('MajorMonoDisplay-Regular.ttf')
}

function setup() {
  createCanvas(512,512)
  // frameRate(10)
  textFont(myFont)
  textAlign(CENTER, CENTER)
  textSize(400)
  str = 'genklub'
}

function draw() {
  // background('fff')
  for(let i = 0; i < str.length; i++) {
    let b = 256*(sin(frameCount*.1 + i)*.5+.5)
    fill(b, b, b, 100)
    let amp = 200
    let x = width/2  + amp * sin(i*2*PI/str.length + frameCount*.01)
    let y = height/2 + amp * cos(i*2*PI/str.length + frameCount*.01)
    text(str[i], x, y)
  }
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/fa7446cb-ac11-4c7e-9cd1-c9eb538bab7a/Untitled.png

let str = 'Genklub'

function setup() {
  createCanvas(400, 400)
  textAlign(CENTER, CENTER)
}

function draw() {
  background(220)
  text(str[0], width/2, height/2)
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/83ac7403-4303-476d-86bf-ab2abd3ecf8d/Untitled.png

let str = 'Hello world'

function setup() {
  createCanvas(400, 400)
  textAlign(CENTER, CENTER)
  textSize(100)
}

function draw() {
  background(220)
  for(let i = 0; i < str.length; i++) {
    let a = -(i * 2 * PI / str.length)
    let x = width/2  + 100 * sin(a)
    let y = height/2 + 100 * cos(a)
    text(str[i], x, y)
  }
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5e9b8699-61ba-490d-9ee0-fc83deb7bda7/Untitled.png

let str = 'Helloworld'

let myFont
function preload() {
  myFont = loadFont('MajorMonoDisplay-Regular.ttf')
}

function setup() {
  createCanvas(400, 400)
  textAlign(CENTER, CENTER)
  textSize(50)
  textFont(myFont)
}

function draw() {
  background(0)
  fill(255)
  for(let i = 0; i < str.length; i++) {
    let a = i * 2 * PI / str.length + frameCount * .01
    let x = width/2  + 100 * sin(a)
    let y = height/2 + 100 * -cos(a)
    text(str[i], x, y)
  }
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6803c26a-ba34-4998-90bd-8d80b9cefbf7/Untitled.png

let str = 'Helloworld'

let myFont
function preload() {
  myFont = loadFont('MajorMonoDisplay-Regular.ttf')
}

function setup() {
  createCanvas(400, 400)
  textAlign(CENTER, CENTER)
  textSize(400)
  textFont(myFont)
  background(0)
}

function draw() {
  for(let i = 0; i < str.length; i++) {
    fill(255*(sin(frameCount * .1 + i * 2) * .5 + .5))
    let a = i * 2 * PI / str.length + frameCount * .01
    let x = width/2  + 200 * sin(a)
    let y = height/2 + 200 * -cos(a)
    text(str[i], x, y)
  }
}