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

#include <CCDevice.h>

Public Types

enum  TextAlign {
  CENTER = 0x33, TOP = 0x13, TOP_RIGHT = 0x12, RIGHT = 0x32,
  BOTTOM_RIGHT = 0x22, BOTTOM = 0x23, BOTTOM_LEFT = 0x21, LEFT = 0x31,
  TOP_LEFT = 0x11
}
 Defines the alignment of text. More...
 

Static Public Member Functions

static int getDPI ()
 Gets the DPI of device. More...
 
static void setAccelerometerEnabled (bool isEnabled)
 To enable or disable accelerometer. More...
 
static void setAccelerometerInterval (float interval)
 Sets the interval of accelerometer. More...
 
local setAccelerometerInterval ( local interval)
 Sets the interval of accelerometer. More...
 
static void setKeepScreenOn (bool keepScreenOn)
 Controls whether the screen should remain on. More...
 
static Data getTextureDataForText (const char *text, const FontDefinition &textDefinition, TextAlign align, int &width, int &height, bool &hasPremultipliedAlpha)
 Gets texture data for text. More...
 

Member Function Documentation

static int getDPI ( )
static

Gets the DPI of device.

Returns
The DPI of device.
var getDPI ( )
static

Gets the DPI of device.

Returns
The DPI of device.
local getDPI ( )
static

Gets the DPI of device.

Returns
The DPI of device.
static Data getTextureDataForText ( const char *  text,
const FontDefinition textDefinition,
TextAlign  align,
int &  width,
int &  height,
bool &  hasPremultipliedAlpha 
)
static

Gets texture data for text.

var getTextureDataForText ( var  text,
var  textDefinition,
var  align,
var  width,
var  height,
var  hasPremultipliedAlpha 
)
static

Gets texture data for text.

local getTextureDataForText ( local  text,
local  textDefinition,
local  align,
local  width,
local  height,
local  hasPremultipliedAlpha 
)
static

Gets texture data for text.

static void setAccelerometerEnabled ( bool  isEnabled)
static

To enable or disable accelerometer.

var setAccelerometerEnabled ( var  isEnabled)
static

To enable or disable accelerometer.

local setAccelerometerEnabled ( local  isEnabled)
static

To enable or disable accelerometer.

static void
setAccelerometerInterval
( float  interval)
static

Sets the interval of accelerometer.

var setAccelerometerInterval ( var  interval)
static

Sets the interval of accelerometer.

local setAccelerometerInterval ( local  interval)
static

Sets the interval of accelerometer.

static void setKeepScreenOn ( bool  keepScreenOn)
static

Controls whether the screen should remain on.

Parameters
keepScreenOnOne flag indicating that the screen should remain on.
var setKeepScreenOn ( var  keepScreenOn)
static

Controls whether the screen should remain on.

Parameters
keepScreenOnOne flag indicating that the screen should remain on.
local setKeepScreenOn ( local  keepScreenOn)
static

Controls whether the screen should remain on.

Parameters
keepScreenOnOne flag indicating that the screen should remain on.

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