Button Properties

Hi all,

I have some issue with my button…

in every YouTube video and screenshots here, on the properties is where you can edit buttons, but on mine they are not there ?

Cheers :slight_smile:
Benjy.

That is the new update you can click the edit button and change the font or texture from the button.

1 Like

Yeah, the guy who made the extension made some horrible changes. However, you can still adjust it to your liking:

  1. First, click Change Variant and select the one you want, then click Edit.

  2. Scroll down a bit — you’ll see properties like Idle, Clicked, and Hover. They won’t have any images set.

  3. Click on Idle, then choose Project Resource and select the idle button image. Do the same for Hover and Clicked.

  4. You can also change the font or size in the Edit Button Properties menu by clicking Edit.

1 Like

Excellent Thank you.

One final question, my image is 200x80 , but this white box is there when I imported the button to my game, does this matter? I can’t find a way to make it the same size as my image thats all.

Doesn’t feel like its affecting gameplay at the moment.

Cheers,
Benjy.

If you want to make your own button but still use the preset button types, you need to match the sizes. However, there’s a better method that requires a bit of setup and still quite easy:

  1. Create three variants of your button: Idle, Hovered, and Pressed.
  2. Add a new Sprite object and name it something like Button_Darkish.
  3. Assign each variant to its own animation — Idle to the “Idle” animation, Hovered to “Hovered,” and Pressed to “Pressed.”
  4. Add the Button States behavior to the Button_Darkish sprite.
  5. Create three conditions:
  • If Button_Darkish is Idle, play animation “Idle.”
  • If it’s Hovered, play animation “Hovered.”
  • If it’s Pressed, play animation “Pressed.”

    This setup lets you fully customize your button’s appearance while still keeping the behavior of a standard button.
1 Like

Good idea!!! Thank you :slight_smile:

No problem, let me know if there’s something else

It’s in the property dialog, the button to open it is on the top right.
https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/#change-the-default-size-of-a-custom-object

I like how you guys always refer to the documentation as if most people actually read it, when in reality they just want to fix a specific issue quickly and move on.

Education is better in the long run than spoon feeding answers. If you understand then you will be better placed to resolve issues yourself rather than turning to the forum every time.

2 Likes

yea lol i remember a topic in the past like this, click here.

True, but sometimes a quick answer is better — just pop it up, fix the issue, and move on with your day. However, like you said, education is usually the better approach.

1 Like