MCPcopy
hub / github.com/phaserjs/phaser / createGameObject

Function createGameObject

tests/gameobjects/components/Alpha.test.js:4–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3// Helper: create a mock Game Object with Alpha mixin applied
4function createGameObject ()
5{
6 var obj = {
7 _alpha: 1,
8 _alphaTL: 1,
9 _alphaTR: 1,
10 _alphaBL: 1,
11 _alphaBR: 1,
12 renderFlags: 15 // all flags set (0b1111)
13 };
14
15 // Copy plain methods
16 obj.clearAlpha = Alpha.clearAlpha;
17 obj.setAlpha = Alpha.setAlpha;
18
19 // Apply getter/setter properties as actual accessors
20 Object.defineProperties(obj, {
21 alpha: Alpha.alpha,
22 alphaTopLeft: Alpha.alphaTopLeft,
23 alphaTopRight: Alpha.alphaTopRight,
24 alphaBottomLeft: Alpha.alphaBottomLeft,
25 alphaBottomRight: Alpha.alphaBottomRight
26 });
27
28 return obj;
29}
30
31describe('Alpha', function ()
32{

Callers 1

Alpha.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…