text.cacheAsBitmap = true throws error.
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- backend
Direzione di ricerca
The report points to _CreateFramebuffer and PIXI.FilterTexture in the WebGL code but gives no file path or test. Start by locating those functions and tracing how framebuffer creation is called when Text.cacheAsBitmap is enabled. Confirm the reported renderBuffer error and verify the fix by exercising bitmap caching in the affected Phaser version.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This Issue is about (pick one, ✏️ delete others)
- A bug in the API: Text.cacheAsBitmap
- Phaser version(s): 2.10.6
- What should happen: The text should be cached as bitmap
- What happens instead: Uncaught TypeError: Cannot read property 'renderBuffer' of undefined
Error is in this piece of code -
The below function is not associated with a class so "this.renderBuffer" is not accessible. Possible fix is calling this function using call method and passing "this" as context.
function _CreateFramebuffer (gl, width, height, scaleMode, textureUnit)
{
var framebuffer = gl.createFramebuffer();
var depthStencilBuffer = gl.createRenderbuffer();
var colorBuffer = null;
var fbStatus = 0;
gl.activeTexture(gl.TEXTURE0 + textureUnit);
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer);
colorBuffer = _CreateEmptyTexture(gl, width, height, scaleMode);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorBuffer, 0);
fbStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
if(fbStatus !== gl.FRAMEBUFFER_COMPLETE)
{
console.error('Incomplete GL framebuffer. ', _fbErrors[fbStatus]);
}
framebuffer.width = width;
framebuffer.height = height;
framebuffer.targetTexture = colorBuffer;
framebuffer.renderBuffer = depthStencilBuffer;
return framebuffer;
}
PIXI.FilterTexture = function (gl, width, height, scaleMode, textureUnit)
{
textureUnit = typeof textureUnit === 'number' ? textureUnit : 0;
/**
* @property gl
* @type WebGLContext
*/
this.gl = gl;
// next time to create a frame buffer and texture
/**
* @property frameBuffer
* @type Any
*/
// this.frameBuffer = _CreateFramebuffer(gl, width, height, scaleMode || PIXI.scaleModes.DEFAULT, textureUnit);
// The below line fixes the error.
this.frameBuffer = _CreateFramebuffer.call (this, gl, width, height, scaleMode || PIXI.scaleModes.DEFAULT, textureUnit);
/**
* @property texture
* @type Any
*/
this.texture = this.frameBuffer.targetTexture;
this.width = width;
this.height = height;
this.renderBuffer = this.frameBuffer.renderBuffer;
};
- Lingua principale
- JavaScript
- Stelle
- 1.4k
- Fork
- 485
- Merge medio
- 1g 2h
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di phaserjs/phaser-ce
-
Web audio stops playing in iOS 17 and 18 after refocusingForse di nuovo libera @samme l’ha presa 633 giorni fa e non c’è nessuna pull request aperta. Aperta
phaserjs/phaser-ce#748 · 2 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
phaserjs/phaser-ce#740 · 9 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
phaserjs/phaser-ce#724 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
phaserjs/phaser-ce#711 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di phaserjs/phaser-ce
Issue simili
-
enhancement ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
DCGM/semant-demo#708 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Client codegen: an import repeated in an impl file is emitted twice, and the browser rejects the moduleForse già presa @MalithaPrabhashana l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
jaseci-labs/jac#10756 ·
I maintainer di solito rispondono entro 1 giorno