Created
June 9, 2019 08:42
-
-
Save nobolu-ootsuka-unrealengine/ddb8d5488f0b533c644690ab2cad8ac9 to your computer and use it in GitHub Desktop.
MyPluginStyle.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "UnrealEd.h" | |
#include "SlateStyle.h" | |
#define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush(RootToContentDir(RelativePath, TEXT(".png")), __VA_ARGS__) | |
class FMyPluginStyle : public FSlateStyleSet | |
{ | |
public: | |
FMyPluginStyle() | |
: FSlateStyleSet("MyPluginStyle") | |
{ | |
SetContentRoot(FPaths::GamePluginsDir() / TEXT("Developer/MyPlugin/Content")); | |
Set("MenuIcon", new IMAGE_BRUSH("menu_icon", FVector2D(16.f, 16.f))); | |
Set("ButtonImage", new IMAGE_BRUSH("button", FVector2D(80.f, 80.f))); | |
FSlateStyleRegistry::RegisterSlateStyle(*this); | |
} | |
~FMyPluginStyle() | |
{ | |
FSlateStyleRegistry::UnRegisterSlateStyle(*this); | |
} | |
}; | |
#undef IMAGE_BRUSH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment