S
S
sarsokol2019-09-12 14:14:38
JavaScript
sarsokol, 2019-09-12 14:14:38

How to embed WebGL in the desired canvas?

Good afternoon
There is a full screen effect
https://codepen.io/ko-yelie/pen/oNvWYpw
I can’t figure out how to stick it into my canvas in the place I need

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Stolyarov, 2019-09-12
@sarsokol

No way, the KGL library does not provide for
this. You can try to make a fork and publish it for yourself (in git or npm), if you're lucky, but the author will accept the pull request quickly.
Or try a tricky trick - replace document.body before initializing Kgl, but this can break something

var origBody = document.body;
document.body = yourTargetParent;
const webgl = new Kgl...
document.body = origBody;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question