How can I set the fill for the circle? In corona sdk its simple: circle:setFillColor( 255, 255, 255).. really fills can be applied only to Shape.new() and not for b2.CircleShape.new() ?
Yes Shape.new() and b2.CircleShape.new() are two different things. While Shape is a visual object, b2.CircleShape.new() is more a mathematical representation of a physical circle.
It is probably better to use image to represent circle.
But you can also draw a circle using Shape object:
From the one point of view, yes you can have so many different abstractions, on object for rectangle, one for circle, other for rectangle with rounded corners. But in the end you need to remember a lot of stuff. How each of the objects are called, how they initiate, which parameters to pass, which methods they have.
On the other hand you may have simple basic class, know only it's methods and do with it everything that any abstraction could do. But yeah, it might get more complicated and you might need to write more code.
Comments
While Shape is a visual object,
b2.CircleShape.new() is more a mathematical representation of a physical circle.
It is probably better to use image to represent circle.
But you can also draw a circle using Shape object:
http://www.giderosmobile.com/forum/discussion/346/snippet-arccircleellipse
Then you can fill it and it will be still a circle
Likes: duke2017
gideros forever!)
https://play.google.com/store/apps/details?id=com.uglygames.slug
From the one point of view, yes you can have so many different abstractions, on object for rectangle, one for circle, other for rectangle with rounded corners. But in the end you need to remember a lot of stuff. How each of the objects are called, how they initiate, which parameters to pass, which methods they have.
On the other hand you may have simple basic class, know only it's methods and do with it everything that any abstraction could do. But yeah, it might get more complicated and you might need to write more code.
So both have loose ends.
Likes: duke2017