Skip to content

Latest commit

 

History

History
2292 lines (1652 loc) · 78.8 KB

api.all.md

File metadata and controls

2292 lines (1652 loc) · 78.8 KB

API Reference

j2Ds

j2DsEngine ⏏

j2DsEngine

Kind: Exported class
Properties

Name Type
now number
dt number
stopAll number
frameLimit number
sceneStartTime number
sceneSkipTime number
engine function
ready boolean
window Window
canDeactivate boolean

j2DsEngine.createLocal(id) ⇒ StorageManager

Kind: instance method of j2DsEngine

Param Type
id string

j2DsEngine.gameEngine(j2Ds)

Kind: instance method of j2DsEngine

Param Type
j2Ds j2DsEngine

j2DsEngine.gameStates : Object

Kind: instance property of j2DsEngine

j2DsEngine.getAudioManager() ⇒ AudioHandler

Kind: instance method of j2DsEngine

j2DsEngine.getDOMManager() ⇒ Dom

Kind: instance method of j2DsEngine

j2DsEngine.getDeviceManager() ⇒ DeviceManager

Kind: instance method of j2DsEngine

j2DsEngine.getErrorManager() ⇒ ErrorManager

Kind: instance method of j2DsEngine

j2DsEngine.getFPSManager() ⇒ FpsManager

Kind: instance method of j2DsEngine

j2DsEngine.getGameStateManager() ⇒ Object

Kind: instance method of j2DsEngine

j2DsEngine.getIO() ⇒ InputHandler

Kind: instance method of j2DsEngine

j2DsEngine.getInfo() ⇒ Object

Kind: instance method of j2DsEngine

j2DsEngine.getLayerManager() ⇒ Layers

Kind: instance method of j2DsEngine

j2DsEngine.getMathManager() ⇒ MathUtil

Kind: instance method of j2DsEngine

j2DsEngine.getPaintManager()

Deprecated

Kind: instance method of j2DsEngine

j2DsEngine.getResourceManager() ⇒ ResourceManager

Kind: instance method of j2DsEngine

j2DsEngine.getSceneManager() ⇒ SceneManager

Kind: instance method of j2DsEngine

j2DsEngine.getTextureManager() ⇒ TextureUtil

Kind: instance method of j2DsEngine

j2DsEngine.getTimeManager() ⇒ TimeManager

Kind: instance method of j2DsEngine

j2DsEngine.getTouchIO() ⇒ TouchHandler

Kind: instance method of j2DsEngine

j2DsEngine.getTriggerManager() ⇒ TriggerManager

Kind: instance method of j2DsEngine

j2DsEngine.getViewManager() ⇒ ViewManager

Kind: instance method of j2DsEngine

j2DsEngine.runEngine(j2Ds)

Kind: instance method of j2DsEngine

Param Type
j2Ds j2DsEngine

j2DsEngine.setActiveEngine(engine)

Kind: instance method of j2DsEngine

Param Type
engine function

j2DsEngine.setFrameLimit(fps)

Kind: instance method of j2DsEngine

Param Type
fps number

j2DsEngine.setWindow(global)

Kind: instance method of j2DsEngine

Param Type
global Window

j2DsEngine.start(engine, frameLimit)

Kind: instance method of j2DsEngine

Param Type
engine function
frameLimit number

j2DsEngine.stopEngine()

Kind: instance method of j2DsEngine

nodes/BaseNode

nodes/BaseNode.drawBox()

Kind: instance method of nodes/BaseNode

nodes/BaseNode.getAlpha() ⇒ * | number

Kind: instance method of nodes/BaseNode

nodes/BaseNode.getBox(node) ⇒ Object

Kind: instance method of nodes/BaseNode

Param
node

nodes/BaseNode.getBoxVertices(node) ⇒ Array.<{x: number, y: number}>

Kind: instance method of nodes/BaseNode

Param Type
node BaseNode

nodes/BaseNode.getDistance(id) ⇒ number

