ドラッグ中もマウスの位置取得する
Mouse position not updated while dragging - UE4 AnswerHub
UE4、ボタンをクリック中は用意されてる関数じゃマウスの位置が帰ってこない、具体的に実装したいのは、ウインドウのドラッグ移動
フォーラムではマウスポインタアクターを用意してそこから取れとのことだけど、わざわざこのためだけにマウスポインタデザイン変更の余地うまれるの嫌なので、Windows.hのやつつかうと普通にとれる、もちろんWindows専用
.h UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Screen") static void GetCursorPosWin(FVector2D& pos); .cpp void UBlueprintFunctionLibraryCpp1::GetCursorPosWin(FVector2D& pos) { POINT p; if (GetCursorPos(&p)) { pos.X = (float)p.x; pos.Y = (float)p.y; } }
これをGetViewportScaleで取得したdpスケールで割ると今のゲーム内の単位になる