BaseHUD.h
class ABaseHUD : public AHUD
{
GENERATED_UCLASS_BODY()
virtual void DrawHUD() OVERRIDE;
};
BaseHUD.cpp
void ABaseHUD::DrawHUD()
{
Super::DrawHUD();
Canvas->Canvas->PushMaskRegion(10, 10, 100, 100);
Canvas->Canvas->PopMaskRegion();
}
Error message:
error LNK2019: "public: void __cdecl FCanvas::PushMaskRegion(float,float,float,float)" (?PushMaskRegion@FCanvas@@QEAAXMMMM@Z) (: "public: virtual void __cdecl ABaseHUD::DrawHUD(void)" (?DrawHUD@ABaseHUD@@UEAAXXZ) 함수)에서 확인하지 못했습니다. D:\unreal\project\rpg\Intermediate\ProjectFiles\BaseHUD.cpp.obj rpg
That function isn’t set up for being used outside of the engine module, which is a bug. Looks like you’re the first person to try and use it.
To fix it locally you can add ENGINE_API to the start of the PushMaskRegion definition in Canvas.h.
I filed a bug to get this fixed properly on our end.
ENGINE_API void PushMaskRegion(float X, float Y, float SizeX, float SizeY);
ENGINE_API void PopMaskRegion();
//////////////////////////////////////////////////////////
But the same error is repeated more
Peam
(Peam)
4
Adding ENGINE_API solves the link problem but i can’t get the mask to function with line drawing via FCanvas::DrawItem.
PushMaskRegion() seems to be deprecated and deleted in the engine source. Is there another method to achieve canvas-masking know?