I feel like a real idiot regarding this, but I have NO idea how to access Paper2D classes in my code.
I looked at this tutorial, https://wiki.unrealengine.com/An_Introduction_to_UE4_Plugins#Non-Game_Module
but I’m not sure if any of it’s even relevant to accessing Paper2D stuff in code?
I’m using Unreal Engine 4.1 and have enabled the Paper2D plug-in
So yeah my question basically is, step-by-step, how do I access Paper2D classes in my own code?
Did you get anywhere with this?
I’ve got as far as trying to create a APaperSpriteActor and set the sprite on the rendercomponent but am getting exceptions thrown when I call InitializeSprite on the newly created sprite. Some sample code would definitely save me a bunch of trial and error getting this right!
In case others get here following the same path as me this gets somewhere:
void CreateTestSprite(UTexture *pTestTexture, UWorld *pWorld, AActor *pOwner)
APaperSpriteActor* spawnedSprite = pWorld->SpawnActorDeferred<APaperSpriteActor>(APaperSpriteActor::StaticClass(), FVector::ZeroVector, FRotator::ZeroRotator, pOwner);
UPaperSprite *pNewSprite = (UPaperSprite *)StaticConstructObject(UPaperSprite::StaticClass(), spawnedSprite);
spawnedSprite->SetActorScale3D(FVector(200.0f, 200.0f, 200.0f));
For long time check, I have put solution in Forum. Check this out.