October 2016
Intermediate to advanced
452 pages
9h 47m
English
So far in this chapter, we've been creating UI elements that use the default visual representation. This recipe shows you how to create a Style in C++ that can be used as a common look-and-feel across your whole project.
"CookbookStyle.h".#pragma once
#include "SlateBasics.h"
#include "SlateExtras.h"
classFCookbookStyle
{
public:
static void Initialize();
static void Shutdown();
static void ReloadTextures();
staticconstISlateStyle& Get();
staticFNameGetStyleSetName();
private:
staticTSharedRef<class FSlateStyleSet> Create();
private:
staticTSharedPtr<class FSlateStyleSet>CookbookStyleInstance;
};Read now
Unlock full access