sffc / card-creatr-studio

Software for creating card game prototypes, made for Mac, Windows, and Linux. Powered by Electron and Vue.
GNU General Public License v3.0
37 stars 4 forks source link

Using symbols in strings #6

Open sffc opened 4 years ago

sffc commented 4 years ago

This suggestion from Marco was imported from the old issue tracker.

Idk if it's already possible, but would be very usefull to render symbols/icons in strings loaded as assets. Like:

"Trash this card to gain 2 "

where <fire> would be rendered like a loaded jpg/png called "fire.jpg" in the assets.


David replied:

I've managed to get the image to show up in the editor. However when I export to PDF the element isn't rendered at all. But maybe this gives Shane some insight on how to implement it. Because I would also love to have this ability!

First add a field "cardtext".

Then go to the template and add the following directives:

foreignObject(x=0, y=30, width=180, height=100)
  div !{cardtext}

Now you can set your card text like this:

Trash this card to gain 2 <img src="Absolute\Path\To\Your\Symbol.svg" style="height: 1em; width: 1em;" />

sffc commented 4 years ago

Thanks for the feedback! For the time being, if you can find an emoji with a good symbol, that should work inline with text already.