Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Color text in GuiTextCtrl? (https://forums.graalonline.com/forums/showthread.php?t=80131)

bscharff 06-18-2008 05:13 AM

Color text in GuiTextCtrl?
 
PHP Code:

    new GuiTextCtrl("BNSS_Info3") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Red = Alert";
      
width 75;
      
200;
      
195;
    } 

What would I do to change the text's color to red (or any other color)?

If this is not possible, please tell me what control I would need to use (or whine at Stefan to make it possible).

oo_jazz_oo 06-18-2008 05:17 AM

To turn the text red, you can just add red = 1; green = blue = 0; to the bottom of the control.
Just use it like you would for a light effect.

bscharff 06-18-2008 05:23 AM

Such as

PHP Code:

    new GuiTextCtrl("BNSS_Info3") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Red = Alert";
      
width 75;
      
200;
      
195;
red 1;
    } 

(ANSWER: YES)

NVM, got it!

Chompy 06-18-2008 12:23 PM

Hmm, you can also use GuiMLTextCtrl, and then use the <font> tag ;o (Plus then you can have more then one color)

Admins 06-18-2008 02:17 PM

The preferred method to change the color is to change the profile:

PHP Code:

new GuiBlueTextProfile("MyTextProfile") {
  
fontcolor = {255,0,0}; // for red
}

new 
GuiTextCtrl("MyTextCtrl") {
  
profile MyTextProfile;



Stryke 06-18-2008 09:47 PM

Use this:

PHP Code:

new GuiTextCtrl("BNSS_Info3")
{
  
profile GuiBlueTextProfile;
  
profile.fontcolor = {255,0,0};
  
useOwnProfile true;
  
height 20;
  
text "Red = Alert";
  
width 75;
  
200;
  
195;
 } 


cbk1994 06-18-2008 10:22 PM

Quote:

Originally Posted by Stryke (Post 1397920)
Use this:

PHP Code:

new GuiTextCtrl("BNSS_Info3")
{
  
profile GuiBlueTextProfile;
  
profile.fontcolor = {255,0,0};
  
useOwnProfile true;
  
height 20;
  
text "Red = Alert";
  
width 75;
  
200;
  
195;
 } 


You (need to) should define useownprofile before changing the profile ...


All times are GMT +2. The time now is 11:37 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.