Sometimes a class needs to define an attribute that all the objects of that class share.
For example, the 'Compass' menu class defines class attribute R3COMPASSCA_Radius, which defines the size of the compass menu. The reason why this is defined as a class attribute rather than an object attribute is that the radius in all compass menus should be the same. If different compass menus had different sizes, the user's muscles would newer learn to use compass menus efficiently.
Class attributes are not saved with projects. They are saved to the users profile (also called registry).
Class attributes can be set and fetched the same way as object attributes. Only the first parameter should refer to a class id rather than to an object:
R3SetClassAttr(R3CLID_MYCLASS, MYCLASSA_Foo, foovalue, MYCLASSA_Bee, beevalue, R3TAG_END);
which is just a shield function to:
R3CLASS *cl; cl = R3ClassFind(R3CLID_MYCLASS); if(cl) R3Do(cl, R3RM_SETCLASSATTR MYCLASSA_Foo, foovalue, MYCLASSA_Bee, beevalue, R3TAG_END);
The function R3GetClassAttrs() (or method R3RM_GETCLASSATTR) can be used for fetching class attributes.