-
Notifications
You must be signed in to change notification settings - Fork 14
X5. Property Types
This document contains a list of the supported property types of CocosBuilder, and how they are serialized in the CCB file format and in node plug-ins. For serialized values, first the dictionary representation is displayed (for CCB), follow by the binary representation (CCBi). The properties ID number, as used in CCBi is written in parentheses after the type name.
The main properties are used both in the CCB file format, in the CCBi file format, for displaying the inspector panel and for creating node plug-ins.
Represents a CGPoint (point), and position type.
Array[ Number(x), Number(y), Number(type) ]
FLOAT x
FLOAT y
UINT type
Represents a CGPoint (point).
Array[ Number(x), Number(y) ]
FLOAT x
FLOAT y
Represents a CGSize.
Array[ Number(width), Number(height) ]
FLOAT width
FLOAT height
Represents two float properties, the property names with X and Y appended and if the ratio is locked.
Array[ Number(x), Number(y), Boolean(locked) ]
FLOAT x
FLOAT y
Represents two BOOL properties, the property names with X and Y appended.
Array[ Boolean(x), Boolean(y) ]
BOOLEAN x
BOOLEAN y
Represents a float value.
Number(value)
FLOAT value
Represents two properties, the property with the standard name and one with Var appended.
Array[ Number(value), Number(valueVar) ]
FLOAT value
FLOAT valueVar
Represents an int value. (For IntegerLabeled, see extra properties below.)
Number(value)
SINT value
Represents an int value in the range 0-255.
Number(value)
BYTE value
Represents a BOOL value.
Boolean(value)
BOOLEAN value
Represents a NSString value.
String(text)
CSTRING text
Represents a CCSpriteFrame loaded from a sprite sheet or created from a image file.
Array[ String(spriteSheetFile, spriteFile) ]
CSTRING spriteSheetFile
CSTRING spriteFile
spriteSheetFile: Relative name of spriteSheetFile, can be empty string (not NULL).
spriteFile: Name of sprite in sprite sheet, or name of file if if sheet is empty string.
Represents a CCTexture loaded from an image file.
String(spriteFile)
CSTRING spriteFile
spriteFile: Relative name of image file
Represents a FNT file as used by CCLabelBMFont.
String(fntFile)
CSTRING fntFile
fntFile: Relative name of the FNT file
Represents a name of a TTF font as used by CCLabelTTF
String(fontName)
CSTRING fontName
fontName: Name of the Font, e.g. Helvetica
Represents a ccColor3B.
Array [ Number ( r), Number (g), Number (b) ]
BYTE r
BYTE g
BYTE b
r, g, b: Color components as integers in the range 0-255
Represents two ccColor4F properties, the latter with "Var" appended.
Array [
Array[ Number ( r), Number (g), Number (b), Number (a) ],
Array[ Number ( rVar), Number (gVar), Number (bVar), Number (aVar) ]
]
FLOAT r
FLOAT g
FLOAT b
FLOAT a
FLOAT rVar
FLOAT gVar
FLOAT bVar
FLOAT aVar
r, g, b, a: Color components as float in the range 0-1
rVar, gVar, bVar, aVar: Color components as float in the range 0-1, assigned to property with "Var" appended to it's name
Represents a ccBlendFunc property with src and dst components.
Array[ Number(src), Number(dst) ]
UINT src
UINT dst
src, dst: Blend func components as integers.
Represents a block property. The block will contain a callback to a target and selector and is created when loading the ccbi file in the app.
Array[ String(selector), Number(target) ]
CSTRING selector
UINT target
selector: Name of selector target: Target is 0 = None, 1 = Root node, 2 = Owner
The extra properties are used only by plug-ins to display additional information in the inspector panel.
The separator is only in CocosBuilder to display a separator/header in the inspector panel. Only its displayName is used and name can be left out.
This property is identical to Separator, only it is not as prominent and hasn't got a background color.
This property allows a plug-in to present a drop down menu for setting an integer. The integer is serialized identically to an ordinary Integer type, but the property has the extra field set. The extra field has the the format: < name 1 >|< int value 1 >[|< name 2 >|< int value 1 >[|…]]. For example (as used in CCParticleSystem):
Gravity mode|0|Radius mode|1
The StartStop property is used to display a start and stop button in the inspector panel. Set the names of the buttons using the displayName, but with a | separating the two names. For instance:
Start Particles|Stop Particles
Clicking the buttons will cause different selectors of the selected node to be called. Which selectors to call is specified by the extra field, and the two selectors are separated by |. E.g:
resetSystem|stopSystem
Animated properties are saved somewhat differently from normal properties and are used in keyframes and base values.
Represents a BOOL value.
Boolean(value)
BOOLEAN value
Represents a float value.
Number(value)
FLOAT value
Represents a CGPoint (point), the position type is set by the base value.
Array[ Number(x), Number(y), Number(type) ]
FLOAT x
FLOAT y
Represents two float properties, the property names with X and Y appended, if it is locked is set by the base value.
Array[ Number(x), Number(y) ]
FLOAT x
FLOAT y
Represents an int value in the range 0-255.
Number(value)
BYTE value
Represents a ccColor3B.
Array [ Number ( r), Number (g), Number (b) ]
BYTE r
BYTE g
BYTE b
r, g, b: Color components as integers in the range 0-255
Represents a CCSpriteFrame loaded from a sprite sheet or created from a image file.
Array[ String(spriteFile, spriteSheetFile) ]
CSTRING spriteSheetFile
CSTRING spriteFile
spriteSheetFile: Relative name of spriteSheetFile, can be empty string (not NULL).
spriteFile: Name of sprite in sprite sheet, or name of file if if sheet is empty string.