Sha256: 524a19cabceb7949a8e801916afdd9ac3fe899fc22df8f98de7379323503cc4a

Contents?: true

Size: 393 Bytes

Versions: 1

Compression:

Stored size: 393 Bytes

Contents

#!/usr/bin/env ruby
# Copyright (C) 2004-2007 Kouichirou Eto, All rights reserved.

require "sgl/cocoa"

def setup
  window 700, 700
  backgroundHSV 66, 100, 20
  $sound = sound("../media/Pop.aiff")
end

def onMouseDown(x, y)
  if 100 < x && x < 120 && 100 < y && y < 120
    $sound.play
  end
end

def display
  x, y = mouseX, mouseY
  color 100, 0, 0
  rect 100, 100, 120, 120
end

mainloop

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sgl-0.4.0 examples/cocoa6-sound.rb