Kind: instance method of nodes/BaseNode

Param
id

nodes/BaseNode.getDistanceXY(id) ⇒ Object | Object

Kind: instance method of nodes/BaseNode

Param
id

nodes/BaseNode.getLayer() ⇒ *

Kind: instance method of nodes/BaseNode

nodes/BaseNode.getPosition() ⇒ Object | Object

Kind: instance method of nodes/BaseNode

nodes/BaseNode.getRotation() ⇒ number | *

Kind: instance method of nodes/BaseNode

nodes/BaseNode.getSize() ⇒ *

Kind: instance method of nodes/BaseNode

nodes/BaseNode.isCollision(id) ⇒ boolean

Kind: instance method of nodes/BaseNode

Param
id

nodes/BaseNode.isIntersect(node2) ⇒ *

Kind: instance method of nodes/BaseNode

Param
node2

nodes/BaseNode.isLookScene() ⇒ boolean

Kind: instance method of nodes/BaseNode

nodes/BaseNode.isOutScene() ⇒ Object

Kind: instance method of nodes/BaseNode

nodes/BaseNode.isPointInsideBox(vf, point) ⇒ boolean

Kind: instance method of nodes/BaseNode

Param
vf
point

nodes/BaseNode.isVisible() ⇒ boolean | *

Kind: instance method of nodes/BaseNode

nodes/BaseNode.move(pos)

Kind: instance method of nodes/BaseNode

Param
pos

nodes/BaseNode.moveDir(speed)

Kind: instance method of nodes/BaseNode

Param
speed

nodes/BaseNode.moveTo(to, t)

Kind: instance method of nodes/BaseNode

Param
to
t

nodes/BaseNode.resizeBox(offset, size)

Kind: instance method of nodes/BaseNode

Param
offset
size

nodes/BaseNode.rotateTo(to, t)

Kind: instance method of nodes/BaseNode

Param
to
t

nodes/BaseNode.setAlpha(alpha)

Kind: instance method of nodes/BaseNode

Param
alpha

nodes/BaseNode.setLayer(layer)

Kind: instance method of nodes/BaseNode

Param
layer

nodes/BaseNode.setParent(id)

Kind: instance method of nodes/BaseNode

Param
id

nodes/BaseNode.setPosition(pos) ⇒ *

Kind: instance method of nodes/BaseNode

Param
pos

nodes/BaseNode.setRotation(angle)

Kind: instance method of nodes/BaseNode

Param
angle

nodes/BaseNode.setSize(size) ⇒ *

Kind: instance method of nodes/BaseNode

Param
size

nodes/BaseNode.setVisible(visible)

Kind: instance method of nodes/BaseNode

Param
visible

nodes/BaseNode.turn(angle)

Kind: instance method of nodes/BaseNode

Param
angle

nodes/CircleNode

CircleNode ⇐ nodes/BaseNode

CircleNode

Kind: Exported class
Extends: nodes/BaseNode
Properties

Name Type
color string
radius number

new CircleNode(j2DsEngine, pos, radius, color)

Примитивный узел для отрисовки круга.

Param Type
j2DsEngine j2DsEngine
pos Object
radius number
color string

circleNode.draw()

Метод для отрисовки узла

Kind: instance method of CircleNode

circleNode.drawBox()

Kind: instance method of CircleNode

circleNode.getAlpha() ⇒ * | number

Kind: instance method of CircleNode

circleNode.getBox(node) ⇒ Object

Kind: instance method of CircleNode

Param
node

circleNode.getBoxVertices(node) ⇒ Array.<{x: number, y: number}>

Kind: instance method of CircleNode

Param Type
node BaseNode

circleNode.getDistance(id) ⇒ number

Kind: instance method of CircleNode

Param
id

circleNode.getDistanceXY(id) ⇒ Object | Object

Kind: instance method of CircleNode

Param
id

circleNode.getLayer() ⇒ *

Kind: instance method of CircleNode

circleNode.getPosition() ⇒ Object | Object

Kind: instance method of CircleNode

circleNode.getRotation() ⇒ number | *

Kind: instance method of CircleNode

circleNode.getSize() ⇒ *

Kind: instance method of CircleNode

circleNode.isCollision(id) ⇒ boolean

Kind: instance method of CircleNode

Param
id

circleNode.isIntersect(node2) ⇒ *

Kind: instance method of CircleNode

Param
node2

circleNode.isLookScene() ⇒ boolean

Kind: instance method of CircleNode

circleNode.isOutScene() ⇒ Object

Kind: instance method of CircleNode

circleNode.isPointInsideBox(vf, point) ⇒ boolean

Kind: instance method of CircleNode

Param
vf
point

circleNode.isVisible() ⇒ boolean | *

Kind: instance method of CircleNode

circleNode.move(pos)

Kind: instance method of CircleNode

Param
pos

circleNode.moveDir(speed)

Kind: instance method of CircleNode

Param
speed

circleNode.moveTo(to, t)

Kind: instance method of CircleNode

Param
to
t

circleNode.resizeBox(offset, size)

Kind: instance method of CircleNode

Param
offset
size

circleNode.rotateTo(to, t)

Kind: instance method of CircleNode

Param
to
t

circleNode.setAlpha(alpha)

Kind: instance method of CircleNode

Param
alpha

circleNode.setLayer(layer)

Kind: instance method of CircleNode

Param
layer

circleNode.setParent(id)

Kind: instance method of CircleNode

Param
id

circleNode.setPosition(pos) ⇒ *

Kind: instance method of CircleNode

Param
pos

circleNode.setRotation(angle)

Kind: instance method of CircleNode

Param
angle

circleNode.setSize(size) ⇒ *

Kind: instance method of CircleNode

Param
size

circleNode.setVisible(visible)

Kind: instance method of CircleNode

Param
visible

circleNode.turn(angle)

Kind: instance method of CircleNode

Param
angle

nodes/LineNode

LineNode ⇐ nodes/BaseNode

LineNode

Kind: Exported class
Extends: nodes/BaseNode
Properties

Name Type
color string
points Array.<Array.<number>>
fill boolean
scale number
cFill string
lineWidth number

new LineNode(j2DsEngine, pos, points, scale, color, width, fill, cFill)

Примитивный узел для отрисовки линии.

Param Type
j2DsEngine j2DsEngine
pos Object
points Array.<Array.<number>>
scale number
color string
width number
fill boolean
cFill string

lineNode.draw()

Метод для отрисовки узла

Kind: instance method of LineNode

lineNode.drawBox()

Kind: instance method of LineNode

lineNode.getAlpha() ⇒ * | number

Kind: instance method of LineNode

lineNode.getBox(node) ⇒ Object

Kind: instance method of LineNode

Param
node

lineNode.getBoxVertices(node) ⇒ Array.<{x: number, y: number}>

Kind: instance method of LineNode

Param Type
node BaseNode

lineNode.getDistance(id) ⇒ number

Kind: instance method of LineNode

Param
id

lineNode.getDistanceXY(id) ⇒ Object | Object

Kind: instance method of LineNode

Param
id

lineNode.getLayer() ⇒ *

Kind: instance method of LineNode

lineNode.getPosition() ⇒ Object | Object

Kind: instance method of LineNode

lineNode.getRotation() ⇒ number | *

Kind: instance method of LineNode

lineNode.getSize() ⇒ *

Kind: instance method of LineNode

lineNode.isCollision(id) ⇒ boolean

Kind: instance method of LineNode

Param
id

lineNode.isIntersect(node2) ⇒ *

Kind: instance method of LineNode

Param
node2

lineNode.isLookScene() ⇒ boolean

Kind: instance method of LineNode

lineNode.isOutScene() ⇒ Object

Kind: instance method of LineNode

lineNode.isPointInsideBox(vf, point) ⇒ boolean

Kind: instance method of LineNode

Param
vf
point

lineNode.isVisible() ⇒ boolean | *

Kind: instance method of LineNode

lineNode.move(pos)

Kind: instance method of LineNode

Param
pos

lineNode.moveDir(speed)

Kind: instance method of LineNode

Param
speed

lineNode.moveTo(to, t)

Kind: instance method of LineNode

Param
to
t

lineNode.resizeBox(offset, size)

Kind: instance method of LineNode

Param
offset
size

lineNode.rotateTo(to, t)

Kind: instance method of LineNode

Param
to
t

lineNode.setAlpha(alpha)

Kind: instance method of LineNode

Param
alpha

lineNode.setLayer(layer)

Kind: instance method of LineNode

Param
layer

lineNode.setParent(id)

Kind: instance method of LineNode

Param
id

lineNode.setPosition(pos) ⇒ *

Kind: instance method of LineNode

Param
pos

lineNode.setRotation(angle)

Kind: instance method of LineNode

Param
angle

lineNode.setSize(size) ⇒ *

Kind: instance method of LineNode

Param
size

lineNode.setVisible(visible)

Kind: instance method of LineNode

Param
visible

lineNode.turn(angle)

Kind: instance method of LineNode

Param
angle

nodes/RectNode

RectNode ⇐ nodes/BaseNode

RectNode

Kind: Exported class
Extends: nodes/BaseNode
Properties

Name Type
color string

new RectNode(j2DsEngine, pos, size, color)

Примитивный узел для отрисовки прямоугольника.

Param Type
j2DsEngine j2DsEngine
pos Object
size Object
color string

rectNode.draw()

Метод для отрисовки узла

Kind: instance method of RectNode

rectNode.drawBox()

Kind: instance method of RectNode

rectNode.getAlpha() ⇒ * | number

Kind: instance method of RectNode

rectNode.getBox(node) ⇒ Object

Kind: instance method of RectNode

Param
node

rectNode.getBoxVertices(node) ⇒ Array.<{x: number, y: number}>

Kind: instance method of RectNode

Param Type
node BaseNode

rectNode.getDistance(id) ⇒ number

Kind: instance method of RectNode

Param
id

rectNode.getDistanceXY(id) ⇒ Object | Object

Kind: instance method of RectNode

Param
id

rectNode.getLayer() ⇒ *

Kind: instance method of RectNode

rectNode.getPosition() ⇒ Object | Object

Kind: instance method of RectNode

rectNode.getRotation() ⇒ number | *

Kind: instance method of RectNode

rectNode.getSize() ⇒ *

Kind: instance method of RectNode

rectNode.isCollision(id) ⇒ boolean

Kind: instance method of RectNode

Param
id

rectNode.isIntersect(node2) ⇒ *

Kind: instance method of RectNode

Param
node2

rectNode.isLookScene() ⇒ boolean

Kind: instance method of RectNode

rectNode.isOutScene() ⇒ Object

Kind: instance method of RectNode

rectNode.isPointInsideBox(vf, point) ⇒ boolean

Kind: instance method of RectNode

Param
vf
point

rectNode.isVisible() ⇒ boolean | *

Kind: instance method of RectNode

rectNode.move(pos)

Kind: instance method of RectNode

Param
pos

rectNode.moveDir(speed)

Kind: instance method of RectNode

Param
speed

rectNode.moveTo(to, t)

Kind: instance method of RectNode

Param
to
t

rectNode.resizeBox(offset, size)

Kind: instance method of RectNode

Param
offset
size

rectNode.rotateTo(to, t)

Kind: instance method of RectNode

Param
to
t

rectNode.setAlpha(alpha)

Kind: instance method of RectNode

Param
alpha

rectNode.setLayer(layer)

Kind: instance method of RectNode

Param
layer

rectNode.setParent(id)

Kind: instance method of RectNode

Param
id

rectNode.setPosition(pos) ⇒ *

Kind: instance method of RectNode

Param
pos

rectNode.setRotation(angle)

Kind: instance method of RectNode

Param
angle

rectNode.setSize(size) ⇒ *

Kind: instance method of RectNode

Param
size

rectNode.setVisible(visible)

Kind: instance method of RectNode

Param
visible

rectNode.turn(angle)

Kind: instance method of RectNode

Param
angle

nodes/SpriteNode

SpriteNode ⇐ nodes/BaseNode

SpriteNode

Kind: Exported class
Extends: nodes/BaseNode
Properties

Name Type
tmpSpeed number
frame number
animation Object
flip Object

new SpriteNode(j2DsEngine, pos, size, animation)

Примитивный узел для отрисовки спрайта.

Param Type
j2DsEngine j2DsEngine
pos Object
size Object
animation Object

spriteNode.draw()

Метод для отрисовки узла

Kind: instance method of SpriteNode

spriteNode.drawBox()

Kind: instance method of SpriteNode

spriteNode.drawFrame(frame) ⇒ void | Object

Отрисовка одного кадра

Kind: instance method of SpriteNode

Param Type
frame number

spriteNode.getAlpha() ⇒ * | number

Kind: instance method of SpriteNode

spriteNode.getBox(node) ⇒ Object

Kind: instance method of SpriteNode

Param
node

spriteNode.getBoxVertices(node) ⇒ Array.<{x: number, y: number}>

Kind: instance method of SpriteNode

Param Type
node BaseNode

spriteNode.getDistance(id) ⇒ number

Kind: instance method of SpriteNode

Param
id

spriteNode.getDistanceXY(id) ⇒ Object | Object

Kind: instance method of SpriteNode

Param
id

spriteNode.getLayer() ⇒ *

Kind: instance method of SpriteNode

spriteNode.getPosition() ⇒ Object | Object

Kind: instance method of SpriteNode

spriteNode.getRotation() ⇒ number | *

Kind: instance method of SpriteNode

spriteNode.getSize() ⇒ *

Kind: instance method of SpriteNode

spriteNode.isCollision(id) ⇒ boolean

Kind: instance method of SpriteNode

Param
id

spriteNode.isIntersect(node2) ⇒ *

Kind: instance method of SpriteNode

Param
node2

spriteNode.isLookScene() ⇒ boolean

Kind: instance method of SpriteNode

spriteNode.isOutScene() ⇒ Object

Kind: instance method of SpriteNode

spriteNode.isPointInsideBox(vf, point) ⇒ boolean

Kind: instance method of SpriteNode

Param
vf
point

spriteNode.isVisible() ⇒ boolean | *

Kind: instance method of SpriteNode

spriteNode.move(pos)

Kind: instance method of SpriteNode

Param
pos

spriteNode.moveDir(speed)

Kind: instance method of SpriteNode

Param
speed

spriteNode.moveTo(to, t)

Kind: instance method of SpriteNode

Param
to
t

spriteNode.resizeBox(offset, size)

Kind: instance method of SpriteNode

Param
offset
size

spriteNode.rotateTo(to, t)

Kind: instance method of SpriteNode

Param
to
t

spriteNode.setAlpha(alpha)

Kind: instance method of SpriteNode

Param
alpha

spriteNode.setAnimation(animation)

Устанавливает анимацию

Kind: instance method of SpriteNode

Param Type
animation Object

spriteNode.setFlip(x, y)

//TODO Добавить описание этой херни

Kind: instance method of SpriteNode

Param Type
x number
y number

spriteNode.setLayer(layer)

Kind: instance method of SpriteNode

Param
layer

spriteNode.setParent(id)

Kind: instance method of SpriteNode

Param
id

spriteNode.setPosition(pos) ⇒ *

Kind: instance method of SpriteNode

Param
pos

spriteNode.setRotation(angle)

Kind: instance method of SpriteNode

Param
angle

spriteNode.setSize(size) ⇒ *

Kind: instance method of SpriteNode

Param
size

spriteNode.setVisible(visible)

Kind: instance method of SpriteNode

