Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
simiraaaa committed Aug 10, 2017
1 parent b23ba79 commit f1459df
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
67 changes: 67 additions & 0 deletions phina.pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,73 @@ phina.pixi = {
});

}(phina, PIXI));
(function(phina, PIXI){

/**
* @class phina.pixi.PixiElement
* @extends phina.app.Element
*/
var PixiLabel = phina.define('phina.pixi.PixiLabel', {
superClass: phina.pixi.PixiSprite,
init: function(options){
var labelOpts = {};
options = options || {};
options.forIn(function(k, v){
if(PixiLabel.labelProperties.indexOf(k) !== -1) {
labelOpts[k] = v;
}
});
this.label = phina.display.Label(labelOpts);
this.superInit(phina.pixi.PixiTexture.fromShape(this.label));

this.on('enterframe', this._labelUpdate);
},

_labelUpdate: function(e){
var label = this.label;
if(label._dirtyDraw) {
label._dirtyDraw = false;
label.render(label.canvas);
this.updateTexture();
}
},
_static: {
labelProperties: [
'width',
'height',
'radius',
'padding',
'backgroundColor',
'fill',
'stroke',
'strokeWidth',
'shadow',
'shadowBlur',
'text',
'fontSize',
'fontWeight',
'fontFamily',
'align',
'baseline',
'lineHeight'
]
},

_defined: function(){
var self = this;
this.labelProperties.forEach(function(p){
self.prototype.accessor(p, {
get: function(){
return this.label[p];
},
set: function(v){
this.label[p] = v;
}
});
});
}
});
}(phina, PIXI));
(function(phina, PIXI) {

/**
Expand Down
Loading

0 comments on commit f1459df

Please sign in to comment.