+1 vote

Currently: I am using a sprite for testing and it is fairly easy to scale the sprite
ex:) set_scale(Vector2(.95, .95)

My goal: is to have the same affect on a TextureButton, I only want to use a texturenormal within it. I do not want to have to add texturepressed textures for every button.

Any help would be great, this is pretty urgent and ive been at it for like 4 hours.
Thank you again guys!

Godot version Godot 4 Beta 6
in Engine by (30 points)

Maybe there is a way to set texturepressed = texture normal*.95 attributes
just brainstorming. ¯\

2 Answers

+1 vote
Best answer

you can just usescale = Vexctor2(.95,.95)

no more rectscale and setscale

by (30 points)
0 votes

You probably want to adjust the rect_scale property. So, something like:

$TextureButton.rect_scale = Vector2(2,2) # 2x scale
by (19,316 points)

doesnt look like rect_scale is a thing in godot 4, or am i missing something?

Ahhh... Sorry, missed your Godot 4 tag above. For that, I think you can set the scale property directly.

$TextureButton.scale = Vector2(2,2)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.