Sha256: 2b415a4bdc84bdc33a7b0656c36a77053cdfe387f9a93ffc4ab753115273c51c

Contents?: true

Size: 416 Bytes

Versions: 1

Compression:

Stored size: 416 Bytes

Contents

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

require "sgl/cocoa"

def setup
  window 300, 300
  backgroundHSV 66, 100, 20
end

def display
  x, y = mouseX, mouseY
  colorHSV 0, 50, 100
  lineWidth 3
  line   0,   0, x, y
  line 300,   0, x, y
  line   0, 300, x, y
  line 300, 300, x, y
  colorHSV 0, 100, 100
  rect x-10, y-10, x+10, y+10
end

mainloop

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sgl-1.0.0 examples/cocoa2-draw.rb