Problem with changing a word's color

For questions about using Classic.

Post » Mon Jul 18, 2011 10:16 pm

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:
[quote]
+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)
[/quote]

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 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?

Tokinsom2011-07-18 22:31:14
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Jul 19, 2011 12:21 am

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.caplucid2011-07-19 00:21:57
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Jul 19, 2011 12:41 am

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 onTokinsom2011-07-19 00:45:30
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests