API Docs for: 0.1.0
Show:

CG.Text Class

Extends CG.Entity
Module: CG

Future plans: CG.Text => support for different text drawing modes like textblock, text alignment, text ticker or scroller.


                            var t = new CG.Text({
                                  font: abdi // the font object (CG.Font) to use
                                })
                        

Methods

AABB

() Object

returns the bounds of rotated rectangle

Returns:

Object:

returns the calculated bounds

checkCollision

(
  • objects
  • callback
)

checks if there is a collision of the given objects to this object http://devmag.org.za/2009/04/13/basic-collision-detection-in-2d-part-1/

Parameters:

  • objects Array

    a array of objects to check for collision => Sprites, Animations, MapAreas

  • callback Callback

    what to do after collision?

draw

()

ifClicked

() True/false

checks click inside of the rectangle, supports rotation

Returns:

True/false:

ifMouseOver

()

checks if the mouse/pointer is over the rectangle

init

(
  • options
)

Inherited from CG.Entity but overwritten in cangaja/text/text.js:19

Options: font {object}

Parameters:

Returns:

:

setImage

(
  • image
)

initialize image for object. for now => sprite, particle, buffer, bitmap and button use it

Parameters:

  • image Image

    image path, image or atlasimage

setText

(
  • text
)

Parameters:

Returns:

:

update

()

Properties

boundingradius

Number

clicked

Boolean

dragable

Boolean

height

Number

height height of textbox

Number

mapcollision

Boolean

rotation

Number

textAlign alignment of text

String

textcurrent

String

transform

Transform

Transform object for matrix transformation

visible

Boolean

visibility option

width width of textbox

Number

x the x position

Number

xhandle

Number

xscale

Number

y the y position

Number

yhandle

Number

yscale

Number