Skip to content
fyf edited this page Aug 21, 2014 · 1 revision

CocosBuilder - 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.

Main properties

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.

Position (0)

Represents a CGPoint (point), and position type.

Array[ Number(x), Number(y), Number(type) ]

FLOAT x
FLOAT y
UINT type

Point (2), PointLock (3)

Represents a CGPoint (point).

Array[ Number(x), Number(y) ]

FLOAT x
FLOAT y

Size (1)

Represents a CGSize.

Array[ Number(width), Number(height) ]

FLOAT width
FLOAT height

ScaleLock (4)

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

Flip (15)

Represents two BOOL properties, the property names with X and Y appended.

Array[ Boolean(x), Boolean(y) ]

BOOLEAN x
BOOLEAN y

Float (7), Degrees (5)

Represents a float value.

Number(value)

FLOAT value

FloatVar (8)

Represents two properties, the property with the standard name and one with Var appended.

Array[ Number(value), Number(valueVar) ]

FLOAT value
FLOAT valueVar

Integer (6), IntegerLabeled (20)

Represents an int value. (For IntegerLabeled, see extra properties below.)

Number(value)

SINT value

Byte (12)

Represents an int value in the range 0-255.

Number(value)

BYTE value

Check (9)

Represents a BOOL value.

Boolean(value)

BOOLEAN value

Text (18)

Represents a NSString value.

String(text)

CSTRING text

SpriteFrame (10)

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.

Texture (11)

Represents a CCTexture loaded from an image file.

String(spriteFile)

CSTRING spriteFile

spriteFile: Relative name of image file

FntFile (17)

Represents a FNT file as used by CCLabelBMFont.

String(fntFile)

CSTRING fntFile

fntFile: Relative name of the FNT file

FontTTF (19)

Represents a name of a TTF font as used by CCLabelTTF

String(fontName)

CSTRING fontName

fontName: Name of the Font, e.g. Helvetica

Color3 (13)

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

Color4FVar (14)

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

Blendmode (16)

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.

Block (21)

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

Extra properties used by plug-ins

The extra properties are used only by plug-ins to display additional information in the inspector panel.

Separator

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.

SeparatorSub

This property is identical to Separator, only it is not as prominent and hasn't got a background color.

IntegerLabeled

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

StartStop

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

Animated properties are saved somewhat differently from normal properties and are used in keyframes and base values.

Visible (2)

Represents a BOOL value.

Boolean(value)

BOOLEAN value

Degrees (2)

Represents a float value.

Number(value)

FLOAT value

Position (3)

Represents a CGPoint (point), the position type is set by the base value.

Array[ Number(x), Number(y), Number(type) ]

FLOAT x
FLOAT y

ScaleLock (4)

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

Byte (5)

Represents an int value in the range 0-255.

Number(value)

BYTE value

Color3 (6)

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

SpriteFrame (7)

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.