File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1249,15 +1249,20 @@ Phaser.BitmapData.prototype = {
12491249 * @method Phaser.BitmapData#textureLine
12501250 * @param {Phaser.Line } line - A Phaser.Line object that will be used to plot the start and end of the line.
12511251 * @param {string } key - The key of an image in the Phaser.Cache to use as the texture for this line.
1252+ * @param {string } [repeat='repeat-x'] - The pattern repeat mode to use when drawing the line. Either `repeat`, `repeat-x` or `no-repeat`.
12521253 * @return {Phaser.BitmapData } This BitmapData object for method chaining.
12531254 */
1254- textureLine : function ( line , key ) {
1255+ textureLine : function ( line , key , repeat ) {
1256+
1257+ if ( typeof repeat === 'undefined' ) { repeat = 'repeat-x' ; }
12551258
12561259 var image = this . game . cache . getImage ( key ) ;
12571260
1261+ this . context . fillStyle = this . context . createPattern ( image , repeat ) ;
1262+
12581263 this . _circle = new Phaser . Circle ( line . start . x , line . start . y , image . height ) ;
12591264
1260- circle . circumferencePoint ( line . angle - 1.5707963267948966 , false , this . _pos ) ;
1265+ this . _circle . circumferencePoint ( line . angle - 1.5707963267948966 , false , this . _pos ) ;
12611266
12621267 this . context . save ( ) ;
12631268 this . context . translate ( this . _pos . x , this . _pos . y ) ;
You can’t perform that action at this time.
0 commit comments