Using an anchor point, no meta - just one default animation.
Tick is being called; and it animates just fine when the screen is shown : but when the parent object is translated in an animation; the creature widget sits still!
Feature request? any guidance on implementing it myself? Happy to jump on & contribute to the open source plugin.
UMG animations not moving CreatureWidgets : expected?
Re: UMG animations not moving CreatureWidgets : expected?
Hello,
The code for the widget is here:
https://github.com/kestrelm/Creature_UE ... Widget.cpp
I am guessing ( but you can take a look a the rest of the implementation ) the following lines might be useful for your reference:
See how: AllottedGeometry.AbsolutePosition + (AllottedGeometry.GetAbsoluteSize() * 0.5f)
is sent in as position. Maybe that can be useful for you there?
Thanks
The code for the widget is here:
https://github.com/kestrelm/Creature_UE ... Widget.cpp
I am guessing ( but you can take a look a the rest of the implementation ) the following lines might be useful for your reference:
Code: Select all
nt32 SCreatureWidget::OnPaint(
const FPaintArgs& Args,
const FGeometry& AllottedGeometry,
const FSlateRect& MyClippingRect,
FSlateWindowElementList& OutDrawElements,
int32 LayerId,
const FWidgetStyle& InWidgetStyle,
bool bParentEnabled) const
{
const_cast<SCreatureWidget *>(this)->UpdateMesh(
AllottedGeometry.AbsolutePosition + (AllottedGeometry.GetAbsoluteSize() * 0.5f),
AllottedGeometry.GetAbsoluteSize() * 0.02f);
auto can_draw = render_brush && (render_data.VertexData.Num() > 0) && (render_data.IndexData.Num() > 0);
if (can_draw)
{
FSlateResourceHandle Handle = FSlateApplication::Get().GetRenderer()->GetResourceHandle(*render_brush);
const FSlateShaderResourceProxy * ResourceProxy = Handle.GetResourceProxy();
if (ResourceProxy) {
FSlateDrawElement::MakeCustomVerts(
OutDrawElements,
LayerId,
Handle,
render_data.VertexData,
render_data.IndexData,
nullptr,
0,
0);
}
}
return LayerId;
}
is sent in as position. Maybe that can be useful for you there?
Thanks