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.
Controlling widget appearance with Styles
How to do it...
- Create a new class for your project by using the Add C++ Class wizard and selecting None as your parent class:
- Under the name option, use CookbookStyle and click on the Create Class button:
- Replace the code in the CookbookStyle.h file with the following code:
#pragma once
#include "SlateBasics.h"
#include "SlateExtras.h"
class FCookbookStyle
{
public:
static void Initialize();
static void Shutdown();
static void...