#slate
1 messages ยท Page 17 of 1
Calling UObject code on multiple threads is sketchy, triggering blueprints, a lot of the interactions and material related operations are not permitted outside the gamethread...etc
I see, makes sense. Thanks for the heads up!
Also - the whole point of the loading screens is to be able to load before the game is done loading, and the assets are available, e.g. the Startup loading screen happens before the engine is even initialized, so loading anything that's Game related, will likely fail or cause issues b/c those modules aren't even good to go yet
loading screens are just special casey ๐
I use UTextures, even that is kinddaaaa sketchy
np
So best suggestion to improve it is to nope out of there?
git revert and don't look back
basically
Hey guys. Need some help. ๐ I try to create ListView for my structure customization. But it's not working and i don't know why. I make this code in cpp file:
And then i add my struct variable to blueprint or another struct in editor, i get this result
and here my struct definition https://i.gyazo.com/2f6d2d02fb2fe20cf9f7ab9deb11ca06.png
@simple vale You're passing a pointer to MakeShareable, to local variable (stack) memory.
You need to always pass a heap pointer. So in this case, it should be MakeShareable(new FName(RowNamesList[i])).
oh. thanks man. )
How do I make something like this (I just started learning Slate It is probably obvious) I tried SDetailSingleItemRow but I can't even include it, SDetailSingleItemRow.h is private
I need it for asset selection
@high hedge looks like you want to create a details panel
IDetailsPanelCustomization
I have a custom window in which I want to create the thing I took a screenshot of. Isn't IDetailsPanelCustomization for customizing existing panels?
@high hedge Just use the WidgetReflector on it to find out what widget it is.
I know IContentBrowserSingleton lets you create an asset picker menu, but for the combo box variant I can't recall what it is exactly.
this what the widget reflector shows (it is more and more apparent to me that I have no idea how Slate works)
I will try IContentBrowserSingleton
If you dig down from that node, you should hit something that looks like asset picker or some such, along with thumbnail view widget maybe.
Hmm, it's SPropertyEditorAsset, which isn't going to help you if you want to use it outside of a details panel. Unfortunately issues like that are common when trying to reuse editor widgets.
ContentBrowserSingleton is probably your best bet, but you'll have to hook it up to an SComboBox I think, as it only gives you the dropdown menu itself.
SComboButton, rather.
Thank you, will try it
Quick question: Can you define a command without a name?
UI_COMMAND(Command, "Do This", "Do this by doing this", EUserInterfaceActionType::Button, FInputChord());```
Where "Do this" wouldn't show on the toolbar
ToolbarBuilder.AddToolBarButton(FQGDebuggerCommands::Get().Command, NAME_None, FText::GetEmpty());
^^ That worked. LabelOverride parameter
widget switcher is the simplest option
Hello, I added a new toolbar button for create new slate window. but this button add a lot of window whenever when I click it. Is there any way to control it if is valid ? or something like that
FModuleManager::LoadModuleChecked<IMainFrameModule>
(TEXT("MainFrame"));
if (MainFrameModule.GetParentWindow().IsValid())
{
FSlateApplication::Get().AddWindowAsNativeChild(MyToolBarWindow, MainFrameModule.GetParentWindow().ToSharedRef());
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("this is if "));
}
else {
FSlateApplication::Get().AddWindow(MyToolBarWindow);
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Black, TEXT("this is else!"));
}```
Well, can't you save the Window?
FSlateApplication::Get().AddWindowAsNativeChild
Does that not return anything?
I just want add only one time.. but its add every time whenever I click to my new button
FSlateApplication::Get().AddWindowAsNativeChild this add everytime
yes
Then save it to a variable and check if the variable is valid
And only add the window if it's not valid
got it I will try
Something like
In header file:
TSharedRef<SWindow> OpenedWindow;
In cpp file:
IMainFrameModule& MainFrameModule =
FModuleManager::LoadModuleChecked<IMainFrameModule>
(TEXT("MainFrame"));
if (MainFrameModule.GetParentWindow().IsValid() && OpenedWindow.IsValid() == false)
{
OpenedWindow = FSlateApplication::Get().AddWindowAsNativeChild(MyToolBarWindow, MainFrameModule.GetParentWindow().ToSharedRef());
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("this is if "));
}
else
{
FSlateApplication::Get().AddWindow(MyToolBarWindow);
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Black, TEXT("this is else!"));
}
Then you only need to make sure you somewhat clear the variable again I assume
@low bluff is it problem if I write if else condition in .h files? or is it legal
Should be in your cpp but there speaks nothing against having it in the header
I couldnt find any destroy method for SWindow. Isn't there any method?
I still looking remove SWindow method? Any idea?
ok I found a solution. here it is
TSharedPtr<SWindow> ParentWindow = MainFrameModule.GetParentWindow();
if (ParentWindow.IsValid() && OpenWindow.IsValid()==false)
{
OpenWindow=FSlateApplication::Get().AddWindowAsNativeChild(MyToolBarWindow.ToSharedRef(), ParentWindow.ToSharedRef());
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("active window"));
}
else {
OpenWindow.Get()->DestroyWindowImmediately();
OpenWindow.Reset();
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("sss"));
}```
I'm trying to create my own button and when I click it I want list class(for exmp: I have 20 characterBP and they have struct. age, name , height, hair color... ). My function will list it according my filter. Could someone help me? I extended ue4 editor already created window and added some components.
What's your question ?
My question about Custom Content Browser Filter. I tried access content browser via cpp . I did create object FContentBrowserModule& ContentBrowserModule = FModuleManager::Get().LoadModuleChecked<FContentBrowserModule>(TEXT("ContentBrowser")); but I dont know how to use it? How can I get all BP Classes and filter them according my struct?
I don't know. Maybe look at how filters are implemented in the editor.
you must extend UContentBrowserFrontEndFilterExtension look at other classes thet extend it
@plain portal I did it but I dunno what should I write in it ?
Do you really need a custom filter, BTW ? Using folders to sort content works too ๐
lets imagine if I have 20 character
and all of them have their own properties(like age, height, hair color)
and you want to only show characters with hair color blue?
well as I said, look at examples, I did something similar not so long ago, and the examples helped
look at UGameplayTagSearchFilter
I already check all of them. I think my cpp knowledge not enough to do this. I just had experience with BP . I started work cpp 3 week ago. I need work more... ok thanks a lot @plain portal for your suggestion
oh, then yes, you will need to start learning a lot ๐
I mean, this sounds like a lot of work for unclear value, for 20 characters i'm sure you can remember which is which
yeha for game creator its ok. but for anyone else?
What do you mean ? if it's an editor feature, only you will get it
for another game creator or game developers or game designer whatever ๐
I know its so easy via BP. but in editor a hard for me at least ๐ but I will do it and share from here
I mean, an Excel sheet with attributes on columns and a line for each character would present all that data (and you could actually import that into a DataTable in UE4)
It's okay to develop tools, but are you sure that's the best use of your time ?
yeah because this project which I work on it will be a special framework for project.
I will prepare whole character BPs, ActorBPs etc. and game designer only will write for exmp. character with yellow hair and etc.
for make easier
Why not just do your game right away ?
Its not game exactly. Its VRET project
Virtual Reality Exposure Therapy
and when someone want a scenario we will use it
I know sounds like complex
How would one go about using DrawVisualizationHUD to add a Slate Widget to the EditorViewport?
That's for drawing directly to canvas.
If you have a widget, you need to get hold of the viewport widget itself somehow and add it as a child.
Yeah got that far then, but at the end went back to just using the Canvas with text and the context menu for options
how would I modify an SImage's pivot?
it defaults to 0,0, I'd like to make it 0.5, 0.5
found it
RenderTransformPivot
Hello, Can I define slate components as variable?
TSharedPtr<SEditableText> ageInput; I tried like this
and also SVerticalBox::Slot().VAlign(VAlign_Center)[ ageInput ]
SAssignNew(Variable, type)
You can use SAssignNew to create it and set a variable to point to it, all inline, as @quaint zealot mentioned, @steady walrus.
But specifically, the error is saying that you can't use TSharedPtr as the value for the [] operator on slots. You need a TSharedRef. Just call ToSharedRef() on your shared pointer variable - that'll get you a shared reference.
IE: ageInput.ToSharedRef()
This is more of an editor-related question, but does anyone know any examples of how to make a text box that autocompletes or autosuggests?
@@
Is there any documentation anywhere regarding managing the lifetime of objects create inside slate widgets?
E.g, creating a UTexture2D in an SLeafWidget and adding it to root.
When the widget is destroyed, I want to ensure that the texture is removed from root and can be destroyed
Do I just override the destructor for a Slate Widget or is there some native destroy function I should override?
@craggy holly Better to just FGCObject instead of adding to root. It will handle referencing for you.
See SInvalidationPanel class.
@craggy holly I use regular UObjects for controlling lifetimes myself
Thanks both!
@limpid atlas Just looking at SInvalidationPanel, so by inheriting from FGCObject, I can just add the texture to the collector in AddReferencedObjects?
Then when the widget is removed for whatever reason, the texture should get cleaned up
@craggy holly When the widget is destroyed, yep.
Awesome. tah!
Does anyone know how to create a new window with multiple tabs instead of just one, when you click on a button in the toolbar?
I already have it working with one, but I don't see how to make it two tabs
I already discovered SDockTabStack btw, but I coudln't figure out how to use it
also, there are two widgets, SDockTab and SDockableTab that are completly unrelated and while code examples use SDockTab, SDockTabStack seems to support only SDockableTab
lol, I just saw that SDockTabStack isn't even implemented properly... It's functions have an empty body
ok now I found out that SDockingTabStack (which seems to be the one to be used) isn't public
You basically want multiple windows
Or?
Cause the default "Tab" that you use to move the tab to multiple different other windows is kinda per window
Yeah, multiple windows, but I want to create all of them with one button click and I want them to be in the same window
@warm vault You would likely want to create your own nested tab manager for that.
Have a search in the engine code for uses of FTabManager to see how. It's fairly involved though, so if it's not super important, you might not want to bother ๐
I agree, I wouldnt want to bother with that then
Non-dockable tabs are really easy though
then I will just be satisfied with creating multiple windows and arranging them by myself ๐
If you are fine with that :D
whats the difference between dockable and non-dockable tabs?
there are only SDockTabs, right?
Na, don't get me wrong. Just tabs you click that show different content below them
The MergeActor stuff
Has these neat buttons at the top
So if you find that window, you can at least do these kinds of sub tabs
That's also a way (:
and I have to moved them into the same window once and UE remembers their placement
so I kind of get the effect I want
but maybe I want to use these sub-tabs ๐
whats the widget called?
Ehm, just check for MergeActorDialog or something like that
The tabs are checkboxes that have an index bound to them
I have a UMG WidgetBlueprint, is there an easy way to transfer it to Slate?
"Transfer" it? Like, convert it and get rid of the UMG asset? No.
If you just want the Slate widget created by the UMG widget at runtime, GetCachedWidget
Well, I have an UMG Widget Blueprint, but the function in the classes I want to use uses SWidget.
Use GetCachedWidget then
Yep. UWidget simply wraps Slate widgets and provide a UMG API. UUserWidget is a UWidget subclass that supports having a tree of UWidgets inside of it.
Ultimately, everything boils down to UWidgets wrapping SWidgets.
I wish I had an idea how Slate works, but it's so unreadable D:
Slate is a few things. One of them is the weird kind-of-horrific-abuse of C++ operator overloading to make it look like a declarative language and one giant statement that can't be easily debugged.
But also, more broadly, the whole Slate renderer, input routing behavior, etc.
I actually quite like Slate syntax once you get used to it :p
I love the Slate syntax, though it definitely is an horrific abuse of C++ operator overloading
Once you understand the container logic of UMG you'll have no problem reading slate
As long as vs doesn't screw up the format
It's just widget in widget in widget and below each widget listing you can add options, bind functions, set variables
For generic ui like a few boxes and buttons, it's really not that hard to use
Still a monster though
Well, UMG is visual, Slate is not ๐
are there VS settings to fucking not fuck up slate formatting
Biggest issue with overloading [] for slate
it makes literally impossible to debug
especially if you have long widget tree
and debugger can only show you that there is something wrong in tree but not where
and I don't like that slate can't really work in retained mode.. ;s
To be fair I've almost never got anything to debug in the Construct() call
Despite writing quite a high volume of Slate code
Mostly it's just creating widgets, the crashy parts are when they're running
Anyone have a good web-page or video overview, tutorial, etc... for handling the navigation/focus system inherit to Slate?
There aren't any shortcuts to convert Slate widgets to UMG widgets, right? I'm pretty sure there aren't other than just manually remaking everything by hand but I wanted to check to be safe so that I don't waste a bunch of time.
There is no automated way, you need to wrap your Slate widget with a UUserWidget, UPanelWidget, or some other type.
I've hit a wall with SlateApplication::GetUserIndexForController not using a mapping I can tie into with engine changes ... Anyone here create or knows of a good workaround for mapping a gamepad to ControllerId=1 (while ControllerId=0 uses the keyboard?)
@dense gorge what does speak against making oyur slate widget available to UMG?
you can still make properties visible to blueprints through UPROPERTY
same for delegates and stuff
@hasty scarab There should already be a general setting to move the Controller to ID 1
So that you can have Keyboard and Controller for first and second player
Not really slate related, but more input
@low bluff how would this work? From what I can tell in int32 UserIndex = GetUserIndexForController(ControllerId) it's just passing through the ControllerId. And the ControllerId comes from the input interface (e.g. XInput on Windows).
I just know that people struggled with the controller offset and someone PRd a change that allows you to offset it so that the second Player starts with Controller
And User index for controller sounds more like the local for a player controller reference
Right, multiple players in local space (nothing network based), both sharing the same viewport.
Aside, I know if I force a remapping by deriving off of GameViewportClient it works.
bool UMyViewportClient::InputKey(FViewport* Viewport, int32 ControllerId, FKey Key, EInputEvent EventType, float AmountDepressed, bool bGamepad) { if ( bGamepad ) { ControllerId=1; } // TODO: test force remapping controller to P2 return Super::InputKey(Viewport, ControllerId, Key, EventType, AmountDepressed, bGamepad); }
Has anybody done much work with FSlateDynamicImageBrush?
I want to know if I can provide it with any renderable resource (like a UI material or a texture) and whether it will render it correctly or not
Basically I'm trying to parse materials/textures from a Rich Text Block and display them using an image decorator
I've got it working with Slate Brush Assets, but i want to be able to specify any texture/material if possible
@craggy holly I'd love to know if you managed to do this, I only got the image decorator working with PNGs on-disk and brushes
* Inserts a widget at a specific index. This does not update the live slate version, it requires
* a rebuild of the whole UI to see a change.
*/
UPanelSlot* InsertChildAt(int32 Index, UWidget* Content);```
someone ever used this?
what does "rebuild of the whole UI" entail?
@toxic dove You're dealing with the problem of wanting to insert children in Horizontal/Vertical boxes at particular indices?
Yep, I tried for a while
In the end I found it easier to save pointers to children, remove them all from the box, and re-add
or to use another type of container like a grid one that lets me set row/col
yep, at runtime it's fine
you get the correctly cast slot for the widget, and call SetRow
Try it and find out ๐ You can even do it from Blueprints
thats funny say that again
Hi guys. I need help. ๐ How i can convert editor viewport screen point to editor viewport world point?
` FLoadingScreenAttributes LoadingScreen;
LoadingScreen.bAutoCompleteWhenLoadingCompletes = true;
LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();
GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);`
Hey I found this code for creating a loading screen, I've never touched slate, how can I define my widget and then find it from the code here?
A widget is just another class
You can use SCompoundWidget as parent
It works similar to UMG
You have a main SLOT (ChildSlot)
And you can put other widget in there
for example a SHorizontalBox
And in its slots more widgets
etc. etc. just like the hierarchy of UMG
There should be examples on what function to use and how the header and cpp file of a widget should look like
Don't have them at hand right now
can't I create that widget with blueprints and load in C++?
like with UMG I don't need any code
Already asked that. It seems it doesn't tick/work properly
You can create a UUserWidget
Which is basically the C++ parent of a UMG widget
And grab the CachedWidget
Which should be the underlying SWidget
But that doesn't seem to work, at least that's what I got told
jesus xD
who could've thought that such a simple thing as loading screen would be so tedious
It is only if you haven't stepped into this
In general it takes a few minutes to setup
You can later even feed the Widget values that you define in the game instance
Such as images, text, etc.
I do that in a client's project to randomly grab loading screen images
well slate seems bullshit so far
like 2 pages of code to set up a widget with 2 buttons
That's c++ compared to Blueprints in general
But trust me, the Loading screens work properly
So it's worth the fight
#include "Hoverloop.h"
#include "LoadingScreen_Base.h"
#include "SThrobber.h"
void SLoadingScreen_Base::Construct(const FArguments& InArgs)
{
LoadingScreenImages = InArgs._InLoadingScreenImages;
const int32 RandomIndex = FMath::RandRange(0, LoadingScreenImages.Num() - 1);
ChildSlot
[
SNew(SOverlay)
+ SOverlay::Slot()
[
SNew(SBorder)
.HAlign(HAlign_Fill)
.VAlign(VAlign_Fill)
.BorderImage(&LoadingScreenImages[RandomIndex])
]
+ SOverlay::Slot()
[
SNew(SBox)
.Padding(FMargin(40.f))
.HAlign(HAlign_Center)
.VAlign(VAlign_Bottom)
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.HAlign(HAlign_Center)
[
SNew(STextBlock)
.Text(FText::FromString("LOADING"))
.Font(FSlateFontInfo(FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Bold.ttf"), 16))
.Justification(ETextJustify::Center)
]
+ SVerticalBox::Slot()
[
SNew(SThrobber)
.NumPieces(8)
.Animate(SThrobber::Horizontal)
]
]
]
];
}
That's all I needed for mine
I know they work properly
tested already with the default one
use of undefined type 'SThrobber'
any idea how to deal with this?
SThrobber sits in some module
okay found it
If a Header can't be found, then yo uneed to include the module in your build.cs
Most important is still:
"UMG",
"Slate",
"SlateCore"
so basically how do you guys make slate widgets?
Don't know if that fixes it
because you can't preview them like umgs right?
Well no, you'll have to test ingame
I mean, you really don't HAVE to use slate in most cases
It just turns out that it's needed here
Slate widgets can be wrapped into UWidgets
(Not UUserWidget)
These will then show up in your UMG
Just like the other elements you can drag and drop in there
So if at all, use Slate to extend your UMG
I tried to use UMG as my loading screen
used async tasks and threads
but the engine crashed : P
Yeah, don't do that :D
ue seems so random to me xD
like I was messing with game instance to add background loading/unloading
and suddenly my game instance variables don't work anymore
xD
`class MyLittleLoadingScreen : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(MyLittleLoadingScreen) {}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs)
{
ChildSlot
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
SNew(SThrobber)
.Visibility(this, &MyLittleLoadingScreen::GetLoadIndicatorVisibility)
]
+ SVerticalBox::Slot()
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
SNew(STextBlock)
.Text(NSLOCTEXT("MoviePlayerTestLoadingScreen", "LoadingComplete", "Loading complete!"))
.Visibility(this, &MyLittleLoadingScreen::GetMessageIndicatorVisibility)
]
];
}
private:
EVisibility GetLoadIndicatorVisibility() const
{
return GetMoviePlayer()->IsLoadingFinished() ? EVisibility::Collapsed : EVisibility::Visible;
}
EVisibility GetMessageIndicatorVisibility() const
{
return GetMoviePlayer()->IsLoadingFinished() ? EVisibility::Visible : EVisibility::Collapsed;
}
};`
could you just tell me how to make the throbber bigger and green?
: P
made it bigger using NumPieces
can I make it green? ๐
Ehm, not 100% sure
Maybe via a Tint or color
Just check what comes up when you use "."
What you can set there is what is defined in the "SLATE_BEGIN_ARGS"
So you could check the SThrobber
and its args
and see what you can do
probably nothing will come up when I use "." because intellisense is shit ๐
Gnah, open the SThrobber header
SLATE_BEGIN_ARGS(SCircularThrobber)
: _PieceImage( FCoreStyle::Get().GetBrush( "Throbber.CircleChunk" ) )
, _NumPieces( 6 )
, _Period( 0.75f )
, _Radius( 16.f )
{}
So I guess you could maybe modify the PieceImage
It's a "FSlateBrush"
I think there is a loadingscreen plugin that exposes some things to create loadingscreens from blueprint
and I think it can easily be extended to show a UMG widget on top of the loading screen
should be a few lines of code
if that helps @paper heart
@warm vault nope : P
what is it lacking?
I have no idea how to show umg there
and even if I did, I don't know if it wouldn't freeze
I've already used it to display a slate loading screen : P
I think I know how to do it, I will see if I can add it this weekend, since I will need code like this later anyway
I suggest you test it with a throbber
because non moving umgs load fine
but as soon as you need something animated, it goes poop
you mean you could add non-animated widgets to this plugin?
without any plugin I think
or wait
I think i just grabbed a part of the code
and hooked my own umg stuff there
I see
`void UMyGameInstance::Init()
{
Super::Init();
FCoreUObjectDelegates::PreLoadMap.AddUObject(this, &UMyGameInstance::BeginLoadingScreen);
FCoreUObjectDelegates::PostLoadMapWithWorld.AddUObject(this, &UMyGameInstance::EndLoadingScreen);
}`
you should expose an asset pointer to the UMG widget, set it from the config window, then load it via .Load() and then get a valid instance of the widget with .Get()
I've overwritten these functions in a blueprint and displayed umg, my main problem was that it freezes because the game freezes during loading and slate/ movie player is running on a separate thread
which you should be able to add in a child slot, if the loading screen allows any
but it runs on the same thread as the game and freezes during loading ๐
when I tried async tasks, ue crashed
umg runs on the same thread as the game thread, but slate does not?
I don't know if it's slate or movie player
but movie player runs on a separate thread and I think it works because of it
but it makes sense that some things freeze, since a lot of things get invalidated during a loading screen
so you wouldnt want many things to run in the background
yeah but come on, I just wanted a throbber lol
and the things I've gone through to have it made me dislike throbbers and loading screens in general
๐
then how important can it be to show a throbber? xD
well if you tried my approach already I guess I dont have to try anytime soon
a throbber is a must have ๐
at any point there must be something moving on the screen!
๐
well yes, i guess you are right
Anyone know whether it's possible to tweak the shooter Game code UI so rather than "AddToViewport" I can just add it to a UMG widget, or even assign a viewport to a UMG in world object. Basically just looking for a quick an easy port. At some point I will just redo all of the UI, but for some quick prototyping I just want to hack it onto an in world UMG if possible
course its possible
go look at where its adding the widgets and change it to your liking
can anyone tell me which slate widget I can/should use to render a dynamic texture?
I already know how to create a FSlateTexture2DRHIRef, but what widget uses this to render the texture?
@warm vault I would guess SImage using an FSlateDynamicImageBrush. But not sure how it works.
thank you, but the issue lies somewhere else :/
I think the issue is that I can't access objects from the level, when I create widgets in the editor
anyone know why i am getting this error:
you have to add semicolons at line 15 and 16
and you have to add : _OwnerHUD(nullptr) behind line 14
also make sure you add SlateCore/Slate to your private dependencies @sage valley
@sage valley has it been fixed by now?
first of all, I made an error, I didnt mean line 15 and 16, I meant line 16 and 17
and second, maybe you have to put the initializer list into a new line... (but I doubt it)
but if you do that its exactly the same as in my code
but I think you have to check your module dependencies
because the macro does not seem to be recognized
Hey, I'm creating a mobile game, and have made a widget with a UI button
I can add it to the viewport fine, but the button isn't clickable for some reason
I also don't see it change to the hover state when I hover over it in the editor, so I'm thinking it may have something to do with the z-index compared to the default mobile joystick widget?
However, even if I create this new widget with a z-index of 9999 or -9999 it still doesn't work
Huh, fixed it by changing "Add to Player Screen" to "Add to Viewport", still feels like a bug though, you expect to be able to use the button if it gets added correctly and you can see it...
ive never used AddToPlayerScreen
maybe this has to do with splitscreen support
usually you would use AddToViewport, or AddChild under panel widgets
AddToPlayerScreen is Splitscreen, yes
Hey, I'm trying to add a widget in world space (for interactable screens ingame). However, no touch input seems to go through to them. I've also tried to add the slider from the math example, which also isn't getting input (could this be caused by the mobile joysticks?). How could I make sure the 3D space widgets work too?
if I remember right there is one component to render the widget and one component to handle input for such widgets
since you are in 3d world space you need to mimic a mouse pointer in a different way, which is the purpose of that second component @gentle bison
if I remember right, at least
I have the widget input component added
Hover states do work, I just can't click on the button (it just resets to the non-hover state when I try clicking it, until I move my cursor and it goes back to the hover state)
@warm vault any idea how to fix this?
nope, not on the spot
Slate in general yes
How would I get a scrollbox's max offset if its within this hierarchy
canvas panel -> veritcal box -> sizebox -> scrollbox
Hello Slate friends... I feel like this channel is the most dead of the dead.
But I'm having an issue with the correct syntax for binding a SButton
what do you mean?
anybody knows how to programmatically add slots to a layout widget?
.UseAllottedWidth(true);
SWrapBox::FSlot slot = ref->AddSlot();```
this doesnt work, but there is nothing else that would allow me to add a slot
if I look at the operator, it says to use it somehow like this:
ref + SWrapBox::Slot()
[
SNew(STextBlock)
.Text(FText::FromString(TEXT("Hello")))
];```
this doesnt work either...
@warm vault i would assume it's the same way as adding slots to Veritcal/Horizontal box?
SNew(SWrapBox)
.UseAllottedWidth(true)
+SWrapBox::Slot()
.HAlign(EHorizontalAlignment::HAlign_Fill)
.VAlign(EVerticalAlignment::VAlign_Fill)
[
SNew(SButton)
.Text(FText::FromString("btn1"))
]
+SWrapBox::Slot()
.HAlign(EHorizontalAlignment::HAlign_Fill)
.VAlign(EVerticalAlignment::VAlign_Fill)
[
SNew(SButton)
.Text(FText::FromString("btn2"))
]
+ SWrapBox::Slot()
.HAlign(EHorizontalAlignment::HAlign_Fill)
.VAlign(EVerticalAlignment::VAlign_Fill)
[
SNew(SButton)
.Text(FText::FromString("btn3"))
]
Not the greatest example... But you can see it working here
thank you, but I was trying to add it programmatically after it has been created.. :/
I currently gave up on it, since I could work around it, but I still would like to know for the future
i mean, I already had it working your way, but it was not what I wanted to do
@warm vault Are you just after this?
[
...
];```
Hah. Don't do that ๐
But yeah, pretty sure the syntax is basically the same as the declarative version.
at least the compiler doesnt complain
i will report tomorrow if it worked..
ok it worked
and I forgot the key shortcut to flip the screen upside down, so can I take my words back that I would do it xD?
how do I tell VS to not automatically inline stuff for slate?
oh my god, i solved the slate indention issues
dont put the opening [ on a new line and everything will indent properly
@warm vault you can try wrapping functions where things are getting inlined in PRAGMA_DISABLE_OPTIMIZATION, PRAGMA_ENABLE_OPTIMIZATION
Does anyone know why ShooterGame sets:
[UI]
+ContentDirectories=/Game/Sounds/InterfaceAudio
DefaultEditor.ini
do UI sound assets not get packaged otherwise?
when a widget in a slate virtual window has keyboard focus, is there a way to make the key event go back to the non-virtual window if the FReply is unhandled?
possible solution seems to be: use inputpreprocessor, manually dispatch back to game viewport
Hey, does anyone know how would I add a Collapse all button to the Widget viewer in the UMG editor, like the Details panel have for example? where do I need to look?
You'd need to modify the editor code
Hit it with the widget reflector
that will tell you where the code was written
If you need to collapse all in the hierarchy view, if you hold shift and click, the arrow, it collapses everything under it
or expands it when doing the opposite
Hi guys.. I need to make a chat system where in a message is displayed in the form of texts and emoticons. Can RichTextBlock be used for this? If yes, where should I begin? I have never used slate before.
If you want some example code, go see STestSuite
there's a section in there that uses RichTextBlock
Was attempting to convert Slate widgets to UMG here. Had the idea, recently, to try migrating all of the DrawMaterialSimple() methods and whatnot into a UMG child widget that I can drag-and-drop into the UMG Editor. I think that I'm going about this the wrong way, though, because in the HUD class you can get direct references to Canvas... but since HUD::Canvas is a protected member, I cannot get a reference to it from outside of the class instance.
This really screws up my plan and I can't think of how to get around it, apart from just manually drawing absolutely every detail in the UMG Editor from scratch.
@dense gorge I don't see the problem right now?
To get a Slate Widget into the UMG, you have to create a UWidget Child and build the Slate Widget in it's RebuildWidget Function iirc
That's a good point @low bluff -- I feel really stupid because I'm only realizing just right now that this thing I've been working on has not been a Slate widget. It's a bunch of Draw() commands in the HUD class that I'm trying to convert to UMG. No wonder I've been banging my head against this wall! I was misunderstanding what I was working on here. I feel really dumb.
So what I'm -really- trying to do here, apparently, is to convert a UI system contained in a series of HUD classes into a bunch of UMG widgets
My dudes, I'm creating a tooltip for a custom SCompoundWidget - is there a way I can easily get the mouse position normalized in widget-space for said tooltip?
E.g, hovering top-left would be 0,0, hovering over bottom-right would be 1, 1
I could do it manually, but hoping there's an easier way
there is a local space value hiding somewhere in teh codez
@craggy holly Any luck? I'm fighting with the fact that "absolute" space for FGeometry is legitimately absolute. Like, 0,0 is the corner of the first display... :/
guys so a question can i not play a movie during seamless travel ?
not sure if this question belongs here or in multiplayer
@trim kestrel I feel like I've done this before, I think there's a way to convert absolute to local using the Cached Geometry
Like AbsoluteToLocal or something.. though sometimes I'm not entirely certain what absolute / local actually is
I thought local
is the local space of the widget you call the function on
so the erm
lowest level local in hierarchy
@trim kestrel @craggy holly Absolute is the slate coordinates in virtual desktop pixels. Local is the pixel coordinate in widget(slate) space
Yeah, that's what I figured. I've had some odd edge cases where things come back in viewport coordinates or screen coordinates - but only in very specific scenarios
I did a pull request waaaay back on this, it basically added functionality to project VDPs to slate units (VirtualDesktopPixelToViewport)
this function has since then rotted however (it no longer takes DPI into account), but I'm working on an amended pull request that will fix this as soon as I get my ass moving
Hmm, I would be super interested in those edge cases if you manage to find good repro cases for them ๐
I actually found another DPI related bug/problem in slate quite recently, hopefully I can get that into the PR as well
would be great to talk it over with Nick or someone first though xD
but can do that in the PR I suppose
@real horizon Those functions already take scale into account
LocalToAbsolute puts it in Desktop or WIndow space depending on if you're in Tick vs, Paint geometry
Hello there @silent patrol !
I tested them over 2 days, and they unfortunately do not
you can compare the implementation to for example UpdateCachedMousePos in the very same file, which does introduce the DPI scale correctly
it's giving us some problems since our device reports coordinates in VDPs, and it stops working in non-standard DPI modes unless I correct using windows DPI scale (which I'm doing now until the pull request is accepted)
it's a bit more complicated than that, but in editor mode, it is a decent explanation I suppose ๐
I'm pretty sure that DPI was working when I originally added those two functions years ago, but either they never worked correctly, or something changed in how DPI is treated in the engine since then
Guys anybody done much with Details Panel Customizations?
I want to specify a couple of unique widgets for properties of a given class, I don't want those customizations to carry over to details panels so I'm trying to do this all in the class details panel itself.
So far though, I can't seem to find a way to set a custom widget for a given property
I could try hiding the original property widget and adding my own custom one, that seems easy enough to do - but I can't actually find the original property in IDetailLayoutBuilder
Kk, worked it out. Can access it this way. Only problem is, GET_MEMBER_NAME_CHECKED doesn't seem to allow protected properties ahhhhhh
{
IDetailCategoryBuilder& GridSettingsCategory = DetailBuilder.EditCategory("Grid Properties");
// Get the properties we want to customize, mark them as hidden so they don't show up
TSharedRef<IPropertyHandle> PropHandle_GridOrigin = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(UST_SparseGridData, GridOrigin));
PropHandle_GridOrigin->MarkHiddenByCustomization();```
You're making editor customizations, @craggy holly ?
Oh yeah, I had a lot of fun when doing the InstaLOD Plugin UI
@craggy holly Ping me if you have any problems.
@craggy holly there should be FindProperty (or something like that)
or Property Iterator
which should just iterate over everything in given class
Oh, joy. Details customizations. I lived and breathed that for months, working on localization related UI.
@craggy holly Also down to help consult on that rabbit hole.
What are you guys making with Slate these days? Any screenshots?
The item cards in Fortnite are 100% Slate, for what that's worth. Did that back in like September though.
Half-typed out another message and forgot about it.
The skill tree stuff in Fortnite is a mix of UMG for the actual nodes and the details panel stuff, but the lines between them, zooming, and panning are done in Slate.
@trim kestrel what drives your decisions when it comes down to use UMG or Slate?
Unless I have any reason to do it in Slate, it should be UMG.
The only reason to use Slate over UMG is because you don't have a choice in the matter or rare performance cases.
Mind you that Slate is not the only option for writing UI logic in C++.
There's always having native abstract base classes in C++ for UMG widgets that you then make concrete BP subclasses of, where you then layout the widgets within it.
For editor UIs though... Slate is just the only option right?
Yeah
Sorry, yes.
I guess, strictly speaking, it's not impossible... but you wouldn't have access to most of the Slate-only editor UI that exists already, which is huge.
Not to mention, when you get into editor code, it's not like you're going to have much high-level Blueprinteable stuff
I see.
I got around it in the end, unfortunately there are some limitations with details customizations it seems - but the re-ordering issue is driving me batsh!t. Anytime you want to customize a property, you have to manually add all subsequent properties or it'll appear at the top of the category.
I mean it's fine i guess, since CustomizeDetails() is only ever called when the panel is created by the looks of it, just a bit of a pain when you have a lot of vars to tweak
Sorry folks - I go away for a few days and everyone replies within minutes :p
It is however.. slowly paying off..
Looking good
And yeah keeping order was a pain iirc
However despite the big square, what did you actually change? Most of the visible Properties look non custom
As in the Detailsview should already take care of them
@craggy holly
Grid Origin and Number of Cells are a customization so far, along with a bit of extra text for a couple of properties.
The big square is another tab entirely ๐
I wanted to Grid Origin and Cells to mirror the way Transforms look
Is there someway I can generate a slate widget from a given UObject much like what is done in the editor for details panels?
Effectively create a detailpanel widget and initialise it with the uobject. This is all for editor work
@trim kestrel gave me a hand. Pretty simple once you find it
FPropertyEditorModule& propertyModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
TSharedRef<IDetailsView> settingsDetailsView = PropertyModule.CreateDetailView(FDetailsViewArgs());
TArray< UObject* > objectsToView;
Objects.Add(ObjectToView);
settingsDetailsView->SetObjects(objectsToView);
Yeah that can be quite handy if you want to use the details system elsewhere
especially for things you can't necessarily "select"
@arctic gale is SettingsDetailsView a slate widget that contains everything you need to render and edit the details view?
@warm vault To render a details view in your own custom window yep! To override existing detail views for uproperties that's a different process
but the snippet above renders default widgets for properties, right?
so if I had a UObject with a FColor and boolean property, it would show a color picker and checkbox
?
Yep, well as long as you add the slate widget to the viewport
yes of course
we are talking about adding it to a widget inside the editor, right?
or does it have to be a viewport widget?
Yeah adding it to a widget inside the editor, specifically for a custom tool I'm working on
ok nice
i knew this was possible because nick mentioned it in one of his streams
but i didnt know how
So how hard is it to make your own editor UI?
hardly at all
even for the UE editor, they use automatically generated UI (like the one above) in most cases
I'd actually say it's pretty tedious.
The details customization system leads to a lot of verbosity in terms of how you write your code and how many classes you need to create to do any simple thing.
I'm not saying it's unnecessarily complicated, but it is complicated.
There are a lot of abstractions between the reflection system and getting a set of widgets for an object.
Yeah I agree. Amount of boilerplate gets tedious pretty fast.
I could be missing something, but I never found an example of just creating a property handle directly. Meaning there is this split between detail customization, and general UI. You're always in one context, and missing the use of functionality from the other.
I find I spend half my time working around limitations that there's no obvious reason for.
Anyone come across the issue of scroll bars showing up for one frame, then readjusting, and know of any way to suppress it?
I dont, but does that happen only when you use scrollbox widgets? are the scrollbars not supposed to show up ata all?
In this case it was an issue with a details panel, I've worked around it. But I've seen it a number of times in other contexts. It seems like the calculations it does for determining required size sometimes aren't instant, but rely on previous frame state or something.
i think I noticed something like that as well once, when I had used a combination of wrapbox and scrollbox in order to dynamically render a lot of (variable) items
or even when using tileviews
i will do a stresstest using tileviews and report back if it happens even in a scrollbar scenario implemented by the staff itself
if it does, then I assume that there is no solution to this issue xD
hmm yeah there is a flickering
Anyone have idea how to create something like scrolling text which is used in news to display messages? Or is there something similar built in engine I can look at? I'm open to sugesstions
I found this: https://www.youtube.com/watch?v=ejs4fkQvbhY which is UMG 'SHorizontalBox' clipping text inside it and it is animated. For me I would like to display messages pulled from server so it I think I need to approach it in some procedural manner.
In this tutorial we quickly cover how to make scrolling text in unreal engine 4 to work on your widgets for a cool dynamic look and feel.
ahh, I think I can do with jus SScrollBox and hide scrollbar
Debugging slate in editor should not be a problem right?
Shooter example doesn't show the slate UI in editor
Not sure what you mean by "debugging slate in editor".
You could use the widget reflector to inspect the Slate widgets you're seeing.
@trim kestrel I guess they have code to not add the slate menu to viewport when in editor because I don't see it in editor. Only once I run the built exe
shooter game's in game main menu is made using slate
It doesn't show in editor though
That's unusual. I would not expect said UI to just not be added if in-editor.
its been like that since I've messed with it back in 4.8
Only now am I digging more into slate and would like to debug faster
๐คท I don't know why you're not seeing any of the game's UI when PIE'ing.
You could try running with -game to see if it's any different.
oh neat ok I'll try that
its been tough but I'm making progress on adding a Key Rebind to the shooter game! Really nice to see progress
In t his example https://wiki.unrealengine.com/Template:Slate_Introduction_โ_Basic_Menu_Part_1 is the SNew(SVerticalBox) + SVerticalBox + SVerticalBox done because you can only add vertical boxes to the SNew(SVerticalBox)?
If I wanted to add a SHorizontalBox I could not add it there without first doign SNew(SHorizontalBox) ?
I think I finally made sense of it
I've gotten the nesting down but it doesn't seem to want to align any different
oh I think the shooter menu does something fancy where the first item is always centered (or forced to be)
The + SVerticalBox::Slot() [ ... ] is just adding an entry into the vertical box, you can put anything inside it.
So yeah, if you want to nest a horizontal box, you need SNew(SHorizontalBox) in one of the slots.
Check you have your module dependencies listed properly for slate to show up, it should work same way in editor as in game, the only way you could omit some parts of code is by using macro and platform dependent compilation
hey guys
can i use an override of the slateapplication?
I need to get in there to fix some issues with input
no what i mean is
if I override that class
sorry i expressed myself wrong
if i create a child class of slateapplication to override some of its functions
I need to use the new child class instead of slateapplication
And I don't know the slate architecture well enough
so I would like to know if there is a way to use my own custom slateapplication class
Ah well that I don't know, sorry
But I'm pretty sure someone will ask sooner or later (timezones)
@ornate apex Not without using a modified engine, no.
@limpid atlas Oh man that is bad news.... Here is the deal... Unreal engine allows to skip assigning gamepad 1 to player 1 if you want
so you can play with keyboard on player 1
and player 2 uses the plugged in controller
...that works just fine
...but it's not shifted on UI input
so this feature is basically limited to gameplay only
gonna have al ittle play in slate and such
im just wondering do editor modules have a sort of
OnTick thing
well editor module windows
Every Slate widget has a Tick method.
Man they need more doc and tutorial for slate information
yeah they do, but for more meta like things
i really would like to have more tutorials or docs on how the UE works internally
it would help tremendously with debugging code
and also writing proper code
Hello, I learning how to use ListView in Slate, In ListView, I have one row, and one columcell of it with a checkbox, I wonder when the checkbox is checked, how to change the background color of the row. It seems slate have no API for changing the row's background. thx thx ๐
in UMG's UWidget, it has a method "GetParent". but in slate's SWidget, I can't find a method like that, I googled it, It seems I must set a private variable in my SWidget to save its parent's pointer, is that right? thx ๐
You could simply make your list view entry have a border and change its color or?
I think you can make that with binding function to check property, look how scene outliner does it when you select something in hierarchy, engine code is good to look at when dealing with wall of slate code and interaction
Got it, I will try. Thx ๐
Uhm
I don't have any console dev kit, so it would be hard for me to verify
but looking at the code, it looks like the rich text box will not work on consoles... is this correct?
it seems to be contingent on the UE_ENABLE_ICU flag
I'm looking around in the build files now, but it's a bit unclear :/
sometimes it makes me super sad that it's not easier to get a hold of the PS dev kit for example, would make this super easy to verify
the ICU binaries seem to be for a lot of platforms... maybe I'm worrying about nothing then
Am trying to figure out how to incorporate the SRichTextBlock and am having trouble figuring out how to use it. Is it just a kind of HTML parser? I haven't been able to find any resources explaining how exactly to use it. Just a bunch of AnswerHub posts pointing to it and saying "here, use this thing."
You're going to have to dig through its usage in STestSuite, methinks.
But, yes, in general it'll parse HTML-ish tags and you can then apply formatting to them.
Its not all too complex, but then I haven't fully used it.
Hello, I have new a SDockTab, but how to get it's ReActived Event? Just like this situation: when my plugin runs, I am working on this DockTab, and then I do some operation on other window(my plugin's DockTab will not in actived), and later I return to my plugin's DockTab. How to get the Event when I return (ReActive)? Thx ๐
I have try the "OnTabActivated" EVENT [FOnTabActivatedCallback] , But it seems dosen't work for this situaction.
Hey @silent patrol , riddle me this. We've got a strange bug on some Linux devices where only a top layer of our Slate UI responds to clicks. App::LocateWindowUnderMouse() returns an empty path no matter what's pointed, and when clicking on UI elements from the unresponsive sections, App::GetUserFocusedWidget() returns the viewport.
Thought you might have some hints & things to look for
someone turned off hittesting below some layer in the UI?
No, these layers do have hit tests
It works perfectly on Windows, and most Linux systems too
We just have this randomly
Our UI is a pile of SOverlays with different Z, and it looks like only the top 4-5 get input
no clue
never seen that happen before
only thing that makes sense is something id expect to see on all platforms
Well @silent patrol , I could get the issue to reproduce on Windows too, and it's much simpler than expected. I have a SOverlay on top of most the UI that uses a SCanvas. It looks like SCanvas has a weird handling of visibility - if it's set to Visible, it intercepts everything on the entire screen, no matter if widgets really exist on the canvas, and no one gets focus or clicks underneath.
That supposed to happen ? How can I selectively make parts of the canvas opaque and have the rest behave as HitTestInvisible ?
We used SCanvas to allow part of the UI to slide outside the screen, not sure if there was a simpler way.
If SCanvas doesn't handle hit tests gracefully, is there any other option to move UI elements outside the screen ?
Help me Nick, you're my only hope.
use the widget reflector
look at visibility settings on your layers
if the top most layer is not set to HitTestInvisible, it will eat clicks
(by layers I mean I assume all your UI is 1 Overlay with several layers under as children)
Yeah I end up understanding that SOverlay really are completely opaque to hits, or completely transparent
Somehow I had the notion that they were only opaque on widgets and boxes, layout objects etc weren't
@silent patrol So what I've done is toggle the visibility between visible and hittesttransparent based on mouse position
Feels hacky, works really well
selfhittestinvisible?
Why do that? why not just let their children be hit test visible or not?
Well, I tried having the SCanvas as hit test invisible and the children as visible, but I could never got it to work.
... There's such a thing ? ๐
SelfHitTestInvisible makes just the parent not hittestable
HitTestInvisible, makes all children and itself invisible to hit tests
Well, shit, I just lost lots of time on this.
Thanks for the heads up, I'll look into that
(it says the same if you hover over the visibility options)
I don't have "options" though, I'm writing C++ here
Just never knew there was a SelfHitTestInvisible option
you still have tooltips ๐
but it also says it in the code
UENUM(BlueprintType)
enum class ESlateVisibility : uint8
{
/** Default widget visibility - visible and can interact with the cursor */
Visible,
/** Not visible and takes up no space in the layout; can never be clicked on because it takes up no space. */
Collapsed,
/** Not visible, but occupies layout space. Not interactive for obvious reasons. */
Hidden,
/** Visible to the user, but only as art. The cursors hit tests will never see this widget. */
HitTestInvisible,
/** Same as HitTestInvisible, but doesn't apply to child widgets. */
SelfHitTestInvisible
};```
Like I said I didn't know there was more than the first four.
I thought HitTestInvisible acted like SelfHitTestInvisible does
Which is why I asked for help in the first place ๐
Hi, does anyone know if there's a way to make a sterescopic material work with a Slate widget?
Doubtful
https://docs.unrealengine.com/en-us/Platforms/VR/StereoPanoramicCapture/QuickStart/CreatingViewerMaterial works when applied on a regular object such as a simple quad, but when used in a slate widget (for example image) it doesn't work. I'm guessing the reason here is because the widget renders into an intermediate render target before being rendered in the scene. That being said I dont fully understand the part about the "Screenposition" shader node anyway. So maybe there's some other way to make this work?
Materials in UI are very limited compared to regular world objects
Anyone know if there is a base/shared class between all Widget styles? Or are they only defined in each subclass of UserWidget?
Is there some rule of Thumb or easy explanation how to translate UMG to Slate?
The Slate Syntax is a friggin' nightmare
its actually not if youve been using UMG in c++
if youve been using BPs, then yes it must be strange
Guys, im trying to add a custom row to a detail custamization like so:
.WholeRowContent()
[
SNew(SBox)
.HeightOverride(true)
.MinDesiredHeight(100)
.MaxDesiredHeight(100)
.Content()
[
SNew(SConstraintCanvas)
+ SConstraintCanvas::Slot()
.Anchors(FAnchors(0, 0, 1, 1))
[
SNew(SColorBlock)
.Color(FLinearColor(130, 130, 130))
]
+ SConstraintCanvas::Slot()
.Anchors(FAnchors(0, .5, 1, .5))
[
SNew(SColorBlock)
.Color(FLinearColor(223, 114, 229))
]
]
];
my objective here is to have a canvas where I can draw lines drawn on top of the properties of my struct
I'm trying to set a custom height for my canvas but this box thingy i created is not working
does anyone know a good way of achieving this?
oh nevermind, i got it!
HeightOverride actually takes a float with the desired height
StructBuilder.AddCustomRow(RadiusLabel)
.WholeRowContent()
[
SNew(SBox)
.HeightOverride(100)
.Content()
[
SNew(SConstraintCanvas)
Hi, Im trying to use SNew(SProperty, PropertyHandle) but I am getting this error "error C2065: 'SProperty': undeclared identifier". I have #include "PropertyEditing.h"
#include "PropertyEditorModule.h" in the header. Any ideas?
Did you include Slate as an Dependancy?
yep
other slate objects are working too. Just this one in particular
hmm looks like I got it with a nicely undocumented "#include "PropertyCustomizationHelpers.h" "
everything is nicely undocumented
yeah ive been having fun circling the same 3 documents over and over
I managed to get that SProperty to do something, but it just made the property and didn't populate it. So in the inspector I had SProperty -> SSpacer only
I should get VAX but im poor atm. Im coding to try make money. But between Intellisense being sloooow and not having that Live++ code thingy, it's tediously slow work
Ah
Im having fun going through Epic's detail customisations code though. Its nicely setup, I just have problems on the Slate side
It took me an entire day to get a Struct to show in the panel too and when it did, I didn't like the look of it :p
Im trying to use DetailBuilder.GetProperty() to get a property handle on a variable that is a UProperty. However I can't seem to get a Valid Handle back. Im using this line :
TSharedRef< IPropertyHandle > PropertyHandle = DetailBuilder.GetProperty(GET_MEMBER_NAME_CHECKED(FThemeDetailPanel, bIsThemeEnabled));
Any ideas?
It may fail if the property is protected or private, since GET_MEMBER_NAME_CHECKED can only access public properties unless you're doing this inside the FThemeDetailPanel class
The class itself needs to be a UCLASS too, I believe
Could be wrong on that part though
usually though GET_MEMBER_NAME_CHECKED won't compile anyway if the property isn't accesible
I tried without the macro, even though the macro is telling me the property exists. And its not protected. It turns out I was just doing it all wrong. Im starting from scratch today with a new plan so wish me luck ๐
how can I change the fontsize of a text without having access to a font? Doing a thing from a plugin.
you could load the font object from the plugin
er nvm there's a font size setter
look at FTextBlockStyle
Has anyone utilised the FWidgetBlueprintEditor class to get infomation on relevant events, such as when a widget is being replaced, so you can capture the changes that occur between widgets?
ie. between Widget and Preview Widget
Anybody have easy example how use PropertyCustomizationHelpers::MakeActorPickerWithMenu not enough for me from engine only....? while using MakeAssetPickerWithMenu
Is there a reason why IInputProcessor does not support double click handling? ProcessMouseButtonDoubleClickEvent() in SlateApplication is not giving it chance to pre process input. Is it just missing feature? (question probably on @silent patrol , I am sorry for disturbing) Would you accept PR on this Nick?
Wanna ask. Is there any latest/updated guide or tutorial that i can refer to regarding Slate?
During ancient times
Not much documentation on Slate
Yeah, I'm still trying to figure out how to incorporate the SRichText thing, personally
Well, what's the trouble with that ?
It's like a regular STextBlock with optional formatting
Hi I'm trying to find out how to bubble all slate users OnKeyDown up to my UserWidget's OnNativeKeyDown, currently I call FSlateApplication::Get().SetAllUserFocus(GetCachedWidget(), EFocusCause::SetDirectly); from my UserWidget derived class but I noticed that this call doesn't find the path to my widget hence my slate users don't bubble the KeyDown event. Does anyone know why or how to make it work so that void FSlateApplication::SetAllUserFocus does find the path to widget? I feel like I'm missing something
//ensureMsgf(bFound, TEXT("Attempting to focus a widget that isn't in the tree and visible: %s. If your intent is to clear focus use ClearAllUserFocus()"), WidgetToFocus->ToString()); how do I make my widget be in the tree?
Update: just found out that if I wait a little bit (like 1 second) and I SettAllUserFocus I can find the path and everything works, now I wonder why this is happening
Can someone help me create a SWidget for the NotificationManager with just a background image and text?
Hi, I want to make custom widget base, trying to use NativePaint to draw my base widget, but if I add any children to the widget on top, they are drawn under my background that is drawn in NativePaint
how to make sure all I draw in NativePaint will be UNDER any added widgets ?
@sweet wasp look to engine source code, there is complete test examples for every aspect of slate functionality Window > Developer Tools > Debug Tools then click Test Suite button, you can use Widget Reflector or look into source directly. Provided examples illustrate most of Slate functionality, rest is skinning
ok I got around my question by using UImage widget
I guess I cannot mix native paint and widgets
guys, since slate mostly works with Operator overloading, is there a variant that could be used in the traditional Imperative Programming sense?
like Qt forms or Java's Swing. where you create the objects/forms manually and compose them with methods
that is more readable than the slate cancer tbh
@sudden fossil You generally can, yes. For example, instead of +SHorizontalBox::Slot() [ loads of stuff ], you can do MyWidget = ...; MyBox->AddSlot() [ MyWidget ];
that looks more readable. Thanks :)
Sometimes it gets really verbose though, because the declarative stuff does a lot of boilerplate. For assigning delegates mostly.
I wouldn't even mind the overloading stuff
If it wouldn't auto format so crappy in VS
However I never spend time resolving that
ya know i've always heard people say shitty things about slate
but slate actually isnt that bad
its actually extremely powerful
Slate is great. People just have a hard time with it.
Is there a reason why IInputProcessor does not support double click handling? ProcessMouseButtonDoubleClickEvent() in SlateApplication is not giving it chance to pre process input. Is it just missing feature? (question probably on @silent patrol , I am sorry for disturbing) Would you accept PR on this Nick? (copied, as your are online now)
Nick, if you happen to still be around - any idea what happened with the long forum thread regarding the new clipping system? I posted a question in there relating to an issue I'm having, and a day later the thread completely disappeared.
Seems like a rather important thread to have been full-on deleted out of existence.
@silent patrol awesome, thanks
@silent patrol The issue was that my charts plugin stopped clipping points properly inside a scroll box. I was using a custom draw element and directly setting the scissor rect. Since the update, it seems no matter how I set the scissor rect, points will still be drawn outside the bounds of the chart when it's in a scroll box.
Playing around with the new clipping options for the chart and parent didn't help either.
As for the thread - I think there was a spam post shortly after mine, but removing an entire thread with so much useful info as a result didn't seem necessary.
@limpid atlas What's the thread title
Already brought this to ambershee's attention a while back, he said it was fully deleted, even as a mod he couldn't see it.
Well, seems really like it's gone.
Could be that it got merged into a different thread
We usually aren't allowed to hard-delete threads, at least as mods.
So either a mod screwed up, it got renamed/merged or Epic hard-deleted it
However rename/merge would mean you can still find your post
It's gone from my posting history.
This was an official thread with huge amounts of info from Nick on the update, so really bizarre that it got nuked.
Welp, I'll ask Amanda, maybe she knows what's up :P
Cheers
it may have been removed after it was converted to documentation?
i dunno - bizzaro
Official Unreal Engine news and release information from Epic Games.
Yeah, bit of a weird one.
Any thoughts on why scissor rect might be doing nothing with custom elements?
Maybe I can just dump custom elements, but creating an element for every data point on a chart seemed like a bad idea. Not sure it's possible to set UVs for a regular tile element either.
probably a bug? what are you doing for custom?
if you're resetting the clipping state in your custom renderer it aint gana work
does non-scissor work fine?
@limpid atlas
@low bluff Yup?
Or you were just letting me know Nick responded?
Yus
When I know someone's in a different timezone, I tend to just wait until it's a resonable time before replying, otherwise stuff just gets lost.
@silent patrol Basically this:
{
RHICmdList.SetScissorRect(something);
RenderTarget->SetRenderTargetTexture(*(FTexture2DRHIRef*)InWindowBackBuffer);
[Construct FCanvas from RenderTarget]
[Render some tiles to canvas]
Canvas.Flush_RenderThread(RHICmdList, true);
RenderTarget->ClearRenderTargetTexture();
RHICmdList.SetScissorRect(false, 0, 0, 0, 0);
}```
Where RenderTarget is the FSimpleRenderTarget class I grabbed from somewhere in engine code. Honestly I don't know a thing about rendering side of the codebase, but I just based this off something in the engine ages ago, and like I say the clipping stopped behaving after the recent updates.
oh
@limpid atlas in 4.17+ the clipping is still handled for you, even in custom, we set everything up just before it draws the custom code, so you can remove the SetScissorRect
Actually, why are you creating a new render target to do this work?
im not sure why you're not doing raw slate draw calls
You could even use the the custom vertex drawcall if you need to do tons of quads
Yeah, probably a terrible idea, I took this from some engine code 3 years back and haven't touched it since.
ah
From what I remember, I guessed (maybe wrongly) that adding a slate element for every single data point would be slow.
yes
full blown widgets sure
but not as bad if you're doing MakeBox calls
so like a single slate widget that does lots of paint calls
and those calls can be optimized more with the CustomVertex call i mentioned
Also, I use a texture with a bunch of data point images packed into it, so I need to be able to specify UVs for each one other than just 0,0 to 1,1. Have a feeling that wasn't possible with the regular Box/Tile element.
Yeah that's possible in slate
that's how the editor does all icons
puts pngs into an atlas
Can you link me something to what this custom vertex draw call is? Exact type name or github link maybe.
Okay great, will take a look.
Ah okay, I see there's UVRegion on FSlateBrush, either I missed that originally or it's been added since. To be honest this doesn't need to be especially optimized, so using regular box elements may be fine.
Thanks for the help.
Hey guys, we have been discussing internally two mysteries and community is not probably sure too as there are different answers around the internet:
- Is there any performance benefit from using texture atlas? If so, what is proper way to implement this (e.g. Paper2D sprites or maybe it is good idea to implement game texture atlas the same way as editor texture atlas works).
- Is there any benefit when using mipmaps for UI textures? Everybody says that those should be disabled, however default mip map settings for ui group is not No Mips. Will mobile device pick mip which is clostest to it's resolution. E.g. smaller mip for smaller resolution.
(btw. I submitted the PR on IInputProcessor https://github.com/EpicGames/UnrealEngine/pull/4788 )
@silent patrol the Epic Games Launcher is WPF?
would anyone know where bShowMouseCursorfinally updates the cursor state
it's never immediate and i would like it to be instant
@toxic dove So, this particular thing is crazy hard
It's been forever
Do you really just want to hide the cursor, or have all the changes that come with it in terms of focus & input handling ?
hide
The there's a very easy soluttion
Give me a sec
FSlateApplication::Get().GetPlatformApplication().Get()->Cursor->Show(false);
This will just hide the cursor - no other change, keep bShowMouseCursor to true. Behaviour will still be as if it was visible, so mouse inputs will be like they were.
Here's what we have in Tick() ourselves to safely toggle bShowMouseCursor, instantly, and not have to click for it to work
And I'm fairly sure there is more of it
@silent patrol probably has some more... input on this topic.
that is hacky, and it's setting input mode on tick
er well not on tick you have a flag to guard against
but it's doing that thing to simulate a mouse movement
so it will probably bubble up and tell slate to wake up and update cursor state
That's the point, yeah
why not just directly tell slate to wake up and update state without a hacky mouse movement
Well, if you find a C++ snippet that correctly updates the mouse behavior after changing bShowMouseCursor, works on all platforms and doesn't look like that, be my guest
This awful thing is the result of basically 3 years of trying different stuff, maybe there's a cleaner way now.
i did this exact thing
i was wondering if there was a more direct call but
FSlateApplication::Get().GetPlatformApplication().Get()->Cursor->Show(false);
why doesnt this work for you?
Because we don't just want to show or hide the cursor, we want to keep the 50 other settings that come with bShowMouseCursor - focus, input style, some stuff related to accuracy of dragging movement in the UI
bShowMouseCursor is basically a master switch for "game mode" and "full-screen menu mode"
why would calling that mess with the input mode?
Because like I said, bShowMouseCursor is a far cry from a simple boolean setting
It's a master switch for UI
๐คท i stay far away from UE's input handling besides mouse for UI
theres no reason for me to switch input modes
i am just trying to find a solution to make sure the mouse cursor does not appear when a gamepad key is detected
it's inconsistent
Then just use the line I referred you to
and also relies on viewport focus at times
its weird that FSlateApplication::Get().GetPlatformApplication().Get()->Cursor->Show(false); has platform implementations for PS4 too
i didnt see a cursor in PS4 one time when i debug on the ps4 devkit
i wonder what it is
Dunno
Cursor input and focus handlign is one of biggest mysteries in unreal, personally I was very confused by bShowMouseCursor and all changes which are caused by it. I think it should be renamed as it simply is not just show and hide. Some full input and focus doc would be best :(
forget about input handling in UE, even Epic's own games use hacky methods
i had to roll my own method for UI for seamless gamepad / mouse-keyboard changes
We have mouse-keyboard, joystick & gamepad simultaneously here
So you can drop one and pick the other up and it works
yeah you can seamlessly go between both for us as well
btw it worked fine
this was also a good way to make sure the cursor is not visible during the splashscreen video
how do i convert worldspace to screenspace
to put a point over an object
wait
nvm
I want to call ShowSuccessNotification in the editor from a thread
but I'm getting an assert fail that I can't call it from a different thread
how can I notifiy my main thread that something is done
lots of ways
simplest is probably AsyncTask(ENamedThreads::GameThread, [](){ .... }); at the end of your task
it's kinda weird how there are like 5 different ways to do async stuff in the engine, none documented, all used in several places
is AsyncTask the preferred way
๐คท it's the one I used
wait that doesn't work
it still locks up the whole UI
which makes sense, it's running on the game thread
How else can I talk to Slate?
a more complicated way?
what do you mean by "talk to slate"?
I have a notification
and I want to call ExpireAndFadout
from a thread
it seems that I need to be on the main thread to call it
oh maybe I can make that an async task
hmm
the AsyncTask thing basically enqueues a command for that specific thread / thread group
so you can use it to send things from your custom thread to the main one to run there
you can also use it to move a job off the main thread, but don't put game thread then of course
what are threads that I can use for other jobs?
CREATE_BACKGROUND_TASK_THREADS
assuming this creates a thread?
some of these https://i.imgur.com/qX8H7HV.png
AnyThread seems like a bad idea
you wouldn't want your thing to end up on the game or render thread
O
but neither one of those names has AnyThread on the right hand side
so I'm assuming it's not talking about the game or render thread
https://i.imgur.com/JPpDlFe.png looks like you're right
still with these ones you get to specify a priority ๐คท
Right, so I could do AnyHiPriThreadHiPriTask and it'll go in the background?
so cool
Thanks for the help!
is there a umg or slate file selection widget? I know about IDesktopPlatform::OpenFileDialog, but I want this for VR where that won't work
Hey everyone, Iโm very new to the Unreal Engine and I have a question about compound widgets.
Iโm trying to visualize the content of an array with a SListView widget, which seems to work fine. The problem that I currently have is that the widget doesnโt update when an instance is added or removed from the array. I realized that this happens because the widget isnโt updated. I tried to find out how the property editor refreshes itself, which appears to be happening via the IPropertyUtilities. A reference to this object is passed to the SColumnHeader in a private Construct function, but I canโt find where that IPropertyUtilities reference comes from.
I would really appreciate it if someone can help me out!
If you have an SListView
Can't you just save a pointer to it
And call Update on it?
Or are you that far already (:
@old scarab
That was easier than expected, thank you very much!
Hey there, I'm currently working with the SBackgroundBlur and try to render the blur with a irrectangular shape
It might be possible with Slate's new clipping system, does anybody maybe have a clue?
masked blur has been asked every 3 weeks
the answer is it is non-trivial and would require a custom solution
i dont think this answer has changed
actually clipping blur works just fine
whether that is a good solution for drawing a custom shape depends on the shape and how complex it is, I guess
everything is a quad though
nifty, but yes sounds real haxxy
it is :D
I'm watching the plugin tutorial series and he's just getting into the slate stuff... could you hypothetically use slate as just a UI library to create standalone programs or not really?
LOL -- literally 5 seconds after I resumed the video
boom, custom game launcher epiphany
omg widget reflector โฃ
I'm sorry. . .but that is trivial use case
Is there a way to get Slate widgets to react to Transactions? ie. I have a custom detail panel with a checkbox. The transaction is scoped within the delegate for OnSelectionChanged. Obviously this is a step after clicking so the physical click isn't represented in the scoped transaction. Im not sure how to get the state to be recorded in the transaction. Anyone ever come across this issue before or have an idea where to start?
could anyone verify a possible HUD glitch in UE4.19.2 for me?
im not certain, bit it seems odd that the function Set Hide HUD takes a matinee Actor object as an input instead of a HUD class?
oh wait nvm, i see: thats a method for turning off HUD during matinee
is there a way to toggle HUD class draws?
i just made a custom flip flop in the meantime ๐คท
@frozen perch What custom game launcher?
The Epic Games Launcher is in fact made with Slate.
No doubt a bunch of it is also web tech stuff too, just to leverage whatever web APIs and UIs already exist.
Does HUD have a canvas by default? or do I need to create one? I tried to use the DebugCanvas and it seems to be null
should I just create one in the HUD on beginplay and set it? Or should i be doing something in viewports?
if anyone has experience with debug drawing to canvas I could use some tips on how to set it up
Okay seems like i should be adding debug stuff in post render, probably
in unmodified shootergame, 4.19, if you alt tab into the window instead of click into the window, the menu won't get mouse or keyboard focus if it is up (even on the main menu screen, but also when ingame menu is up)
anyone know a fix for that?
also happens when clicking in via task bar
@trim kestrel does fortnite do anything to work around that issue? mainscreen UI doesn't seem keyboard navagable, but it did have an prompt with 'esc' that worked after only alt-tabbing in and not clicking in
for me shootergame UI won't get keyboard or mouse focus unless clicking in and not alt-tabbing
We have a lot of custom stuff going on as far as UI input in FN.
Hard to say what exactly.
ah ok..
Also about to workout so I can't expound on it right now.
well shootergame has some kind of hack thing for returning focus after closing the console
maybe I can use that same code when detecting an alt-tab in
thanks
I'll keep poking at it
@mild oracle The ability to write one with slate
@frozen perch Got any tutorials or links to stuff that explains how to do that? I'd love to learn more.
No sir, I just read that slate can be used to create standalone desktop applications.
oh, hehe
hullo
-.-
@toxic trench asking the important questions
@silent patrol I did kill it, and everything still works
k
is there a reason why it runs for VR games?
it processes mouse movement
0.055 ms is a lot of time for something thats not needed at all
some people use the mouse in their game
it's incredibly difficult to make the call 'nobody will ever need this ever'
its pretty hard to find a VR game where you ever use your mouse I think
research projects have done stuff with it
it should be some checkbox in the project settings then so that people can adjust it
nobody will know to find that checkbox
well, you can put it in the VR category
so when someone finds instanced stereo, he will also find that
Would rather just make the function faster
well, if that's possible, that would be good of course
