About gui.get_texture() (SOLVED)

#1

I’m not sure if it’s a bug. In Debug HTML5 build gui.get_texture(node) works properly, it returns the hash that I need, but when in Release HTML5 build when I use gui.get_texture(node) it returns numbers that I have no idea where it came from.

Defold Version 1.2.158

Here’s the return of gui.get_texture(node) when in Release build:

hash: [9896461727764084588 (unknown)]

0 Likes

#2

This is not bug, all is good. Just debug build reprint source hash in nicelooking form. But release remove such nice debug output and print hash as it is. In each builds hash value same.

PS dont rely on hash print look, early prepare and store hash values you need. local hash_player_bounce_coll = hash("/player/collisionbox"). And use hash_player_bounce_coll where you need.

1 Like

#3

Oh… but I can’t store hash values because the values i’m getting are dynamic that’s why I need to get the hash everytime.

0 Likes

#4

If hash values dynamic than you use factory for its instantiation. Factory return hash value each born object, just store it and use later. If you try make some kind of collision reactions - move part of reaction code to instantiated GO, so object self reacted. Sorry i dont know you code so cannot give you right answer.

1 Like