Sha256: 5c1a0c0c1b1e6dfdeea518b031e3eef87985fa65854279e551bcf7ff03b1a1eb

Contents?: true

Size: 587 Bytes

Versions: 4

Compression:

Stored size: 587 Bytes

Contents

# encoding: utf-8
# frozen_literal: true
# FontAgent class handles motion and display
class FontAgent
  include Processing::Proxy
  attr_reader :loc, :mot

  def initialize(location:)
    @loc = location
    @mot = 0
  end

  def motion
    noise_scale = map1d(mouse_x, (0..width), (0.001..0.01))
    noise_z = map1d(mouse_x, (0..height), (frame_count * 0.0003..frame_count * 0.02))
    @mot = noise(loc.x * noise_scale * noise_z, loc.y * noise_scale * noise_z) * 53
  end

  def display(step:)
    no_stroke
    fill(255, 53)
    ellipse(loc.x, loc.y, mot + step, mot + step)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
geomerative-0.4.3-java examples/font_agent.rb
geomerative-0.4.2-java examples/font_agent.rb
geomerative-0.4.0-java examples/font_agent.rb
geomerative-0.3.2-java examples/font_agent.rb