How to align the icon to the center of a button by code?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By zkmark

How to align the icon to the center of a button by GDScript code?

I entered trying to center the icon of a button by code, I read the documentation but I only get that it is a TextAlign

This code fails

$Button.icon_alignment = ALIGN_CENTER

Parser Error: Identifier “ALIGN_CENTER” not declared in the current scope.

:bust_in_silhouette: Reply From: AlexTheRegent

Looks like this value got renamed to HORIZONTAL_ALIGNMENT_CENTER in this particular case.

it works thank you

zkmark | 2022-10-09 17:40