|
6 | 6 |
|
7 | 7 | var GetValue = require('../../utils/object/GetValue'); |
8 | 8 |
|
9 | | -// * @param {number} characterWidth - The width of each character in the font set. |
10 | | -// * @param {number} characterHeight - The height of each character in the font set. |
11 | | -// * @param {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements. |
12 | | -// * @param {number} [charsPerRow] - The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth. |
13 | | -// * @param {number} [xSpacing=0] - If the characters in the font set have horizontal spacing between them set the required amount here. |
14 | | -// * @param {number} [ySpacing=0] - If the characters in the font set have vertical spacing between them set the required amount here. |
15 | | -// * @param {number} [xOffset=0] - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here. |
16 | | -// * @param {number} [yOffset=0] - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here. |
17 | | -// Phaser.GameObject.RetroFont = function (game, key, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset) |
18 | | - |
19 | | -// { |
20 | | -// image: key, |
21 | | -// width: 32, |
22 | | -// height: 32, |
23 | | -// chars: 'string', |
24 | | -// charsPerRow: null, |
25 | | -// spacing: { x: 0, y: 0 }, |
26 | | -// offset: { x: 0, y: 0 } |
27 | | -// } |
| 9 | +/** |
| 10 | + * @typedef {object} Phaser.GameObjects.BitmapText.ParseRetroFont.RetroFontConfig |
| 11 | + * |
| 12 | + * @property {string} image - [description] |
| 13 | + * @property {number} offset.x - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here. |
| 14 | + * @property {number} offset.y - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here. |
| 15 | + * @property {number} width - The width of each character in the font set. |
| 16 | + * @property {number} height - The height of each character in the font set. |
| 17 | + * @property {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements. |
| 18 | + * @property {number} charsPerRow - The number of characters per row in the font set. If not given charsPerRow will be the image width / characterWidth. |
| 19 | + * @property {number} spacing.x - If the characters in the font set have horizontal spacing between them set the required amount here. |
| 20 | + * @property {number} spacing.y - If the characters in the font set have vertical spacing between them set the required amount here. |
| 21 | +*/ |
28 | 22 |
|
29 | 23 | /** |
30 | 24 | * [description] |
31 | 25 | * |
32 | | - * @function ParseRetroFont |
| 26 | + * @function Phaser.GameObjects.BitmapText.ParseRetroFont |
33 | 27 | * @since 3.0.0 |
34 | | - * @private |
| 28 | + * |
| 29 | + * @param {Phaser.Scene} scene - A reference to the Phaser Scene. |
| 30 | + * @param {Phaser.GameObjects.BitmapText.ParseRetroFont.RetroFontConfig} config - The font configuration object. |
35 | 31 | */ |
36 | 32 | var ParseRetroFont = function (scene, config) |
37 | 33 | { |
@@ -117,80 +113,91 @@ var ParseRetroFont = function (scene, config) |
117 | 113 | }; |
118 | 114 |
|
119 | 115 | /** |
120 | | -* Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
121 | | -* @constant |
122 | | -* @type {string} |
123 | | -*/ |
| 116 | + * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
| 117 | + * |
| 118 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET1 |
| 119 | + * @type {string} |
| 120 | + */ |
124 | 121 | ParseRetroFont.TEXT_SET1 = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'; |
125 | 122 |
|
126 | 123 | /** |
127 | | -* Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ |
128 | | -* @constant |
129 | | -* @type {string} |
130 | | -*/ |
| 124 | + * Text Set 2 = !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ |
| 125 | + * |
| 126 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET2 |
| 127 | + * @type {string} |
| 128 | + */ |
131 | 129 | ParseRetroFont.TEXT_SET2 = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
132 | 130 |
|
133 | 131 | /** |
134 | | -* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 |
135 | | -* @constant |
136 | | -* @type {string} |
137 | | -*/ |
| 132 | + * Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 |
| 133 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET3 |
| 134 | + * |
| 135 | + * @type {string} |
| 136 | + */ |
138 | 137 | ParseRetroFont.TEXT_SET3 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 '; |
139 | 138 |
|
140 | 139 | /** |
141 | | -* Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 |
142 | | -* @constant |
143 | | -* @type {string} |
144 | | -*/ |
| 140 | + * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 |
| 141 | + * |
| 142 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET4 |
| 143 | + * @type {string} |
| 144 | + */ |
145 | 145 | ParseRetroFont.TEXT_SET4 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789'; |
146 | 146 |
|
147 | 147 | /** |
148 | | -* Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 |
149 | | -* @constant |
150 | | -* @type {string} |
151 | | -*/ |
| 148 | + * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 |
| 149 | + * |
| 150 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET5 |
| 151 | + * @type {string} |
| 152 | + */ |
152 | 153 | ParseRetroFont.TEXT_SET5 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() \'!?-*:0123456789'; |
153 | 154 |
|
154 | 155 | /** |
155 | | -* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' |
156 | | -* @constant |
157 | | -* @type {string} |
158 | | -*/ |
| 156 | + * Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' |
| 157 | + * |
| 158 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET6 |
| 159 | + * @type {string} |
| 160 | +* / |
159 | 161 | ParseRetroFont.TEXT_SET6 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.\' '; |
160 | 162 |
|
161 | 163 | /** |
162 | | -* Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39 |
163 | | -* @constant |
164 | | -* @type {string} |
165 | | -*/ |
| 164 | + * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39 |
| 165 | + * |
| 166 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET7 |
| 167 | + * @type {string} |
| 168 | + */ |
166 | 169 | ParseRetroFont.TEXT_SET7 = 'AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-\'39'; |
167 | 170 |
|
168 | 171 | /** |
169 | | -* Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ |
170 | | -* @constant |
171 | | -* @type {string} |
172 | | -*/ |
| 172 | + * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ |
| 173 | + * |
| 174 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET8 |
| 175 | + * @type {string} |
| 176 | + */ |
173 | 177 | ParseRetroFont.TEXT_SET8 = '0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
174 | 178 |
|
175 | 179 | /** |
176 | | -* Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?! |
177 | | -* @constant |
178 | | -* @type {string} |
179 | | -*/ |
| 180 | + * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?! |
| 181 | + * |
| 182 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET9 |
| 183 | + * @type {string} |
| 184 | + */ |
180 | 185 | ParseRetroFont.TEXT_SET9 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,\'"?!'; |
181 | 186 |
|
182 | 187 | /** |
183 | | -* Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ |
184 | | -* @constant |
185 | | -* @type {string} |
186 | | -*/ |
| 188 | + * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ |
| 189 | + * |
| 190 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET10 |
| 191 | + * @type {string} |
| 192 | + */ |
187 | 193 | ParseRetroFont.TEXT_SET10 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
188 | 194 |
|
189 | 195 | /** |
190 | | -* Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789 |
191 | | -* @constant |
192 | | -* @type {string} |
193 | | -*/ |
| 196 | + * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789 |
| 197 | + * |
| 198 | + * @name Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET11 |
| 199 | + * @type {string} |
| 200 | + */ |
194 | 201 | ParseRetroFont.TEXT_SET11 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()\':;0123456789'; |
195 | 202 |
|
196 | 203 | module.exports = ParseRetroFont; |
0 commit comments