Skip to content

Commit

Permalink
Added more text properties
Browse files Browse the repository at this point in the history
  • Loading branch information
kleber-swf committed Apr 19, 2022
1 parent 7ae3b54 commit d706b9b
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/core/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class EditorClass {
{ name: 'frameName', typeHint: 'string' },
{ name: 'blendMode', typeHint: 'valueList', values: Phaser.blendModes },
{ name: 'tint', typeHint: 'color' },
{ name: 'smoothed', typeHint: 'boolean' },
// TODO waiting for multiple type hint
// { name: 'hitArea', typeHint: 'rect' },

Expand All @@ -83,12 +84,14 @@ class EditorClass {
{ name: 'fontWeight', typeHint: 'valueList', values: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'] },
{ name: 'fontVariant', typeHint: 'valueList', values: ['normal', 'small-caps'] },
{ name: 'autoRound', typeHint: 'boolean' },
{ name: 'resolution', typeHint: 'number', data: { min: 0, step: 1 } },
{ name: 'align', typeHint: 'valueList', values: ['left', 'center', 'right'] },
{ name: 'lineSpacing', typeHint: 'number', data: { step: 1 } },
{ name: 'wordWrap', typeHint: 'boolean' },
{ name: 'wordWrapWidth', typeHint: 'number', data: { min: 0, step: 1 } },
{ name: 'useAdvancedWordWrap', typeHint: 'boolean' },
{ name: 'padding', typeHint: 'point' },
// { name: 'textBounds', typeHint: 'rect' }, // TODO waiting for null checking on rect editor
{ name: 'textBounds', typeHint: 'rect' }, // TODO waiting for null checking on rect editor
{ name: 'boundsAlignH', typeHint: 'valueList', values: ['left', 'center', 'right'] },
{ name: 'boundsAlignV', typeHint: 'valueList', values: ['top', 'middle', 'bottom'] },
{ name: 'shadowBlur', typeHint: 'number', data: { min: 0, step: 0.1 } },
Expand All @@ -99,6 +102,8 @@ class EditorClass {
{ name: 'shadowStroke', typeHint: 'boolean' },
{ name: 'stroke', typeHint: 'string' },
{ name: 'strokeThickness', typeHint: 'number', data: { min: 0, step: 0.1 } },
{ name: 'characterLimitSize', typeHint: 'number', data: { min: 0, step: 1 } },
{ name: 'characterLimitSuffix', typeHint: 'string' },
]);

const basicProperties = {
Expand All @@ -121,12 +126,12 @@ class EditorClass {

data.addObjectProperties('Phaser.Sprite', [
basicProperties,
{ title: 'Sprite', properties: ['key', 'frameName', 'blendMode', 'tint'] },
{ title: 'Sprite', properties: ['key', 'frameName', 'blendMode', 'tint', 'smoothed'] },
]);

data.addObjectProperties('Phaser.Image', [
basicProperties,
{ title: 'Sprite', properties: ['key', 'frameName', 'blendMode', 'tint'] },
{ title: 'Sprite', properties: ['key', 'frameName', 'blendMode', 'tint', 'smoothed'] },
]);

data.addObjectProperties('Phaser.Graphics', [
Expand All @@ -136,7 +141,7 @@ class EditorClass {

data.addObjectProperties('Phaser.Text', [
basicProperties,
{ title: 'Sprite', properties: ['blendMode', 'tint'] },
{ title: 'Sprite', properties: ['blendMode', 'tint', 'smoothed'] },
{
title: 'Text',
properties: [
Expand All @@ -147,15 +152,21 @@ class EditorClass {
'fontVariant',
'fontWeight',
'autoRound',
'resolution',
'---',
'align',
'lineSpacing',
'wordWrap',
'wordWrapWidth',
'useAdvancedWordWrap',
'---',
'padding', /* 'textBounds', */
'padding',
'textBounds',
'boundsAlignH',
'boundsAlignV',
'---',
'characterLimitSize',
'characterLimitSuffix',
],
},
{
Expand Down

0 comments on commit d706b9b

Please sign in to comment.