What controls a paper 2d sprite size when generated by C++?
At the moment, in order to apply my own material, I’m duplicating a blueprint APaperSpriteActor. In the actor I’ve setup a sprite with my material.
m_SpriteActor = smp_World->SpawnActorDeferred<APaperSpriteActor>(smp_Class, FVector::ZeroVector, FRotator(0.0f, 180.0f, -90.0f), smp_Owner);
if (m_SpriteActor.IsValid())
{
FSpriteAssetInitParameters initParams;
initParams.SetTextureAndFill(mp_Texture);
UPaperSprite *pNewSprite = DuplicateObject<UPaperSprite>(m_SpriteActor->GetRenderComponent()->GetSprite(), m_SpriteActor.Get(), _T("DuplicatedSprite"));
pNewSprite->InitializeSprite(initParams);
m_SpriteActor->GetRenderComponent()->SetMobility(EComponentMobility::Movable);
m_SpriteActor->GetRenderComponent()->SetSprite(pNewSprite);
This seems a bit convoluted but I couldn’t find a c++ interface to set my own material or change the sprite material to translucent. Once I resolve this I’m going to be rendering text and other shapes onto a texture for the sprite, which I’m mainly using as a method for rendering 2d at a depth in my scene.
I’m then using SetActorScale3D to scale the actor to fit a predefined 3d size. This works in essence but not practice as different textures have different resultant 3d sizes.
How is the sprite size calculated?