Jump to content


Photo

Need help with a Text Code


  • Please log in to reply
5 replies to this topic

#1 CaptainDJ

CaptainDJ

    GMC Member

  • GMC Member
  • 60 posts
  • Version:GM:Studio

Posted 05 July 2012 - 04:06 PM

Hey I'm using a script in my game that displays a text in the log after every action the player does.

In the script I added an outline to the text, but the text and the outline is black. It will not change to any other colors. Can someone help me solve this?

Thanks.

Here is my script:
/*
argument0 = x
argument1 = y
argument2 = text
argument3 = color
argument4 = outline color
*/
draw_set_color(argument3);
for (i=0; i<global.maxline-1; i+=1)
{
    for(ii=argument0-1;ii<=argument0+1;ii+=1)
    {
        for(n=argument1-1;n<=argument1+1;n+=1)
        {
            draw_text(ii,n,argument2);
        }
    }
    global.line[i] = global.line[i+1];
}
draw_set_color(argument4);
global.line[global.maxline-1] = argument2;

Edited by CaptainDJ, 05 July 2012 - 04:06 PM.

  • 0

#2 Southman

Southman

    I simply am not here

  • GMC Member
  • 1662 posts
  • Version:GM:Studio

Posted 05 July 2012 - 04:19 PM

Are you sure you have the colors set in for the arguments?
Can you show the code where you call the script?
Edit: And it's useful to set the color back to white after changing it.

Edited by Southman, 05 July 2012 - 04:21 PM.

  • 0

#3 Noxlof

Noxlof

    GMC Member

  • GMC Member
  • 40 posts
  • Version:GM7

Posted 05 July 2012 - 04:26 PM

Hey I'm using a script in my game that displays a text in the log after every action the player does.

In the script I added an outline to the text, but the text and the outline is black. It will not change to any other colors. Can someone help me solve this?

Thanks.

Here is my script:

/*
argument0 = x
argument1 = y
argument2 = text
argument3 = color
argument4 = outline color
*/
draw_set_color(argument3);
for (i=0; i<global.maxline-1; i+=1)
{
    for(ii=argument0-1;ii<=argument0+1;ii+=1)
    {
        for(n=argument1-1;n<=argument1+1;n+=1)
        {
            draw_text(ii,n,argument2);
        }
    }
    global.line[i] = global.line[i+1];
}
draw_set_color(argument4);
global.line[global.maxline-1] = argument2;


Your only drawing the text once, right? That means that the text is set to the closest draw_set_color() varible that means that you'll have to do like this:
//draw_text_outline();
/*argument0 = x
argument1 = y
argument2 = text
argument3 = color
argument4 = outline color*/
draw_set_color(argument4);
for (i=0; i<global.maxline-1; i+=1){
    for(ii=argument0-1;ii<=argument0+1;ii+=1)
    {        for(n=argument1-1;n<=argument1+1;n+=1)
        {
            draw_text(ii,n,argument2);
        }
    }    
global.line[i] = global.line[i+1];
}
draw_set_color(argument3);
global.line[global.maxline-1] = argument2;

draw_text(ii-2,n-2,argument2);

it draws a new text on the outline without messing up th code :D BTW I changed the arguments to be exact TRY IT OUT! :P
  • 0

#4 Noxlof

Noxlof

    GMC Member

  • GMC Member
  • 40 posts
  • Version:GM7

Posted 05 July 2012 - 04:29 PM

draw_text_outline(x,y,"Hello!",c_white,c_black)

I named the script to "draw_text_outline"

Edited by Noxlof, 05 July 2012 - 04:30 PM.

  • 0

#5 Southman

Southman

    I simply am not here

  • GMC Member
  • 1662 posts
  • Version:GM:Studio

Posted 05 July 2012 - 04:35 PM

I just noticed you're drawing the outline after the actual text. That means it will be on top of the text.
  • 0

#6 CaptainDJ

CaptainDJ

    GMC Member

  • GMC Member
  • 60 posts
  • Version:GM:Studio

Posted 05 July 2012 - 07:42 PM

Your only drawing the text once, right? That means that the text is set to the closest draw_set_color() varible that means that you'll have to do like this:

//draw_text_outline();
/*argument0 = x
argument1 = y
argument2 = text
argument3 = color
argument4 = outline color*/
draw_set_color(argument4);
for (i=0; i<global.maxline-1; i+=1){
    for(ii=argument0-1;ii<=argument0+1;ii+=1)
    {        for(n=argument1-1;n<=argument1+1;n+=1)
        {
            draw_text(ii,n,argument2);
        }
    }    
global.line[i] = global.line[i+1];
}
draw_set_color(argument3);
global.line[global.maxline-1] = argument2;

draw_text(ii-2,n-2,argument2);

it draws a new text on the outline without messing up th code :D BTW I changed the arguments to be exact TRY IT OUT! :P


Hey, I See what your talking about but, I tried to put it in but it didn't work.
Here is the file.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users