mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
Text padding is passed to the Text.setPadding method to handle.
This commit is contained in:
parent
7bd8bf2075
commit
4d71806bea
1 changed files with 6 additions and 9 deletions
|
@ -39,19 +39,16 @@ GameObjectCreator.register('text', function (config)
|
||||||
text.resolution = GetAdvancedValue(config, 'resolution', 1);
|
text.resolution = GetAdvancedValue(config, 'resolution', 1);
|
||||||
|
|
||||||
// Padding
|
// Padding
|
||||||
// Either: { padding: 2 } or { padding: { x: 2, y: 2 }}
|
// { padding: 2 }
|
||||||
|
// { padding: { x: , y: }}
|
||||||
|
// { padding: { left: , top: }}
|
||||||
|
// { padding: { left: , right: , top: , bottom: }}
|
||||||
|
|
||||||
var padding = GetAdvancedValue(config, 'padding', null);
|
var padding = GetAdvancedValue(config, 'padding', null);
|
||||||
|
|
||||||
if (typeof padding === 'number')
|
if (padding !== null)
|
||||||
{
|
{
|
||||||
text.padding.x = padding;
|
text.setPadding(padding);
|
||||||
text.padding.y = padding;
|
|
||||||
}
|
|
||||||
else if (padding !== null)
|
|
||||||
{
|
|
||||||
text.padding.x = GetAdvancedValue(padding, 'x', 1);
|
|
||||||
text.padding.y = GetAdvancedValue(padding, 'y', 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
text.updateText();
|
text.updateText();
|
||||||
|
|
Loading…
Add table
Reference in a new issue