Cocos Creator API

1.3.0

Cocos Creator is a highly customizable game development tool that utilizes the power of cocos2d-x.

Intersection static

: cc

Intersection helper class

lineLine
(
  • a1
  • a2
  • b1
  • b2
)
boolean

Test line and line

a1 Vec2

The start point of the first line

a2 Vec2

The end point of the first line

b1 Vec2

The start point of the second line

b2 Vec2

The end point of the second line

:

lineRect
(
  • a1
  • a2
  • b
)
boolean

Test line and rect

a1 Vec2

The start point of the line

a2 Vec2

The end point of the line

b Rect

The rect

:

linePolygon
(
  • a1
  • a2
  • b
)
boolean

Test line and polygon

a1 Vec2

The start point of the line

a2 Vec2

The end point of the line

b [Vec2]

The polygon, a set of points

:

rectRect
(
  • a
  • b
)
boolean

Test rect and rect

a Rect

The first rect

b Rect

The second rect

:

rectPolygon
(
  • a
  • b
)
boolean

Test rect and polygon

a Rect

The rect

b [Vec2]

The polygon, a set of points

:

polygonPolygon
(
  • a
  • b
)
boolean

Test polygon and polygon

a [Vec2]

The first polygon, a set of points

b [Vec2]

The second polygon, a set of points

:

circleCircle
(
  • a
  • b
)
boolean

Test circle and circle

a Object

Object contains position and radius

b Object

Object contains position and radius

:

polygonCircle
(
  • polygon
  • circle
)
boolean

Test polygon and circle

polygon [Vec2]

The Polygon, a set of points

circle Object

Object contains position and radius

:

pointInPolygon
(
  • point
  • polygon
)
boolean

Test whether the point is in the polygon

point Vec2

The point

polygon [Vec2]

The polygon, a set of points

:

pointLineDistance
(
  • point
  • start
  • end
  • isSegment
)
boolean

Calculate the distance of point to line.

point Vec2

The point

start Vec2

The start point of line

end Vec2

The end point of line

isSegment boolean

whether this line is a segment

:

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index