change text color on mouse over (gui button)

Started by cjhrules, Sun 07/01/2007 20:25:31

Previous topic - Next topic

cjhrules

Hi!
I want the text color to change on mouse over on the gui. I don't want to use images where you can have the image change on mouse over because it will be bad for translating the gui later. How can I make this work.

Also the text seem to move down a bit when clicked on. How do I avoid that?

Ashen

For the first part, I think you could use Button.GetAtScreenXY(mouse.x,mouse.y) and Button.TextColor, e.g.:
Code: ags

if (Button.GetAtScreenXY(mouse.x, mouse.y) == btnTest) btnTest.TextColor = 15;
else btnTest.TextColor = 8;


For the second: I don't think it can be avoided, except by using images for the button text. (I hope I'm wrong here, I'd like to change this behaviour too.)

You could use the Game.TranslationFilename property to set the right Normal and Mouseover images for the current translation, which might potentially solve BOTH problems - but could lead to a LOT of button sprites being needed.
I know what you're thinking ... Don't think that.

cjhrules

I wish I had never started messing with the GUI cause this part of AGS needs a lots of work. Now when I try to change back to the old button images it doesn't work. It seems to use random sprites in the editor... what a mess :(

Ashen

If you're using images, surely you can just set the MouseOver image and let AGS handle that for you? It should only become an issue when you need to change them for translations.
I know what you're thinking ... Don't think that.

cjhrules

#4
This is really bad now   >:(

I exported the gui before I started to change it. Now when I import it and let it owerwrite it still won't work. It wont use the right spirites. It looks good in the editor but when I run the game it is fubar. I have removed all spirites that I added during the exprementation with the with the gui... still wont work. For the "look at" button ags uses the indy spirite!!! Insane!!!    >:( ???


EDIT: I also noticed that when the gui pre-select an action it uses even another spirite. amazing lol and soo sad.

cjhrules

ok, things are starting to get under control. I am setting the same spirits number as they where before... a lot of work lol.

Gilbert

Without providing more information, such as the codes you used to change the buttons and teh sprite numbers of those images you said to be misused it's very difficult for us to provide help.

SMF spam blocked by CleanTalk