mirror of
https://github.com/photonstorm/phaser
synced 2024-11-14 00:47:29 +00:00
Set the context from the CanvasTexture
This commit is contained in:
parent
84282e838c
commit
4564216c54
1 changed files with 4 additions and 1 deletions
|
@ -144,7 +144,7 @@ var Text = new Class({
|
|||
* @type {CanvasRenderingContext2D}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.context = this.canvas.getContext('2d', { willReadFrequently: true });
|
||||
this.context;
|
||||
|
||||
/**
|
||||
* The Text Style object.
|
||||
|
@ -264,6 +264,9 @@ var Text = new Class({
|
|||
// Create a Texture for this Text object
|
||||
this.texture = scene.sys.textures.addCanvas(null, this.canvas, true);
|
||||
|
||||
// Set the context to be the CanvasTexture context
|
||||
this.context = this.texture.context;
|
||||
|
||||
// Get the frame
|
||||
this.frame = this.texture.get();
|
||||
|
||||
|
|
Loading…
Reference in a new issue