cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Margin Class Reference

Margin of widget's in point. More...

#include <UILayoutParameter.h>

Public Member Functions

 Margin ()
 Default constructor. More...
 
 Margin (float l, float t, float r, float b)
 Construct a Margin instance with left, top, right and bottom margins. More...
 
 Margin (const Margin &other)
 Copy constructor. More...
 
Marginoperator= (const Margin &other)
 Copy assignment operator. More...
 
void setMargin (float l, float t, float r, float b)
 Change margin with left, top, right and bottom margin. More...
 
bool equals (const Margin &target) const
 Test equality of two margins. More...
 

Public Attributes

float left
 Left margin. More...
 
float top
 Top margin. More...
 
float right
 Right margin. More...
 
float bottom
 Bottom margin. More...
 

Static Public Attributes

static const Margin ZERO
 A margin constant with all margins equal zero. More...
 

Detailed Description

Margin of widget's in point.

Margin value should be positive.

Constructor & Destructor Documentation

Margin ( )

Default constructor.

Margin ( float  l,
float  t,
float  r,
float  b 
)

Construct a Margin instance with left, top, right and bottom margins.

Parameters
lLeft margin in float.
tTop margin in float.
rRight margin in float.
bBottom margin in float.
Margin ( const Margin other)

Copy constructor.

Member Function Documentation

bool equals ( const Margin target) const

Test equality of two margins.

Parameters
targetA Margin instance.
Returns
True if two margins are equal, false otherwise.
Margin& operator= ( const Margin other)

Copy assignment operator.

void setMargin ( float  l,
float  t,
float  r,
float  b 
)

Change margin with left, top, right and bottom margin.

Parameters
lLeft margin in float.
tTop margin in float.
rRight margin in float.
bBottom margin in float.

Member Data Documentation

float bottom

Bottom margin.

float left

Left margin.

float right

Right margin.

float top

Top margin.

const Margin ZERO
static

A margin constant with all margins equal zero.


The documentation for this class was generated from the following file: