UMG拖放控制
来源:互联网 发布:centos jdk1.7 安装 编辑:程序博客网 时间:2024/05/17 02:52
UMG 中图标拖动需要三步,可以用来实现物品栏,快捷键的设置。
1.在需要拖动的窗口重载一下函数On Mouse Button Down:在此时开启拖放检测,拖放检测会在鼠标按下过程中一直持续。
图一:On Mouse Button Down
2. 在允许拖动的窗口重载以下函数On Drag Detected:当拖动事件被侦测到,创建Drag Drop Operation, 如图二所示:
图二:On Drag Detected
图三:Creates a new drag dropoperation
其中各参数如下表所示:
表一:Creates drag drop operation 各参数
In
ExecClass
DragDrop Operation ClassDrag Drop Operation Class Class The object classyou want to constructTag
StringA simple string tag you can optionally use toprovide extra metadata about the operation.Payload
ObjectReferenceThe payload of the drag operation. This can beany UObject that you want to pass along as dragged data. If you were buildingan inventory screen this would be the UObject representing the item being movedto another slot.Default Drag Visual
WidgetReferenceThe Drag Visual is the widget to display whendragging the item. Normally people create a new widget to represent thetemporary drag.Pivot
EDragPivotEnumControls where the drag widget visual willappear when dragged relative to the pointer performing the drag operation.Offset
Vector2D StructureA percentage offset (-1..+1) from the Pivotlocation, the percentage is of the desired size of the dragged visual.Out
Return Value
DragDrop Operation ReferenceDrag Drop Operation Reference Return Value Theconstructed object图四:On Drop
其中ED_OnSetAndDelete 为Event Dispatcher, 其目的是为了将该拖放操作传递给顶层模块,在顶层模型进行进一步的操作。
Event OnSetAndDelete 事件从Operation 中解析出传递过来的数据,从DestinationUserWidget 中得到拖拽目的地的控件。
(注意要把允许Drag Drop 操作的窗口的Root 设置其Visibility参数为Visible,(默认为SelfHitTestInvisible).这样才能接收拖放事件。)
[Reference]
1. https://docs.unrealengine.com/latest/INT/BlueprintAPI/UserInterface/CreateDrag_DropOperation/index.html
2.https://github.com/BasicCoder/Intership_UE4
- UMG拖放控制
- UMG简单的拖放控制
- 外壳拖放控制扩展
- UE4 C++控制在UMG控件中播放视频
- UMG视频教程
- 拖放
- 拖放
- 拖放
- 拖放
- 拖放
- 拖放
- 拖放
- 实现自定义拖放---创建COleDropSource 对象来控制放置
- jQuery EasyUI使用教程之树的拖放控制
- UMG 研究之ScaleBox
- UMG 研究之SizeBox
- UE4 UMG 动画
- UMG 常用方法
- 二分图匹配——匈牙利算法
- 数字视频格式及CTC的测试序列
- Linux下卸载MySQL
- L1-013. 计算阶乘和
- 检查线程是否关闭
- UMG拖放控制
- 第五封信 / 友子,我真的很想你 啊!彩虹
- Python文件读写
- FPGA中常用写法
- shiro整合springmvc
- React componentWillUnmount 替换 this.IsMounted()
- python socket,socketserver
- C#序列化
- when can we meet POJ-2028