+2 votes

First of all when I say "acting weird" it's because I couldn't find other words to explain the situation so sorry for being ambiguous.

Specs:

OS: Ubuntu 17.10
Godot Version: 3.0.4 stable

I set the size and the position of the texture button in the editor but when I run the program it's out of place and in a different size, doesn't matter how small I make it or where I put it when I run it it's always in the same spot and in the same size,

For example I set it like this in texture button node:
I do it like this

And then this happens:
enter image description here
it's like it fits itself on top of the screen

Then I changed it's type to Button instead:
This was weirder this time the button would fill the entire screen
I tried to manually set its size and position (also it's scale in some hopes of it changing anything) from scene's main script too but it made no difference

enter image description here

var start_button_size = Vector2(220, 100)
var start_button_position = Vector2(80, 290)

func _ready():
    print("Started")
    $start_button.set_global_position(start_button_position)
    $start_button.set_size(start_button_size)
    $start_button.set_scale(Vector2(0.1,0.1))

    $start_button.update()
    print($start_button.get_size())
    print($start_button.get_global_position()

The really weird part is that the last two print commands return

(220, 100)
(80, 290)

So setting their size and position works but it doesn't show in the app ? What ?

other than that I haven't used any fancy shaders or other addons yet that might mess with the placement of the buttons and this problem from what I've seen is only with buttons, labels, sprites and all that good stuff are immune

I haven't tried this on another machine and different os yet, but might this be a bug related os and/or godot's version ?
Or is there something else ?

EDIT: I tried migrating the project to godot 2.1.4 and everything works normally no problems with buttons or other nodes reverting to their default sizes when you change something (this was happening in godot 3) so my guess is there is a bug with godot 3.0.4 for linux.

in Engine by (14 points)
edited by

Also having issues with texture button (Windows)

In addition to not being able to change size, I can't change the texture file after setting it the first time. Clear doesn't work, and when I pick a new file I get a new sprite but it saves it to the original file.

Ex. New texture button. I set it to horse.png which is a picture of a horse. I try to clear it and get this error:

scene/resources/texture.cpp:424 - Condition ' !f ' is true. returned: ERRCANTOPEN

Now I try to load a different file: pig.png, a picture of a pig. The texture does change to a pig but it's still linked to horse.png. Making a new sprite with horse.png now shows a pig as well.

Definitely a bug. New to Godot, not sure if devs read this. If they do, please contact me if you need a better explanation.

Please log in or register to answer this question.

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 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 webmaster@godotengine.org with your username.