0 votes

Godot version:
Godot 3.1

Build in Android device

I get image from http url after set textureRect texture,
Refer this one: https://godotengine.org/qa/40181/unpackaged-images-question?show=40229#a40229

In mac simulator work fine, but build in android devices, it's set blank(Black colour)
image

I also try image.save_png()
save image /data/data/Com.fan.demo/files/
but set texture is blank.

What need configuration for android?, Give me some help.

in Engine by (62 points)

did you enable Internet permission?

Sorry for delay,
Yes i enable access network status, Internet, also read-write External storage.
But now still blank image set in android device.

use gles 2 instead of gles 3

1 Answer

0 votes

I had some trouble when loading image.

You may need to insert a delay before loading the texture:

    var image = Image.new()
    var error = image.load_jpg_from_buffer(img_buffer)
    yield(get_tree(), "idle_frame")    <--- IMPORTANT!
    var texture = ImageTexture.new()
    texture.create_from_image(image, 0)
    get_node("TextureRect").texture = texture
by (33 points)
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.