@@ -32,6 +32,7 @@ var Text = new Class({
3232 GameObject . call ( this , state ) ;
3333
3434 this . setPosition ( x , y ) ;
35+ this . setOrigin ( 0 , 0 ) ;
3536
3637 /**
3738 * @property {HTMLCanvasElement } canvas - The canvas element that the text is rendered.
@@ -86,6 +87,71 @@ var Text = new Class({
8687 return this . style . setStyle ( style ) ;
8788 } ,
8889
90+ setFont : function ( font )
91+ {
92+ return this . style . setFont ( font ) ;
93+ } ,
94+
95+ setFixedSize : function ( width , height )
96+ {
97+ return this . style . setFixedSize ( width , height ) ;
98+ } ,
99+
100+ setBackgroundColor : function ( color )
101+ {
102+ return this . style . setBackgroundColor ( color ) ;
103+ } ,
104+
105+ setFill : function ( color )
106+ {
107+ return this . style . setFill ( color ) ;
108+ } ,
109+
110+ setStroke : function ( color , thickness )
111+ {
112+ return this . style . setStroke ( color , thickness ) ;
113+ } ,
114+
115+ setShadow : function ( x , y , color , blur , shadowStroke , shadowFill )
116+ {
117+ return this . style . setShadow ( x , y , color , blur , shadowStroke , shadowFill ) ;
118+ } ,
119+
120+ setShadowOffset : function ( x , y )
121+ {
122+ return this . style . setShadowOffset ( x , y ) ;
123+ } ,
124+
125+ setShadowColor : function ( color )
126+ {
127+ return this . style . setShadowColor ( color ) ;
128+ } ,
129+
130+ setShadowBlur : function ( blur )
131+ {
132+ return this . style . setShadowBlur ( blur ) ;
133+ } ,
134+
135+ setShadowStroke : function ( enabled )
136+ {
137+ return this . style . setShadowStroke ( enabled ) ;
138+ } ,
139+
140+ setShadowFill : function ( enabled )
141+ {
142+ return this . style . setShadowFill ( enabled ) ;
143+ } ,
144+
145+ setAlign : function ( align )
146+ {
147+ return this . style . setAlign ( align ) ;
148+ } ,
149+
150+ setMaxLines : function ( max )
151+ {
152+ return this . style . setMaxLines ( max ) ;
153+ } ,
154+
89155 updateText : function ( )
90156 {
91157 var canvas = this . canvas ;
@@ -132,10 +198,6 @@ var Text = new Class({
132198 context . fillRect ( 0 , 0 , w , h ) ;
133199 }
134200
135- // DEBUG
136- context . fillStyle = '#ff00ff' ;
137- context . fillRect ( 0 , 0 , w , h ) ;
138-
139201 style . syncFont ( canvas , context ) ;
140202
141203 var linePositionX ;
@@ -181,6 +243,8 @@ var Text = new Class({
181243 context . fillText ( lines [ i ] , linePositionX , linePositionY ) ;
182244 }
183245 }
246+
247+ return this ;
184248 }
185249} ) ;
186250
0 commit comments