Jump to content

dynamically generated SVG to PixiJS texture


rip
 Share

Recommended Posts

I'm a newbie to PixiJS.

I've converted this codepen to PixiJS 7 and GSAP 3:
https://codepen.io/ripmurdock/pen/zYMqNGo?editors=0011

I'd like to use dynamically generated SVG's as the textures.

What's the right method for converting a dynamically generated SVG, like this, to a Pixi texture?

I've tried the string. I've also tried converting the string to base64, and I've tried prefixing the base64 string with "data:image/svg+xml;base64,"

<svg viewBox="0 0 43.125 43.125" width="100" height="100" version="1.1"><g><circle r="1.631" cy="24.149" cx="17.032" fill="#FFB164"></circle><circle r="1.631" cy="20.857" cx="15.963" fill="#FFB164"></circle><circle r="1.631" cy="17.566" cx="17.032" fill="#FFB164"></circle><circle r="1.631" cy="15.531" cx="19.832" fill="#FFB164"></circle><circle r="1.631" cy="15.531" cx="23.293" fill="#FFB164"></circle><circle r="1.631" cy="17.565" cx="26.093" fill="#FFB164"></circle><circle r="1.631" cy="20.857" cx="27.163" fill="#FFB164"></circle><circle r="1.631" cy="24.148" cx="26.093" fill="#FFB164"></circle><circle r="1.631" cy="26.183" cx="23.293" fill="#FFB164"></circle><circle r="1.631" cy="26.183" cx="19.832" fill="#FFB164"></circle></g><g><circle r="2.822" cy="23.919" cx="12.375" fill="#FF9B39"></circle><circle r="2.822" cy="17.934" cx="12.33" fill="#FF9B39"></circle><circle r="2.822" cy="13.067" cx="15.811" fill="#FF9B39"></circle><circle r="2.822" cy="11.173" cx="21.489" fill="#FF9B39"></circle><circle r="2.822" cy="12.979" cx="27.195" fill="#FF9B39"></circle><circle r="2.822" cy="17.794" cx="30.75" fill="#FF9B39"></circle><circle r="2.822" cy="23.78" cx="30.796" fill="#FF9B39"></circle><circle r="2.822" cy="28.648" cx="27.315" fill="#FF9B39"></circle><circle r="2.822" cy="30.541" cx="21.637" fill="#FF9B39"></circle><circle r="2.822" cy="28.734" cx="15.93" fill="#FF9B39"></circle></g><g><circle r="4.865" cy="30.96" cx="8.268" fill="#FF7F00"></circle><circle r="4.865" cy="21.218" cx="4.867" fill="#FF7F00"></circle><circle r="4.865" cy="11.336" cx="7.843" fill="#FF7F00"></circle><circle r="4.865" cy="5.091" cx="16.06" fill="#FF7F00"></circle><circle r="4.865" cy="4.867" cx="26.379" fill="#FF7F00"></circle><circle r="4.865" cy="10.751" cx="34.858" fill="#FF7F00"></circle><circle r="4.865" cy="20.495" cx="38.258" fill="#FF7F00"></circle><circle r="4.865" cy="30.377" cx="35.282" fill="#FF7F00"></circle><circle r="4.865" cy="36.624" cx="27.066" fill="#FF7F00"></circle><circle r="4.865" cy="36.846" cx="16.747" fill="#FF7F00"></circle></g></svg>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...