星鸿阁

 找回密码
 立即注册
搜索
热搜: 活动 交友 动画
查看: 942|回复: 0

部Slot里面的都是作为这个Slate里面的ChildSlot出现

[复制链接]

2254

主题

2764

帖子

9644

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
9644
发表于 2022-5-25 00:31:45 | 显示全部楼层 |阅读模式
  1. // Fill out your copyright notice in the Description page of Project Settings.

  2. #pragma once

  3. #include "CoreMinimal.h"
  4. #include "SGridDragDrop.h"
  5. #include "LevelEditorViewport.h"

  6. /**
  7. *
  8. */
  9. class DLLEXPORT MyAnimationSlate : public SCompoundWidget
  10. {
  11. public:
  12.         //SLATE_BEGIN_ARGS+SLATE_END_ARGS 其实是一个结构体, 内部写的东西都相当于写在了一个结构体里面
  13.         SLATE_BEGIN_ARGS(MyAnimationSlate)
  14.         {
  15.                 _Visibility = EVisibility::SelfHitTestInvisible;
  16.         }

  17.         //外部Slot里面的都是作为这个Slate里面的ChildSlot出现
  18.         SLATE_DEFAULT_SLOT(FArguments, OutSlots)

  19.                 SLATE_END_ARGS()

  20.                 //外部执行SNew或者SAssignNew时候会调用Construct()
  21.                 void Construct(const FArguments& InArgs);

  22.         //鼠标进入
  23.         virtual void OnMouseEnter(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;

  24.         //鼠标离开
  25.         virtual void OnMouseLeave(const FPointerEvent& MouseEvent) override;
  26.         //
  27.         UWorld* SetWorldRay(const FVector2D& ScreenPosition);
  28.         //颜色变化
  29.         virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;

  30.         FLinearColor SlateColorChanged();
  31.         virtual FReply OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
  32.         virtual FReply OnDragDetected(const FGeometry& MyGeometry,const FPointerEvent& MouseEvent) override;
  33.         virtual void OnDragEnter(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) override;
  34.         virtual void OnDragLeave(const FDragDropEvent& DragDropEvent) override;
  35.         //virtual FReply OnDragOver(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) override;
  36.         virtual FReply OnDrop(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) override;
  37. private:
  38.         //Slate动画对象
  39.         FCurveSequence MySlateCurveSequence;
  40. };
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|starfluidga

GMT+8, 2025-5-8 04:12 , Processed in 0.013569 second(s), 20 queries .

Made by Liga 星鸿阁

Copyright © 2020-2048, LigaStudio.

快速回复 返回顶部 返回列表