Sha256: fea5157460c1f5351a1c7db6db0e6a74662db6811da08a06576ccd2c5ed3aca7

Contents?: true

Size: 347 Bytes

Versions: 1

Compression:

Stored size: 347 Bytes

Contents

# frozen_string_literal: true
Shoes.app do
  flow margin: 12 do
    # Set up three buttons
    button "Stop" do
      @anim.stop
    end
    @two = button "Watch Me!"
    button "Start" do
      @anim.start
    end
    # Bounce the second button
    @anim = animate do |frame|
      @two.displace(0, (Math.sin(frame) * 30).to_i)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-4.0.0.pre12 samples/simple_button_animate.rb