loharepublic.blogg.se

Epic game launcher screenshot
Epic game launcher screenshot




epic game launcher screenshot

If you had not configured the project to use your custom Game Instance as shown above you will get an error when trying to use this cast.Ĭongrats! You can now take screenshots anywhere, even with UI. You can now go into any class you want, cast to your Game Instance and call TakeScreenshot from there. You must do this step or the following WILL NOT work. You’ll need to go into your Project Settings->Maps & Modes then scroll to the bottom to change your selected Game Instance to your newly created class. This one’s an easy one to miss if you haven’t used a Game Instance before. Once that’s compiled you’ll need to do one small task before it’s ready to go.

#Epic game launcher screenshot code

I won’t go into much detail here as the code is pretty self-explanatory but if you want a more in-depth look at what’s going on, check out my previous post titled Taking in-game screenshots with UI in Unreal Engine 4. Once that’s done, hit compile and wait for the magic to happen. Request->RequestScreenshot("ScreenShot " + CurrentDateTime, bCaptureUI, false) cpp void UMyGameInstance::TakeScreenShot(bool bCaptureUI, bool bAddSuffix)įString CurrentDateTime = FDateTime::Now().ToString(TEXT("%Y-%m-%d %H-%M")) įScreenshotRequest* request = new FScreenshotRequest() Static void TakeScreenShot(bool bCaptureUI, bool bAddSuffix) Īnd in the. h file: UFUNCTION(Exec, BlueprintCallable) Once that’s been created and you’ve got it open in Visual Studio or Rider you’ll need to add this code to the. Similar to the original post you need to add a new C++ class which is parented to the Game Instance class rather than Cheat Manager. It exists for the entire time your game is running so it’s the perfect place to put code you may always want access to which is why we’re putting our new Screenshot implementation here. The Game Instance is the very first object created by the engine when the game is launched, after the engine’s own initialisation of course, and is the final object to be destroyed when your game is closed.

epic game launcher screenshot

It is the instance of your game….yeah, that’s an oversimplification. Well, we could derive from quite a few classes but, for now, we’ll derive from the Game Instance class.īefore we get into this I need to remind you of what the Game Instance is. “So what’s another way of doing it?” I hear you ask. This post will fix this in a quick and efficient way. The problem with that post is that I was using the Cheat Manager for my implementation however, while suitable for my use case, this cannot be used in Shipping builds of your project due to Cheat Manager being one of the things UE4 strips from Shipping builds. So you may remember a few months ago I made a post called “ Taking in-game screenshots with UI in Unreal Engine 4“.






Epic game launcher screenshot