Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Text Image color not changing? (https://forums.graalonline.com/forums/showthread.php?t=134266575)

brokk 06-04-2012 05:26 PM

Text Image color not changing?
 
I have a NPC that is created that joins a class. The script is suppose to draw a number but for some reason it comes out a light blue no matter what I set the color values to.

PHP Code:

function onCreated()
{
 
showText(1this.xthis.y-3$pref::graal::defaultfontname"c""" @(this.setnuber));
 
changeImgColors(110101010); //<-- I think the issue is here
   
with (findImg(1)) {
    
textshadow true;
    
shadowoffset "0 0";
    
shadowcolors "1 1 1";
    
changeImgZoom(13);
 }



Crow 06-04-2012 05:53 PM

I'm amazed it's actually light blue and not white. You have 10 for red, green, blue and alpha. First off, all of the four values range between 0 and 1. And to get something that's not white/gray, you probably want to choose different values.

brokk 06-04-2012 08:57 PM

Quote:

I'm amazed it's actually light blue and not white. You have 10 for red, green, blue and alpha. First off, all of the four values range between 0 and 1. And to get something that's not white/gray, you probably want to choose different values.
I redid the script. But the zoom and font dont seem to be changing?

PHP Code:

function onCreated(){ 
 
showText(1this.xthis.y-3$pref::graal::defaultfontname"c""" @(this.setnumber));
 
changeImgColors(11111);
  
with (findImg(1)) {
    
textshadow true;
    
shadowoffset "-2 2";
    
shadowcolors "0 0 0";
    
font "showg";
    
style "b";
    
layer 12;
    
zoom 2;
 }



callimuc 06-04-2012 09:15 PM

Quote:

Originally Posted by brokk (Post 1696396)
I redid the script. But the zoom and font dont seem to be changing?

PHP Code:

function onCreated(){ 
 
showText(1this.xthis.y-3$pref::graal::defaultfontname"c""" @(this.setnumber));
 
changeImgColors(11111);
  
with (findImg(1)) {
    
textshadow true;
    
shadowoffset "-2 2";
    
shadowcolors "0 0 0";
    
font "showg";
    
style "b";
    
layer 12;
    
zoom 2;
 }



PHP Code:

function onCreated(){ 
  
showText(1this.xthis.y-3$pref::graal::defaultfontname"c"this.setnumber);
  
changeImgColors(11111);
  
with (findImg(1)) {
    
textshadow true;
    
shadowoffset "-2 2";
    
shadowcolors "0 0 0";
    
//font = "showg";
    
style "b";
    
layer 12;
    
zoom 2;
  }


You setted the font 2 times. Once in the showText() part ($pref::graal::defaultfontname) and once in the with(findimg(1)) part (font = "showg"). You have to choose which you want to use.

Also a small tip if you want to use RGB values for you colors: you can do divide the RGB value with 255 which will always make it <= 1. As example:
PHP Code:

changeImgColors(1255/255216/2550/255255/255);
changeImgColors(indexredgreenbluealpha); 

Which would make it yellow

brokk 06-04-2012 09:45 PM

OOOOH thank you. I got it now.

But I am still running into one issue. the layer=# is NOT working for some reason :[

callimuc 06-04-2012 10:17 PM

You can do either
PHP Code:

changeImgVis(indexlayer);
changeImgVis(13); 

PHP Code:

findImg(index).layer layer;
findImg(1).layer 3;
//or
with (findImg(1)) {
  
layer 3;



DustyPorViva 06-04-2012 10:26 PM

Use an image index >200 in this case.

callimuc 06-04-2012 10:35 PM

Quote:

Originally Posted by DustyPorViva (Post 1696408)
Use an image index >200 in this case.

Oh jea since he wanted it > 3. Didnt check his one


All times are GMT +2. The time now is 07:00 PM.

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