Gets full atlas size with gui.get_size()

I believe this could be marked up as a small bug or is it as expected?

  gui.set_size_mode(self.icon, gui.SIZE_MODE_AUTO)
    gui.play_flipbook(self.icon, icon_hash)
    local size = gui.get_size(self.icon)
    print("orig size:",size)

Above will give the correct result of the flipbook anim which in my case is vector3(140,140,0)

gui.play_flipbook(self.icon, icon_hash)
gui.set_size_mode(self.icon, gui.SIZE_MODE_AUTO)
local size = gui.get_size(self.icon)
print("orig size:",size)

This on the other hand gives me the size of the full atlas vmath.vector3(4096, 2048, 0) (expected same result as previous).
Just a headscratcher.

3 Likes

Huh! Weird. Is self.icon a run-time generated node or did it exist in the scene to begin with?

Exist in gui scene from start.

Very strange. Good that there is a workaround. For now we’ll file this as “weird thing that we’ll look at when we have nothing else on our table” :slight_smile:

2 Likes