Jump to content

Pass image in exported function


dugasz1

Recommended Posts

Hello.

I have a resource which handle my dx gui. And i need to pass them the image with an exported function if i want to render one. But how can i do it ?

If i just pass the path for it for example "images/myimage.png" the resource will try to find it in his own directory. Can i pass some kind of absolute path?

Or i have to make a texture from it first with dxCreateTexture then pass it? But then will it loaded twice in the memory? Which is unnecessary.

Edit:

I noticed something strange. So, If i pass an texture with dxCreateTexture from a resource test to my gui resource it's works fine but if i restart test resource then in gui the variable will be empty and the image disappier. I tried to modify the images variable in test resource but it doesn't change the image in the gui resource so it's not a pointer i guess.

Someone now an explanation to this?

Link to comment

So if i have two resource for example:

Test

--test.png

--lua,meta files etc.

GUI

--lua,meta files etc.

Test have an image test.png in the reosurce root directory. Gui want to use thet image.

Then i have to write ":test.png" or ":GUI/test.png" in the gui scripts?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...