Open
Description
I suspect this might be a side effect of the fact that CS scopes variables so nicely, but in Proessing the sketch width and height given to size() are normally global, therefore they can be used inside of classes like so:
class Square
@x = width/2
@y = height/w
This issue is only limited to classes. The following works as expected:
dimensions: ->
println "#{width}, #{height}"
setup: ->
size 400, 400
draw: ->
println "#{width}, #{height}" #prints 400, 400
dimensions() prints #prints 400,400
It is another issue that is perhaps low on the list because there is a rather simple work around which is to declare width and height as variable before the setup. Still, might be useful in the readme.md.
Metadata
Metadata
Assignees
Labels
No labels