Hello,
I’m using widgets to create a UI with drag and drop operations and want to be able to create images (UImage to be more specific) at runtime and set the texture of the image.
I have done this with widgets solely by having a widget including only an image and spawning objects of this. I scraped this since drag and drop operations don’t have alpha and don’t work in full screen I created a drag and drop system manually from an example from Rudy. Now, this works fine I can move em around and they have alpha and all that.
This system does however use images instead of separate widgets. If I instead use a widget containing an image with this system it does not get alpha.
So my problem is that I can create images in c++ (found no way to do it in blueprints). Below is the function I use it is a blueprintcallable function.
I then set the brush from asset on the returned value and add it to an array. It works, I can drag them… but thats all. They are just white squares and I can’t get them to have a texture. Also they seem to eat all the UI inputs becuase objects below them does not get a IsHovered message.
Is there a value for not eating all the inputs and do the image need anything else in order to render a texture?`
I found why I can’t set the image. I don’t save the returned value so when I use the returned value as the one to be used for setting texture it creates a new image and the next time when I say I want to add it to the array it creates a new one. I solved this by giving the class an image which I set to a new one in the function and then use the image for referencing. This solves the texture problem, but objects below the images still do not get a IsHovered call. If I create a image in the designer the IsHovered call works great but not with my spawned ones. Is there a variable for this or something?
It seems to have something to do with the fact that the images are added to an array and accessed from there. I tried creating an image in the designer and trigger the Drag and Drop on it, everything works fine. But when I add it to the array and access it from there I get the same problem, it cannot be dropped onto the object below.
I think it is because of the object below not getting IsHovered but I can’t breakpoint it to check because when I do the editor jumps to the breakpoint but the Unreal UI does not jump into the runtime mode and I can’t klick anything but the X to close the editor.
Silly me remembered that I could just print text it and yes, the panel does not get IsHovered when I have the image in an array no matter if I created the image at runtime or in the designer. It seems very unlikely that the array would create such a change but it seems to do.
The images created at runtime hinders the IsHovered call to the panel even if they are not in the array.