[Solved] Unable to set Button color

Square-Fall.zip (2.4 MB)

I followed the Square Fall tutorial by ShapeShift Games YT channel. After, I updated the defold version, I am unable to set the color of play button in the start screen of this project.

In the earlier version, it was working fine but now it is showing white. Although the rest of the functionality of acquiring input focus works.

What am I missing here?

How are you setting the color?

Works just fine for me:

1 Like

In start.gui_script, in the line 12 :

gui.set_color(self.play_button, data.color_two)

This should have worked.

I will make a new project and do it all over to see if it works or not.

Square-Fall_Again.zip (1.5 MB)
I made a new project again. And the same issue is happening here as well :pensive:.

I don’t get it. The color of play button is same as text-1 label color and yet it doesn’t appear in same color in the build.

What am I missing here?

It works for me with the project you attached:

What if you change the data.bg_color to something other than that almost white color?

Also, do you have any errors in the console?

Finally, what kind of GPU do you have?


I changed the value of data.bg_color. The button still doesn’t appear.

There are no errors in the console.

I am using an MSI GF63 laptop with Nvidia Gtx 1650 Max-Q.

Square-Fall.zip (2.4 MB)

UPDATE:

So, I tried pasting the “replay button” in “start.collection” and “play button” in “gameover.collection”.

Turns out, I can see the play button in gameover screen. But I can’t see either of “play” or “replay” button in start screen.

So, there is some issue going on in “start.gui”.

Yet to figure out what it is.

Check the colors of box nodes in start.gui. Maybe one of them isn’t set to “white”.

All of them are set to white. In both start.gui and gameover.gui.

I added an extra box in start.gui and gameover.gui. It is visible in gameover.gui but not in start.gui.

So, there is some difference between the Nodes section of both. I am unable to figure out what that is.

Are you using a render color?

There is a custom.render_script that I am using.

So I tried adding a blank box under the node, and it is visible whereas play_button and replay_button are still not visible.

So, is there a problem with atlas or textures?

What if you do Project->Build HTML5 ? Does the HTML5 version work? Can you please also confirm that you are using the exact project in the above zip file which works for me an Potota?

Yes, I am using the exact same project as this one.

Also, the play button did show up on the html5 build but not on normal build.

Here, is the screenshot:

If you have Intel GPU on your PC please take a look HELP I dont underand it anymore {SOLVED UPDATE INTEL} - #11 by AGulev

1 Like

Nope, its an Nvidia GPU, GTX 1650 with Max-Q. My CPU is from intel though, a core i5 9th Gen.

And, just to make sure, you don’t have an integrated Intel GPU?

I do have an integrated GPU from intel but my assumption is if anytime, I would open a game or a game engine, it should be using the Nvidia GPU and not intel one.

Ok, when I opened the engine. I saw the spike for the Intel GPU and nothing for the nvidia one.

1 Like