Problem with R;G;B properties of Actor's text.

Non-platform specific questions.

Problem with R;G;B properties of Actor's text.

Postby Grahor » Mon Feb 16, 2009 3:57 pm

Greetings. I've discovered game-editor yesterday, and was playing with it a bit, but currently I've stuck: apparently, I don't understand something.

So, I make an actor (called "Next") with text, and use the font tools to make the text of some color, say, the word "NEXT" with values 0,0,255, making it blue. Okay, so, now I'm using, say, a Filled Region above the word which on action "MouseEnter" starts script Next.r=255;Next.g=0;Next.b=0;. It should turn the word NEXT red, but it doesn't, instead it makes it black.

Now, if at the beginning I'll create a white font (255,255,255) for Next actor, then the same script works flawlessly, making the word NEXT red on mouseover. Apparently, MyActor.r=255; does not turn the text red; it turns the text as red as it is possible to do within original parameters of given font. Is it so or am I missing something? Is it a bug or a feature? Is there a way around it?

Also, I wonder, if there is a way to have text with different colors in the same actor.

Thanks.
Grahor
 
Posts: 4
Joined: Sun Feb 15, 2009 11:53 am
Score: 0 Give a positive score

Re: Problem with R;G;B properties of Actor's text.

Postby jimmynewguy » Mon Feb 16, 2009 4:08 pm

make the text white then create it and set
r = 0;
b = 255;
g = 0;

then mouse over
r = 255;
b = 0;

mouse leave
r = 0;
b = 255;

basically what you had with white text not blue
you had the right idea just a little off, welcome to the forums :D
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Problem with R;G;B properties of Actor's text.

Postby Grahor » Mon Feb 16, 2009 4:26 pm

Thanks. Rather obvious workover, but still, it should be probably mentioned somewhere in the manual. :) Also, another question - can I change the text of the actor in such a way so to have two or more lines? Something like strcpy (MyActor.text,"This is the first line.\nThis is the second line."); ?
Grahor
 
Posts: 4
Joined: Sun Feb 15, 2009 11:53 am
Score: 0 Give a positive score

Re: Problem with R;G;B properties of Actor's text.

Postby jimmynewguy » Mon Feb 16, 2009 4:53 pm

use strcpy

Code: Select all
strcpy(myacotr.text, "this is the first line\n thisisthesecond line");
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron