MCPcopy Index your code
hub / github.com/phaserjs/phaser / createMockGameObject

Function createMockGameObject

tests/physics/arcade/StaticBody.test.js:22–49  ·  view source on GitHub ↗
(x, y, width, height)

Source from the content-addressed store, hash-verified

20}
21
22function createMockGameObject (x, y, width, height)
23{
24 x = (x === undefined) ? 0 : x;
25 y = (y === undefined) ? 0 : y;
26 width = (width === undefined) ? 64 : width;
27 height = (height === undefined) ? 64 : height;
28
29 return {
30 x: x,
31 y: y,
32 originX: 0,
33 originY: 0,
34 displayWidth: width,
35 displayHeight: height,
36 hasTransformComponent: true,
37 setPosition: function (px, py)
38 {
39 this.x = px;
40 this.y = py;
41 },
42 getTopLeft: function (out)
43 {
44 out.x = this.x;
45 out.y = this.y;
46 return out;
47 }
48 };
49}
50
51describe('StaticBody', function ()
52{

Callers 1

StaticBody.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…