Param
visible

spriteNode.turn(angle)

Kind: instance method of SpriteNode

Param
angle

nodes/TextNode

TextNode ⇐ nodes/BaseNode

TextNode

Kind: Exported class
Extends: nodes/BaseNode
Properties

Name Type
vAlign number
hAlign number
color string
family string
sizePx number
lineWidth number
colorL string
font string
fullText string
maxWidth number
lines Array.<string>

new TextNode(j2DsEngine, pos, text, sizePx, color, family, width, colorL)

Примитивный узел для отрисовки текста.

Param Type
j2DsEngine j2DsEngine
pos Object
text string
sizePx number
color string
family string
width number
colorL string

textNode.draw()

Метод для отрисовки узла

Kind: instance method of TextNode

textNode.drawBox()

Kind: instance method of TextNode

textNode.drawSimpleText(text, pos, color, colorL)

Deprecated

Метод для быстрого изменения текста и его последующей отрисовки.

Kind: instance method of TextNode

Param Type
text string
pos Object
color string
colorL string

textNode.getAlpha() ⇒ * | number

Kind: instance method of TextNode

textNode.getBox(node) ⇒ Object

Kind: instance method of TextNode

Param
node

textNode.getBoxVertices(node) ⇒ Array.<{x: number, y: number}>

Kind: instance method of TextNode

Param Type
node BaseNode

textNode.getDistance(id) ⇒ number

Kind: instance method of TextNode

Param
id

textNode.getDistanceXY(id) ⇒ Object | Object

Kind: instance method of TextNode

Param
id

textNode.getLayer() ⇒ *

Kind: instance method of TextNode

textNode.getPosition() ⇒ Object | Object

Kind: instance method of TextNode

textNode.getRotation() ⇒ number | *

Kind: instance method of TextNode

textNode.getSize() ⇒ number

Возвращает текущий размер

Kind: instance method of TextNode
Overrides: getSize

textNode.getText() ⇒ string

Возвращает текст

Kind: instance method of TextNode

textNode.isCollision(id) ⇒ boolean

Kind: instance method of TextNode

Param
id

textNode.isIntersect(node2) ⇒ *

Kind: instance method of TextNode

Param
node2

textNode.isLookScene() ⇒ boolean

Kind: instance method of TextNode

textNode.isOutScene() ⇒ Object

Kind: instance method of TextNode

textNode.isPointInsideBox(vf, point) ⇒ boolean

Kind: instance method of TextNode

Param
vf
point

textNode.isVisible() ⇒ boolean | *

Kind: instance method of TextNode

textNode.move(pos)

Kind: instance method of TextNode

Param
pos

textNode.moveDir(speed)

Kind: instance method of TextNode

Param
speed

textNode.moveTo(to, t)

Kind: instance method of TextNode

Param
to
t

textNode.resizeBox(offset, size)

Kind: instance method of TextNode

Param
offset
size

textNode.rotateTo(to, t)

Kind: instance method of TextNode

Param
to
t

textNode.setAlpha(alpha)

Kind: instance method of TextNode

Param
alpha

textNode.setLayer(layer)

Kind: instance method of TextNode

Param
layer

textNode.setParent(id)

Kind: instance method of TextNode

Param
id

textNode.setPosition(pos) ⇒ *

Kind: instance method of TextNode

Param
pos

textNode.setRotation(angle)

Kind: instance method of TextNode

Param
angle

textNode.setSize(sizePx)

Устанавливает размер текста

Kind: instance method of TextNode
Overrides: setSize

Param Type
sizePx number

textNode.setText(text)

Устанавливает текст

Kind: instance method of TextNode

Param Type
text string

textNode.setVisible(visible)

Kind: instance method of TextNode

Param
visible

textNode.turn(angle)

Kind: instance method of TextNode

Param
angle

utils/MathUtil

MathUtil

Kind: global class

new MathUtil()

Вспомогательный класс содержащий статичные методы для облегчения расчетов.

