Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shape method #25

Closed
matrushka opened this issue Dec 29, 2010 · 3 comments
Closed

shape method #25

matrushka opened this issue Dec 29, 2010 · 3 comments
Labels

Comments

@matrushka
Copy link

There is no way to draw a shape which i load by using load_shape method. Yet i can draw it if i comment out the shape method in the app.rb file of ruby-processing. There must be a proper way to draw SVG shapes.

@monkstone
Copy link
Collaborator

Try this code:-

size(200,200)
background(255)
smooth()

star= load_shape("star.svg")
shape(star, 5, 5)

with this svg

git://gist.github.com/758361.git

Overwriting the "app.rb" seems a bit extreme...

@matrushka
Copy link
Author

i know yet when i try

class IstanbulMigration < Processing::App

  def setup
    @main_shape = load_shape("turkey_textless.svg")
    smooth
    no_loop
  end

  def draw
    shape(@main_shape)
  end

end

IstanbulMigration.new :title => "IstanbulMigration", :width => 1000, :height => 500

without overwriting it says

Exception in thread "Animation Thread" /Library/Ruby/Gems/1.8/gems/ruby-processing-1.0.9/lib/ruby-processing/app.rb:259:in `shape': no beginShape with arguments matching [class processing.core.PShapeSVG] on object #<Processing::App:IstanbulMigration:IstanbulMigration> (NameError)

using the shape method as below does not helps either

shape(@main_shape,0,0)

only solution that worked in my case was overwriting app.rb

@matrushka
Copy link
Author

i just checked the latest version of source on github and saw that shape method in app.rb is removed i guess one installed with the gem is the old version. i cloned the gem and installed from the sourced and now it works.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants