This is the final part of a mini-series on creating UIs in Unreal using UMG and Slate. Previously we discussed creating C++-based UserWidgets and creating new UMG classes.

Slate is the lowest-level of

Once again we will be implementing a simple button that contains an image and text, but this time we will see how to achieve the same result from Slate.


#pragma once

#include "CoreMinimal.h"

class SExampleSlate : public SCompoundWidget

	// See private declaration of OwnerHUD below.
	SLATE_ARGUMENT(TWeakObjectPtr<class AStandardHUD>, OwnerHUD)
  // Required
	void Construct(const FArguments& InArgs);

	// Begin SWidget interface
	void OnArrangeChildren(const FGeometry& AllottedGeometry, FArrangedChildren& ArrangedChildren) const override;
	virtual FReply OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
	virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
	// End SWidget interface

	TWeakObjectPtr<class AStandardHUD> OwnerHUD;


In this example there isn’t a lot of benefit from implementing the same behaviour in Slate over UMG. However for original, more complicated behaviour that cannot be broken down into pre-existing Slate widgets, creating a new Slate widget is your only option.


We saw that it’s