Problem with changing a word's color

This forum is currently in read-only mode.
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • I was looking around the spritefont plugin topic and learned how to single out a word in a string and change its color. I used the method Lucid suggested and ended up with this:

    +Blah

    -Write Text: "You found (" & TreasureBox_Item.value('WhichItem') & ")!"

    +For Each Word In Phrase

    +SpriteFont.currentword = TreasureBox_Item.value('WhichItem')

    -Set Text color filter to Red

    ("Text" is the sprite object I'm using for my font)

    So if the value "WhichItem" is "HeartPiece", then the string should read:

    "You found (HeartPiece)!"

    and "HeartPiece" should be colored red.

    WELL, it doesn't work <img src="smileys/smiley5.gif" border="0" align="middle" /> The only word I can get to change colors is the very first word in the string: "You"

    I tried comparing the current word to "HeartPiece" itself, I tried converting the "WhichItem" value to a string, I tried putting each word in its own set of quote marks, but nothing works!

    Has anyone tried doing this before and/or have any idea what I'm doing wrong?

  • sorry about that. I saw this topicname many times. it didn't even cross my mind you might have meant spritefont.

    seems to be working fine for me:

    http://dl.dropbox.com/u/1013446/spritefontthingy.cap

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Your example doesn't seem to work for me; all letters have an opacity of 100.

    I just reinstalled spritefront and it didn't do anything. I downloaded the one in your original spritefont post, is there a newer version I'm not aware of?

    edit: nevermind I think I figured it out..hold on

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)