Download

How to DrawTexture on top of UMG components?

I use HUD::drawTexture to draw a texture attached to mouse cursor, on the blank area of screen, it works well, but when I move mouse cursor on a UMG component(eg. UImage), the texture would disappeared.
in this picture, the orange point on the right is my texture, when move mouse to the left where a UImage placed, my texture would disappeared.
QQ图片20160301204930.jpg

even I change the Z-Order of UImage to small value, it also doesn’t work.

I’m not sure what you mean by texture attached to a cursor, but, if you are talking about the cursor itself not showing on the UMG widget, it could be your anchor settings in the UMG widget.

See this:

https://answers.unrealengine.com/questions/168809/ue-47-umg-cursor.html

If I remember correctly (which I may not be), Textures / Material drawn in the HUD class are done as part of Canvas / Slate, which does it’s pass before UMG, so UMG elements will always draw on top regardless of ordering.

The solution therefore would be to use a UImage in UMG and use that instead of the dot.

ok, i see, thanks very much for your suggestions.

Yes I do confirm this.
Canvas is drawn before UMG. Slate is also drawn before UMG.
In your UMG, don’t forget to also use the ZOrder to be sure that you “pointer” is on the top of everything.

Therefore, looking at your screen shot, it seems that you want a “orange” dot as the cursor, if I suggest that you are looking to “how to change cursor” as they are built-in function to change the default cursor image.

Yeah you can actually change the cursor icons now, worth just doing that tbh!

ok, ok, thanks very much!

ok, ok, thanks very much!