mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Added TextStyle.toJSON and merged the output with Text.toJSON.
This commit is contained in:
parent
ad0ff4d64b
commit
a4dc2d28aa
3 changed files with 14 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
var CHECKSUM = {
|
||||
build: '03e0ccd0-29d0-11e7-a448-d72a056ead60'
|
||||
build: 'bfbd2470-29db-11e7-accb-61302486ad25'
|
||||
};
|
||||
module.exports = CHECKSUM;
|
|
@ -1,5 +1,4 @@
|
|||
var Class = require('../../utils/Class');
|
||||
// var GetObjectValue = require('../../utils/object/GetObjectValue');
|
||||
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
||||
var MeasureText = require('./MeasureText');
|
||||
|
||||
|
@ -56,7 +55,6 @@ var TextStyle = new Class({
|
|||
{
|
||||
for (var key in propertyMap)
|
||||
{
|
||||
// this[key] = GetObjectValue(style, propertyMap[key][0], this[key]);
|
||||
this[key] = GetAdvancedValue(style, propertyMap[key][0], this[key]);
|
||||
}
|
||||
}
|
||||
|
@ -124,7 +122,6 @@ var TextStyle = new Class({
|
|||
{
|
||||
for (var key in propertyMap)
|
||||
{
|
||||
// this[key] = GetObjectValue(style, propertyMap[key][0], this[key]);
|
||||
this[key] = GetAdvancedValue(style, propertyMap[key][0], this[key]);
|
||||
}
|
||||
|
||||
|
@ -268,6 +265,18 @@ var TextStyle = new Class({
|
|||
return this.update(false);
|
||||
},
|
||||
|
||||
toJSON: function ()
|
||||
{
|
||||
var output = {};
|
||||
|
||||
for (var key in propertyMap)
|
||||
{
|
||||
output[key] = this[key];
|
||||
}
|
||||
|
||||
return output;
|
||||
},
|
||||
|
||||
destroy: function ()
|
||||
{
|
||||
this.parent = undefined;
|
||||
|
|
|
@ -273,11 +273,11 @@ var Text = new Class({
|
|||
var out = Components.ToJSON(this);
|
||||
|
||||
// Extra Text data is added here
|
||||
// TODO: TextStyle.toJSON
|
||||
|
||||
var data = {
|
||||
autoRound: this.autoRound,
|
||||
text: this.text,
|
||||
style: this.style.toJSON(),
|
||||
resolution: this.resolution,
|
||||
padding: {
|
||||
x: this.padding.x,
|
||||
|
|
Loading…
Add table
Reference in a new issue