You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EDIT: The goal here is to have dynamic word bubbles near a character on the lower right side of an OBS scene to broadcast messages to the viewer. The tail will always be to the right and point to a specific region (the head). I'll want the bubble to appear for variable amounts of time, with successive messages in the same topic appending below it. After a while, I want them to disappear.
I'm using the SkyPack CDN to get the library. It isn't able to get the _currentStyle property from the project object, which I had assumed was being set with the paper.setup call. The exports are coming in, they just don't seem to be working.
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width, initial-scale=1.0"><title>Chat Bubbles</title></head><body><divid="bubble-container" style="position: relative; height: 600px"><canvasheight="500" width="500"></canvas><divclass="word-bubble" style="width: 200px; text-align:center; position: absolute; top: 10px; left: 20px;">Hi
there!</div></div><scripttype="module">importpaperfrom'https://cdn.skypack.dev/paper';import{Comical,Bubble}from'https://cdn.skypack.dev/comicaljs';document.addEventListener("DOMContentLoaded",function(){// Fetch references to elementsconstwrapDiv=document.querySelector('#bubble-container');constcanvas=document.querySelector('canvas');constbubbleContent=document.querySelector('.word-bubble');// Initialize Paper.jspaper.setup(canvas);// Create a new Comical instanceconstb=newBubble(bubbleContent);// Set the bubble specb.setBubbleSpec({version: "1.0",style: "speech",tails: [{tipX: 420,tipY: 400,midpointX: 320,midpointY: 375}],level: 1});// Initialize the bubble tailsb.tails=[{tipX: 420,tipY: 400,midpointX: 320,midpointY: 375}];setTimeout(()=>{// Need a timeout because these functions may need to know the width of the content boxb.initialize();},1000);});</script></body></html>
Even by being more faithful to what is in storybook, still not getting the project:
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width, initial-scale=1.0"><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.12.11/paper-full.min.js"></script><title>Chat Bubbles</title></head><body><divid="chat-bubble"></div><scripttype="module">import{Comical,Bubble}from'https://cdn.skypack.dev/comicaljs';paper.install(window);constwrapDiv=document.createElement("div");wrapDiv.style.position="relative";wrapDiv.style.height="600px";constcanvas=document.createElement("canvas");canvas.height=500;canvas.width=500;wrapDiv.appendChild(canvas);paper.setup(canvas);consttextDiv2=document.createElement("div");textDiv2.innerText="This is a text block meant to represent shouting. It is 200px wide. It has a bit more text to make it squarer.";textDiv2.style.width="200px";textDiv2.style.textAlign="center";//textDiv2.style.backgroundColor = "pink";textDiv2.style.position="absolute";textDiv2.style.top="250px";textDiv2.style.left="120px";wrapDiv.appendChild(textDiv2);constbubble=newBubble(textDiv2);bubble.setBubbleSpec({version: "1.0",style: "shout",tails: [{tipX: 420,tipY: 400,midpointX: 320,midpointY: 375}],level: 1});setTimeout(()=>{bubble.initialize();},200);document.getElementById("chat-bubble").appendChild(wrapDiv);</script></body></html>
EDIT: The goal here is to have dynamic word bubbles near a character on the lower right side of an OBS scene to broadcast messages to the viewer. The tail will always be to the right and point to a specific region (the head). I'll want the bubble to appear for variable amounts of time, with successive messages in the same topic appending below it. After a while, I want them to disappear.
I'm using the SkyPack CDN to get the library. It isn't able to get the _currentStyle property from the project object, which I had assumed was being set with the paper.setup call. The exports are coming in, they just don't seem to be working.
The text was updated successfully, but these errors were encountered: