Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/jandot/ruby-processing
Former-commit-id: 0fb08ab Former-commit-id: 067869a32064bf80780217c078e831011531e14e
- Loading branch information
Showing
3 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require File.dirname(__FILE__) + '/../lib/ruby-processing.rb' | ||
|
||
class MySketch < Processing::App | ||
attr_accessor :extended_option | ||
|
||
# Let's define a setup method, for code that gets | ||
# run one time when the app is started. | ||
def setup | ||
background 0 | ||
no_stroke | ||
smooth | ||
frame_rate 10 | ||
|
||
@font = create_font('Helvetica', 16) | ||
text_font @font | ||
@rotation = 0 | ||
end | ||
|
||
# And the draw method which will be called repeatedly. | ||
# Delete this if you don't need animation. | ||
def draw | ||
fill 0 | ||
rect 0, 0, width, height | ||
|
||
translate width/2, height/2 | ||
rotate @rotation | ||
|
||
fill 255 | ||
text @message, 20, 20 | ||
# ellipse 0, -60, 20, 20 | ||
|
||
@rotation += 0.1 | ||
end | ||
end | ||
|
||
S = MySketch.new :title => 'extended_initialization', :width => 500, :height => 500, :message => 'Any text goes here...' |