SHARE
TWEET

Untitled

a guest Jun 20th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma once
  2. #include "UnrealEd.h"
  3. #include "SlateStyle.h"
  4. #define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush(RootToContentDir(RelativePath, TEXT(".png")), __VA_ARGS__)
  5. class FMyPluginStyle : public FSlateStyleSet
  6. {
  7. public:
  8.     FMyPluginStyle()
  9.         : FSlateStyleSet("MyPluginStyle")
  10.     {
  11.         SetContentRoot(FPaths::GamePluginsDir() / TEXT("Developer/MyPlugin/Content"));
  12.         Set("MenuIcon", new IMAGE_BRUSH("menu_icon", FVector2D(16.f, 16.f)));
  13.         Set("ButtonImage", new IMAGE_BRUSH("button", FVector2D(80.f, 80.f)));
  14.         FSlateStyleRegistry::RegisterSlateStyle(*this);
  15.     }
  16.     ~FMyPluginStyle()
  17.     {
  18.         FSlateStyleRegistry::UnRegisterSlateStyle(*this);
  19.     }
  20. };
  21. #undef IMAGE_BRUSH
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top