Sha256: 47b87a8830bfdfd386e7c71ca430f07f80d8cc1ba1f5a2bc8301346fd75eba58
Contents?: true
Size: 440 Bytes
Versions: 1
Compression:
Stored size: 440 Bytes
Contents
# frozen_string_literal: true Shoes.app width: 300, height: 300 do COLORS = Shoes::COLORS i = 45 button 'new' do i += 5 box = rand(2).zero? ? rect(i, i, 20) : oval(i, i, 20) box.style fill: send(COLORS.keys[rand(COLORS.keys.size)]) @flag = false box.click do @flag = true @box = box end box.release { @flag = false } end motion { |left, top| @box.move(left - 10, top - 10) if @flag } end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
shoes-4.0.0.pre12 | samples/simple_polygon_line.rb |