Sha256: d350d882d4d51483e03b75ba615930a5f76b79a3ff655f4a205ee459a135e73f
Contents?: true
Size: 515 Bytes
Versions: 10
Compression:
Stored size: 515 Bytes
Contents
# Scale Shape. # Illustration by George Brower. # # Move the mouse left and right to zoom the SVG file. # This shows how, unlike an imported image, the lines # remain smooth at any size. attr_reader :bot def setup size(640, 360) # The file "bot1.svg" must be in the data folder # of the current sketch to load successfully @bot = load_shape("bot1.svg") end def draw background(102) translate(width/2, height/2) zoom = map(mouse_x, 0, width, 0.1, 4.5) scale(zoom) shape(bot, -140, -140) end
Version data entries
10 entries across 10 versions & 1 rubygems