You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/gameobjects/bitmaptext/GetBitmapTextSize.js
+13-9Lines changed: 13 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -7,20 +7,24 @@
7
7
/**
8
8
* @typedef {object} BitmapTextSize
9
9
*
10
-
* @property {GlobalBitmapTextSize} global - The position and size of the BitmapText, taking into consideration the position and scale of the Game Object.
11
-
* @property {LocalBitmapTextSize} local - The position and size of the BitmapText, taking just the font size into consideration.
10
+
* @property {GlobalBitmapTextSize} global - The position and size of the BitmapText, taking into account the position and scale of the Game Object.
11
+
* @property {LocalBitmapTextSize} local - The position and size of the BitmapText, taking just the font size into account.
12
12
*/
13
13
14
14
/**
15
+
* The position and size of the Bitmap Text in global space, taking into account the Game Object's scale and world position.
16
+
*
15
17
* @typedef {object} GlobalBitmapTextSize
16
18
*
17
-
* @property {number} x - The x position of the BitmapText, taking into consideration the x position and scale of the Game Object.
18
-
* @property {number} y - The y position of the BitmapText, taking into consideration the y position and scale of the Game Object.
19
-
* @property {number} width - The width of the BitmapText, taking into consideration the x scale of the Game Object.
20
-
* @property {number} width - The height of the BitmapText, taking into consideration the y scale of the Game Object.
19
+
* @property {number} x - The x position of the BitmapText, taking into account the x position and scale of the Game Object.
20
+
* @property {number} y - The y position of the BitmapText, taking into account the y position and scale of the Game Object.
21
+
* @property {number} width - The width of the BitmapText, taking into account the x scale of the Game Object.
22
+
* @property {number} width - The height of the BitmapText, taking into account the y scale of the Game Object.
21
23
*/
22
24
23
25
/**
26
+
* The position and size of the Bitmap Text in local space, taking just the font size into account.
27
+
*
24
28
* @typedef {object} LocalBitmapTextSize
25
29
*
26
30
* @property {number} x - The x position of the BitmapText.
@@ -35,16 +39,16 @@
35
39
* Returns a BitmapTextSize object that contains global and local variants of the Game Objects x and y coordinates and
36
40
* its width and height.
37
41
*
38
-
* The global position and size take into consideration the Game Object's position and scale.
42
+
* The global position and size take into account the Game Object's position and scale.
39
43
*
40
-
* The local position and size just takes into consideration the font data.
44
+
* The local position and size just takes into account the font data.
41
45
*
42
46
* @function GetBitmapTextSize
43
47
* @since 3.0.0
44
48
* @private
45
49
*
46
50
* @param {(Phaser.GameObjects.DynamicBitmapText|Phaser.GameObjects.BitmapText)} src - The BitmapText to calculate the position, width and height of.
47
-
* @param {boolean} round - Whether to round the results to the nearest integer.
51
+
* @param {boolean} [round] - Whether to round the results to the nearest integer.
48
52
*
49
53
* @return {BitmapTextSize} The calculated position, width and height of the BitmapText.
* Bitmap Font data that can be used by a BitmapText Game Object.
41
-
*
42
-
* @typedef {object} BitmapFontData
43
-
*
44
-
* @property {string} font - The name of the font.
45
-
* @property {number} size - The size of the font.
46
-
* @property {number} lineHeight - The line height of the font.
47
-
* @property {boolean} retroFont - Whether this font is a retro font (monospace).
48
-
* @property {Object.<number, BitmapFontCharacterData>} chars - The character data of the font, keyed by character code. Each character datum includes a position, size, offset and more.
49
-
*/
50
-
51
17
/**
52
18
* Parse an XML font so you can pass it to the BitmapText constructor and create a BitmapText object.
0 commit comments