Hi all, beginner here, keep things easy.
I am trying to display a map of my world and mark player position on it. When the player presses M program creates a widget which displays a bitmap with a map, that was an easy part. Problems start when I want to mark the player position (from GetActorLocation), for now with a simple DrawBox call in the overrided OnDraw function. That kind of works - I can DrawBox, but I have problems calculating correct coordinates to pass to the DrawBox. Seems like DrawBox works in a screen space, and I want to draw the mark relative to the bitmap position, so I need some converting/rescaling. Math would be rather simple, given some basic information. I can access some of the parameters required (like bitmap size, position) by calling MyMapBitmap->Slot as canvas slot->GetXXX functions, but that's hardly helpfull without screen size. From my googling seems like this can be checked only in HUD BP, not in a widget BP. At the same time I don't see how to draw over the bitmap in the HUD BP, as it doesn't have overridable OnDraw function.
Does it mean I have to do some tricks to get both kind of data in one place? Or am I just going in a completely wrong direction?
I am trying to display a map of my world and mark player position on it. When the player presses M program creates a widget which displays a bitmap with a map, that was an easy part. Problems start when I want to mark the player position (from GetActorLocation), for now with a simple DrawBox call in the overrided OnDraw function. That kind of works - I can DrawBox, but I have problems calculating correct coordinates to pass to the DrawBox. Seems like DrawBox works in a screen space, and I want to draw the mark relative to the bitmap position, so I need some converting/rescaling. Math would be rather simple, given some basic information. I can access some of the parameters required (like bitmap size, position) by calling MyMapBitmap->Slot as canvas slot->GetXXX functions, but that's hardly helpfull without screen size. From my googling seems like this can be checked only in HUD BP, not in a widget BP. At the same time I don't see how to draw over the bitmap in the HUD BP, as it doesn't have overridable OnDraw function.
Does it mean I have to do some tricks to get both kind of data in one place? Or am I just going in a completely wrong direction?
Comment