Skip to content

Commit bf19d3d

Browse files
committed
Starting on Text
1 parent 130988d commit bf19d3d

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
var TextStyle = {
2+
3+
font: '20px Arial',
4+
backgroundColor: null,
5+
fill: 'black',
6+
stroke: 'black',
7+
strokeThickness: 0,
8+
align: 'left',
9+
10+
11+
// style.font = style.font || 'bold 20pt Arial';
12+
// style.backgroundColor = style.backgroundColor || null;
13+
// style.fill = style.fill || 'black';
14+
// style.align = style.align || 'left';
15+
// style.boundsAlignH = style.boundsAlignH || 'left';
16+
// style.boundsAlignV = style.boundsAlignV || 'top';
17+
// style.stroke = style.stroke || 'black'; //provide a default, see: https://github.com/GoodBoyDigital/pixi.js/issues/136
18+
// style.strokeThickness = style.strokeThickness || 0;
19+
// style.wordWrap = style.wordWrap || false;
20+
// style.wordWrapWidth = style.wordWrapWidth || 100;
21+
// style.maxLines = style.maxLines || 0;
22+
// style.shadowOffsetX = style.shadowOffsetX || 0;
23+
// style.shadowOffsetY = style.shadowOffsetY || 0;
24+
// style.shadowColor = style.shadowColor || 'rgba(0,0,0,0)';
25+
// style.shadowBlur = style.shadowBlur || 0;
26+
// style.tabs = style.tabs || 0;
27+
28+
29+
};
30+
31+
module.exports = TextStyle;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
var Class = require('../../utils/Class');
3+
var GameObject = require('../GameObject');
4+
var Components = require('../../components');
5+
var TextRender = require('./TextRender');
6+
var TextStyle = require('../TextStyle');
7+
8+
var Text = new Class({
9+
10+
Mixins: [
11+
Components.Alpha,
12+
Components.BlendMode,
13+
Components.GetBounds,
14+
Components.Origin,
15+
Components.ScaleMode,
16+
Components.Size,
17+
Components.Transform,
18+
Components.Visible,
19+
TextRender
20+
],
21+
22+
initialize:
23+
24+
function Image (state, x, y, text, style)
25+
{
26+
GameObject.call(this, state);
27+
28+
this.setPosition(x, y);
29+
30+
// Create canvas texture
31+
32+
// this.texture = this.state.sys.textures.get(key);
33+
// this.frame = this.texture.get(frame);
34+
35+
}
36+
37+
});
38+
39+
module.exports = Text;

0 commit comments

Comments
 (0)