Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

PowerQuest

A Nifty 2D Adventure Toolkit for Unity · By Powerhoof

Inline images within text.

A topic by JustinMucus created Sep 02, 2020 Views: 285 Replies: 2
Viewing posts 1 to 3

I was able to add icon materials to the MeshRenderer on the text object (rich text using a quad) but the ParseImages function in QuestText.cs removes any material beyond the first slot. I can remove that and get it to work but I'd rather not change PowerQuest code if I can help it. 

Any ideas?

I kinda wrapped that system for PowerQuest to be easier to use, if you want you could try using my wrapper for it. It's not documented, since I just quickly added it for switch/console stuff I was doing, but this is the process.

  • Create a new Material in your project and set its Shader to Sprites/PowerSprite
  • Find the Text Sprites section in PowerQuest Project Settings (see below)
  • Drag the new material into the "Text Sprite Material" field
  • Add an item for each sprite you want to use in text. Give it a short name (Tag), and drag in the sprite you want to use.
  • To insert the image into text, use the tag, surrounded by square brackets. eg: "Press [B_Button] to start" where B_Button is the name you gave the tag.
  • Adjust the Y offset until it looks right in-game.  (it's quite fiddly from my experience using those text mesh icons, they're aligned weirdly).


Let me know if that doesn't do what you're after, I think it makes it a lot easier,  but I'd be curious if you use those icons in a different way than I imagined. I can also give you a patch so that it stops PowerText overriding the material if you need it. 

Got it working, thanks! This way definitely is easier.

I'm using it the same way you are, just as a way to visually show which buttons do what.