Skip to content

user formattedtext inline images

nhmkdev edited this page Mar 28, 2018 · 3 revisions

User Guides - FormattedText - Inline Images

General

This guide covers the use of the img tag with FormattedText elements. This is a common use case for games that intend to use iconography within instructional text. You should have a functional knowledge of image pathing in relation to CardMaker projects before going through this tutorial.

Setup

  1. Create a new FormattedText element
  2. Create a graphic (for use as your inline icon). The size is not critical for this tutorial.
  3. Set the Definition value of the element to: Causes 2 <img=attack.png> Damage (your image name may vary of course)

The result may look something (ugly) like this:

The image may not even appear if the image is quite large. Newer versions of CardMaker will default the scale of the image to 100% (1.0) of the determined font height.

Fix the visual using Line Spacing and Scaling

  1. You should probably adjust the size of the FormattedText element to better fit your text (depending on how you want it to look and/or line wrap)
  2. Set the Definition value of the element to: Causes 2 <img=attack.png;0.9> Damage The key part is the ;0.9. This sets up the scaling of the image in relation to the Font size (specifically the height).

The result should be something like this:

Tips

  • See the manual for the other options in the image tag. You can specify the absolute width and height of the image if necessary.
  • If the image refuses to show up for some reason, be sure to try the exact same path in a Graphic element to verify there are no other issues.