utils/MathUtil.is4VerticesIntersect(a, b) ⇒ boolean

Проверка пересечения отрезков вершин двух фигур

Kind: static method of utils/MathUtil

Param Type
a Array.<{x: number, y: number}>
b Array.<{x: number, y: number}>

utils/MathUtil.isLineIntersect(a, b, c, d) ⇒ boolean

Проверка пересечения отрезков

Kind: static method of utils/MathUtil

Param Type Description
a Object Начальная точка первого отрезка
b Object Конечная точка первого отрезка
c Object Начальная точка второго отрезка
d Object Конечная точка второго отрезка

utils/MathUtil.isPointInRect(a, b, c, d, p) ⇒ boolean

Проверка принадлежности точки прямоугольнику

Kind: static method of utils/MathUtil

Param Type Description
a Object 1-я вершина прямоугольника
b Object 2-я вершина прямоугольника
c Object 3-я вершина прямоугольника
d Object 4-я вершина прямоугольника
p Object Точка

utils/MathUtil.isPointInTriangle(pt, a, b, c) ⇒ boolean

Проверка принадлежности точки треугольнику

Kind: static method of utils/MathUtil

Param Type Description
pt Object Точка
a Object 1-я вершина прямоугольника
b Object 2-я вершина прямоугольника
c Object 3-я вершина прямоугольника

utils/MathUtil.rad(num) ⇒ number

Приведение градусов в радианы

Kind: static method of utils/MathUtil

Param Type Description
num number 0..360

utils/MathUtil.random(min, max, omitZero) ⇒ number

Случайное число

Kind: static method of utils/MathUtil

Param Description
min Минимальное
max Максимальное
omitZero Включая нуль?

utils/MathUtil.rndColor(min, max, opacity) ⇒ string

Случайный цвет

Kind: static method of utils/MathUtil
Returns: string - rgba(0..256, 0..256, 0..256, 0.0 ~ 1.0)

Param Type Description
min number 0..256
max number 0..256
opacity number 0.0 ~ 1.0

utils/MathUtil.v2f(x, y) ⇒ Object

Вектор

Kind: static method of utils/MathUtil

Param Type
x number
y number

utils/MathUtil.v2i(x, y) ⇒ Object

Целочисленный вектор

Kind: static method of utils/MathUtil

Param Type
x number
y number

utils/TextureUtil

TextureUtil

Kind: global class

new TextureUtil()

Вспомогательный класс содержащий методы для генерации текстур.

utils/TextureUtil.createImageMap(width, height, callback) ⇒ Object

Создает карту текстур

Kind: instance method of utils/TextureUtil

Param Type
width number
height number
callback function

utils/TextureUtil.loadImageMap(path) ⇒ Object

Загружает из файла карту текстур

Kind: instance method of utils/TextureUtil

Param Type
path string

utils/TextureUtil.templates : Object

Шаблоны

Kind: instance property of utils/TextureUtil

templates.ellipse(context, size, color)

Рисует эллипс

Kind: static method of templates

Param Type
context CanvasRenderingContext2D
size number
color string

templates.fillRect(context, size, color)

Рисует прямоугольник закрашенный

Kind: static method of templates

Param Type
context CanvasRenderingContext2D
size number
color string

templates.gradientL(context, size, colors, isHorizontal)

Рисует линейным градиентом

Kind: static method of templates

Param Type
context CanvasRenderingContext2D
size number
colors Array.<string>
isHorizontal boolean

templates.gradientR(context, size, pos1, r1, pos2, r2, colors)

Рисует радиальным градиентом

Kind: static method of templates

Param Type
context CanvasRenderingContext2D
size Object
pos1 Object
r1 number
pos2 Object
r2 number
colors Array.<string>

templates.strokeRect(context, size, color, lineWidth)

Рисует пустой прямоугольник

Kind: static method of templates

Param Type
context CanvasRenderingContext2D
size number
color string
lineWidth number

License

Zlib. © 2015-2016 Нагель Петр