Hi,
I want to assign a color at my Label, but I don't know how do it.
How can I do it?
Thanks.
A fast, easy to use, free, and community supported 2D game engine
Hi,
I want to assign a color at my Label, but I don't know how do it.
How can I do it?
Thanks.
try [myLabel setRGB:255 :0 :0] to make a red label for example.
Thanks a lot :)
You know if there is a place (a web site for example) where is possible to read all methods and properties of each cocos2d object?
Because in the cocos2d reference library if I look the Label documentation, there isn't the setRGB method.
"Because in the cocos2d reference library if I look the Label documentation, there isn't the setRGB method. "
true. But its a subclass of TextureNode which has the method there. So youhave to search the subclasses as well.
If you click on the "documentation" tab on the top of this page you can get to a class list. Also in each class you can list all methods/properties. So for label:
http://www.cocos2d-iphone.org/api-ref/0.7.3/class_label-members.html
I find it easier to just root around xcode, but give the web interface a try!
Yes, as Codemattic says you have to search the subclasses, and also you have to search the protocols as well.
The protocols are the ones that have "<" ">" in their names.
eg:
<CocosNodeRGB>
http://www.cocos2d-iphone.org/api-ref/0.7.3/protocol_cocos_node_r_g_b-p.html
objc "protocols" are more or less that same as java "interfaces"
Thanks a lot to all :)
You can also generate a class model in XCode. For example select the cocos2d directory in your project then choose Design/Class Model/Quick Model from the XCode menu. The class diagram that is generated is probably a bit unusable without some rearrangement. However, there is a nice 3 pane view of all the classes.
You must log in to post.