This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote

I need send a texture from a server to a client.

var t0 = Main.crate_image(temp[1])
var t1 = t0.get_data()
var t2:PoolByteArray = t1.get_data()
var t3 = t2.compress(1)
var t4:Array = [temp[1],t3]


func crate_image(path):
    var img =
    var img_tex: =
    return img_tex

temp is one Array received from client. [order type,texture path]

t0 = ImageTexture
t1 = Image
t2 = PoolByteArray
and t3 is t2 compressed (without this, client has returned: is too big for it to

The client received this, but I can't transform this PoolByteArray in texture

var t0:PoolByteArray = dados_temp[1].decompress(1,1)
var image =
var _t1 = image.save_png(dados_temp[0])

I have tried several things... Decompress dont work... I didn't find anything about buffer_size()... Let alone other ideas.
Even that didn't help me:

in Engine by (226 points)

I solved my problem.


var t0 = Main.crate_image(temp[1])
var t1 = t0.get_data()
var dic:Dictionary =
var t2:PoolByteArray = t1.get_data()
var t3 = t2.compress(3)
var t4:Array = [temp[1],t3,dic]


var t0:Dictionary = dados_temp[2]
var t1:PoolByteArray = dados_temp[1].decompress(2048000,3)
var image =
var _t1 = image.save_png(dados_temp[0])

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 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.