Slate概述
优点:
- 描述清晰(链式编程)
- 容易构建程序化界面
- 执行效率比UMG高
缺点:
- 不好调试
- 添加动画和设计挺难的
- 编写效率低
分析
-Slate都继承于SWidget。
class SLATECORE_API SWidget
: public FSlateControlledConstruction, //控制Slate生命周期,通过FMemory封装了生成和释放
public TSharedFromThis<SWidget> // Enables 'this->AsShared()'
{
friend struct FCurveSequence;//与Slate动画相关
public:
/**
* 初始化参数
*/
void Construct(
const TAttribute<FText>& InToolTipText,
const TSharedPtr<IToolTip>& InToolTip,
const TAttribute< TOptional<EMouseCursor::Type> >& InCursor,