Slate基础使用说明

目录

Slate基础使用说明

[1. 简单教程](#1. 简单教程)

[2. 要点说明](#2. 要点说明)

[2.1 TCommands以及TCommands基类](#2.1 TCommands以及TCommands基类)

[2.2 FUICommandInfo](#2.2 FUICommandInfo)

[2.3 FUICommandList](#2.3 FUICommandList)

[2.4 FUIAction](#2.4 FUIAction)

[2.5 UICommand](#2.5 UICommand)

[3. 代码源码](#3. 代码源码)

[4. 工具使用](#4. 工具使用)

[4.1 Display Ul Extension Points](#4.1 Display Ul Extension Points)

[4. 参考文章](#4. 参考文章)


Slate基础使用说明

1. 简单教程

2. 要点说明

2.1 TCommands以及TCommands基类
cpp 复制代码
/** A base class for a set of commands. Inherit from it to make a set of commands. See MainFrameActions for an example. */
template<typename CommandContextType>
class TCommands : public FBindingContext
cpp 复制代码
/**
 * Represents a context in which input bindings are valid
 */
class SLATE_API FBindingContext
	: public TSharedFromThis<FBindingContext>
2.2 FUICommandInfo
cpp 复制代码
private:

	/** Input commands that executes this action */
	TArray<TSharedRef<FInputChord>> ActiveChords;

	/** Default display name of the command */
	FText Label;

	/** Localized help text for this command */
	FText Description;

	/** The default input chords for this command (can be invalid) */
	TArray<FInputChord> DefaultChords;

	/** Brush name for icon to use in tool bars and menu items to represent this command */
	FSlateIcon Icon;

	/** Brush name for icon to use in tool bars and menu items to represent this command in its toggled on (checked) state*/
	FName UIStyle;

	/** Name of the command */
	FName CommandName;

	/** The context in which this command is active */
	FName BindingContext;

	/** The bundle to group this command into. The bundle must have been added to the BindingContext first. */
	FName Bundle;

	/** The type of user interface to associated with this action */
	EUserInterfaceActionType UserInterfaceType;

	/** True if should we use long names for when getting text for input chords */
	bool bUseLongDisplayName;
2.3 FUICommandList
cpp 复制代码
class SLATE_API FUICommandList
	: public TSharedFromThis<FUICommandList>
2.4 FUIAction
cpp 复制代码
/**
 * Implements an UI action.
 */
struct SLATE_API FUIAction
{
	/** Holds a delegate that is executed when this action is activated. */
	FExecuteAction ExecuteAction;

	/** Holds a delegate that is executed when determining whether this action can execute. */
	FCanExecuteAction CanExecuteAction;

	/** Holds a delegate that is executed when determining the check state of this action. */
	FGetActionCheckState GetActionCheckState;

	/** Holds a delegate that is executed when determining whether this action is visible. */
	FIsActionButtonVisible IsActionVisibleDelegate;

	/** Can this action can be repeated if the chord used to call it is held down? */
	EUIActionRepeatMode RepeatMode;
2.5 UICommand
cpp 复制代码
#define UI_COMMAND( CommandId, FriendlyName, InDescription, CommandType, InDefaultChord, ... ) \

3. 代码源码

4. 工具使用

4.1 Display Ul Extension Points

4. 参考文章

https://docs.unrealengine.com/5.2/zh-CN/slate-editor-window-quickstart-guide-for-unreal-engine/

观察UE4的界面命令(UICommand)扩展编辑器界面的流程并实践_ue4 查看编辑器界面一些功能的函数流程_YakSue的博客-CSDN博客

(UE4 4.21 ) UE4给编辑器添加菜单栏(Menu),工具栏(TooBar),Tab窗口_ue4左侧工具栏怎么打开_带帯大师兄的博客-CSDN博客

TCommands用法 - 知乎

《调教UE5:编辑器拓展指南》Command 探索 - 知乎

UE4-注册UI菜单的套路以及尝试将工具类蓝图动态注册进UI - 知乎

相关推荐
花生糖@9 天前
[UnLua]动态创建SceneCapture2d相机,并且添加渲染目标纹理
unreal·unlua
PassionY3 个月前
Unity转Unreal5从入门到精通之UMG的使用
unity·ue5·游戏引擎·unreal·umg·ugui·hud
UWA7 个月前
PlayerSettings.WebGL.emscriptenArgs设置无效的问题
android·webgl·crash·unreal
桃溪小小生8 个月前
关于UE的相机震动CameraShake
c++·unreal
码蚁先生8 个月前
React富文本编辑器开发(十二)插件
前端·javascript·react.js·前端框架·slate
艺菲1 年前
UE5 C++自定义Http节点获得Header数据
http·unreal·1024程序员节·blueprint
艺菲1 年前
Shader Graph25-UV移动旋转缩放(自定义函数)
unity·shader·uv·unreal
艺菲1 年前
Shader Graph24-摇晃树叶
unity·shader·unreal