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

Function GetBitmapTextSize

src/gameobjects/bitmaptext/GetBitmapTextSize.js:28–433  ·  view source on GitHub ↗
(src, round, updateOrigin, out)

Source from the content-addressed store, hash-verified

26 * @return {Phaser.Types.GameObjects.BitmapText.BitmapTextSize} The calculated bounds values of the BitmapText.
27 */
28var GetBitmapTextSize = function (src, round, updateOrigin, out)
29{
30 if (updateOrigin === undefined) { updateOrigin = false; }
31
32 if (out === undefined)
33 {
34 out = {
35 local: {
36 x: 0,
37 y: 0,
38 width: 0,
39 height: 0
40 },
41 global: {
42 x: 0,
43 y: 0,
44 width: 0,
45 height: 0
46 },
47 lines: {
48 shortest: 0,
49 longest: 0,
50 lengths: null,
51 height: 0
52 },
53 wrappedText: '',
54 words: [],
55 characters: [],
56 scaleX: 0,
57 scaleY: 0
58 };
59
60 return out;
61 }
62
63 var text = src.text;
64 var textLength = text.length;
65 var maxWidth = src.maxWidth;
66 var wordWrapCharCode = src.wordWrapCharCode;
67
68 var bx = Number.MAX_VALUE;
69 var by = Number.MAX_VALUE;
70 var bw = 0;
71 var bh = 0;
72
73 var chars = src.fontData.chars;
74 var lineHeight = src.fontData.lineHeight;
75 var letterSpacing = src.letterSpacing;
76 var lineSpacing = src.lineSpacing;
77
78 var xAdvance = 0;
79 var yAdvance = 0;
80
81 var charCode = 0;
82
83 var glyph = null;
84
85 var align = src._align;

Callers 2

BitmapText.jsFile · 0.85

Calls 1

measureTextWidthFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…