Why aren't my colors accurate when I put them in the font sprite?

0 favourites
  • 12 posts
From the Asset Store
Creepy Sprite Font suitable font for your Dark/Horror/Halloween games.
  • Why aren't my colors accurate when I put them in the font sprite?

    I'm trying to use the font sprite to put the name of the buttons, and when it's selected change the color, but it doesn't have the precise pasting that I define

    does this function work correctly?

    It seems that not all colors are accurate.. or is there a specific way to export source sprite files?

    and about my code, how to fix it so that when I click on the button it changes color, and then goes back to normal?

  • The code part works fine, but the color doesn't seem to be accurate.

    like how do I make everyone set as a reference to another, like it's a single variable, which controls all the colors, so if I want to change it, I'd only need to change it in 1 place

  • rbgex() uses 0 to 100, you need to use rgb() which supports 0 - 255.

  • rbgex() uses 0 to 100, you need to use rgb() which supports 0 - 255.

    It looks better, but the color doesn't look very accurate.

    how can i save a color code in a variable or something?

  • > rbgex() uses 0 to 100, you need to use rgb() which supports 0 - 255.

    It looks better, but the color doesn't look very accurate.

    how can i save a color code in a variable or something?

    I had the same problem as I didn't know the object's colour has to be white before you apply any other colour so you may have the same issue:

    Here is my thread that might be helpful

    https://www.construct.net/en/forum/construct-3/general-discussion-7/changing-colours-complicated-169211

  • The code part works fine, but the color doesn't seem to be accurate.

    like how do I make everyone set as a reference to another, like it's a single variable, which controls all the colors, so if I want to change it, I'd only need to change it in 1 place

    Also, you need to put an else in all the events after the First Event "Selecao = 1"

    or you will have issues with multiple events triggering in the same tick like for example:

    If selecao is = 4

    Then all the events below will trigger:

    -selecao is not equal 1

    -selecao is not equal 2

    -selecao is not equal 3

    mm now that I'm thinking even the else it will not help if you just wanted to trigger the "is not equal 4" alone as the first "is not equal 1" will trigger first and skip the other events below, I think you will need to change the logic unless you want to trigger three of them at the same time.

  • > The code part works fine, but the color doesn't seem to be accurate.

    >

    >

    >

    >

    > like how do I make everyone set as a reference to another, like it's a single variable, which controls all the colors, so if I want to change it, I'd only need to change it in 1 place

    Also, you need to put an else in all the events after the First Event "Selecao = 1"

    or you will have issues with multiple events triggering in the same tick like for example:

    If selecao is = 4

    Then all the events below will trigger:

    -selecao is not equal 1

    -selecao is not equal 2

    -selecao is not equal 3

    mm now that I'm thinking even the else it will not help if you just wanted to trigger the "is not equal 4" alone as the first "is not equal 1" will trigger first and skip the other events below, I think you will need to change the logic unless you want to trigger three of them at the same time.

    What I want is to be able to change the RGB variables in just 1 field, and he can set the others, you know?

    save the code in some global or instance variable, and make the menus pull this variable

    so i could change my game color theme very easily

    -

    about white, I was thinking that, but I was too lazy to change the sprite fonts, but dps I do

  • What I want is to be able to change the RGB variables in just 1 field, and he can set the others, you know?

    Sure if you have fixed your issue and that's what you wanna then all good.

    Example:

    If selecao is = 1

    Then all these 4 events will Run:

    If you are happy with that then all good if not then you will need to change your events, if you need help in changing the events then you will need to provide the logic that you were thinking of doing so someone can help you in changing them.

  • > What I want is to be able to change the RGB variables in just 1 field, and he can set the others, you know?

    Sure if you have fixed your issue and that's what you wanna then all good.

    Example:

    If selecao is = 1

    Then all these 4 events will Run:

    If you are happy with that then all good if not then you will need to change your events, if you need help in changing the events then you will need to provide the logic that you were thinking of doing so someone can help you in changing them.

    I want to do that:

    variable 1 = rgb1

    variable 2 = rgb2

    Selection = 1 > spritefonte1 set color variable 1

    Selection ≠ 1> spritefonte1 set color variable 2

    Selection = 2 > spritefonte1 set color variable 1

    Selection ≠2 > spritefonte1 set color variable 2

    Selection = 3 > spritefonte1 set color variable 1

    Selection ≠ 3 > spritefonte1 set color variable 2

    etc..etc

  • variable 1 (string) = "255,50,100"

    Selection = 1 > spritefonte1 set color rgb(tokenat(variable 1, 0, ","),tokenat(variable 1, 1, ","),tokenat(variable 1, 2, ","))

    etc.

    The rgb values are stored as tokens in a string, separated by ",".

    Rather than setting the colour to rgb(255,50,100) or whatever it is, then we get token 0 = 255, token 1 = 50, token 2 = 100.

  • variable 1 (string) = "255,50,100"

    Selection = 1 > spritefonte1 set color rgb(tokenat(variable 1, 0, ","),tokenat(variable 1, 1, ","),tokenat(variable 1, 2, ","))

    etc.

    The rgb values are stored as tokens in a string, separated by ",".

    Rather than setting the colour to rgb(255,50,100) or whatever it is, then we get token 0 = 255, token 1 = 50, token 2 = 100.

    why doesn't it work?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • rgb(int(tokenat(cor_padrao,0,",")), int(tokenat(cor_padrao,1,",")), int(tokenat(cor_padrao,2,",")))

    I already solved it, the expression was incomplete, thanks for giving me the path to what I wanted

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)