question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic FillStyle and LineStyle

See original GitHub issue

Hello,

Thanks for the module. Its exactly what I needed. Was wondering if there is a way to dynamically set the fill and line style outside of the actual SVG. I’ve tried updating SVGStage.root.children[0].fill with no luck. Would like to avoid having to use a filter if possible.

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
SupremeTechnopriestcommented, Jun 15, 2021

Hey @ShukantPal,

Looks like there’s also an issue with SVGScene.visible. Setting it doesn’t seem to do anything. I have to set it on SVGScene.root. This would be fine, but I’m trying to cull things outside the viewport using pixi-cull and it sets visible on the SVGScene. The result is that the svg renders in the middle of the stage with no scale applied.

// SVGScenes are added to the entity container
const entityContainer = new Container()

const cull = new Simple()
cull.addList(entityContainer.children)

app.current.ticker.add(() => {
  if (viewport.current.dirty) {
    cull.cull(viewport.current.getVisibleBounds())
    viewport.current.dirty = false
  }
})
1reaction
SupremeTechnopriestcommented, Jun 12, 2021

Also, if you could unpin the peerDependencies that would be great. I get errors when trying to install with Pixi 6.0.3. You can probably set it to 6.x.x and be ok or 6.0.x if you are paranoid about compatibility.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Applying styles and colors - Web APIs | MDN
If we want to apply colors to a shape, there are two important properties we can use: fillStyle and strokeStyle . fillStyle =...
Read more >
How can I set Html5 Canvas FillStyle with dynamic pattern and ...
Just draw the circular path twice: First time with the solid lime fill. Second time with the pattern. Example code and a Demo:....
Read more >
Phaser 3 API Documentation - Class: Graphics
To draw to it you must first specify a line style or fill style (or both), draw shapes using paths, and finally fill...
Read more >
Style a feature layer | ArcGIS Maps SDK for JavaScript 4.25
Feature layers can be styled on the client-side with a renderer. Renderers are responsible for using attribute values to apply the appropriate symbol...
Read more >
setlinestyle() function in C - GeeksforGeeks
The line style keep changing corresponding to value of first parameter(c). Explanation : linestyle specifies in which of several styles ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found