Is this even possible?
I was able to accomplish this in Unity, but I can’t use it because of the .net 3.5 limitation (I need to include some .net 4.5 libraries). I hope Xenko will be a great alternative with it’s up-to-date .net compatibility.
I want a dynamic UI, where I can load images from websites mid-runtime and change ImageElement’s sprite data on the fly. I’ve found libraries that will POSSIBLY let me download image data on runtime. Now I would like to know whether setting texture data in code is possible (or if I wasted a lot of time working on something that won’t work).
I got a pointer to background (ImageElement) and I want to set it’s Texture property as such:
background.Source.GetSprite().Texture = new Texture().SetData(/texture data/);
As seen here SetData method requires:
----- CommandList, for which I can’t find a working constructor (seems platform specific?),
----- DataPointer (source), which requires:
---------- IntPtr pointer - Memory pointer
--------------- I have no idea what to put here, I have (theoretical) image data as variable
---------- int size - lenght of data in memory? Again am I even supposed to be touching this?
the rest of the arguments have default values, so I don’t think they need to be included.
Anybody have experience with this? Any help is appreciated.