Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: [v8] Is there any way to pass a canvas instance to the new WebGLRenderer? #10360

Closed
JetLua opened this issue Mar 22, 2024 · 2 comments

Comments

@JetLua
Copy link
Contributor

JetLua commented Mar 22, 2024

Description

v8

const renderer = new WebGLRenderer();
await renderer.init();

// Add the renderer to the stage
document.body.appendChild(renderer.canvas);

Due to the WeChat Mini Program environment, I'm unable to execute the operation document.body.appendChild(renderer.canvas).

So I hope to pass the canvas instance to the WebGLRenderer via parameters as in previous versions.

v6

const renderer = new PIXI.Renderer({
  view: canvas,
 ...
})
@JetLua JetLua changed the title [v8] Is there any way to pass a canvas instance to the new WebGLRenderer?Feature Request: Feature Request: [v8] Is there any way to pass a canvas instance to the new WebGLRenderer? Mar 22, 2024
@Zyie
Copy link
Member

Zyie commented Mar 22, 2024

Hey @JetLua all renderer options have been moved to the init function

await renderer.init({
  canvas: canvas,
 ...
})

@JetLua
Copy link
Contributor Author

JetLua commented Mar 22, 2024

Hey @JetLua all renderer options have been moved to the init function

await renderer.init({
  canvas: canvas,
 ...
})

Thanks !!!

@JetLua JetLua closed this as completed Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants