#slate
1 messages ยท Page 14 of 1
also it's easy to steer ChatGPT into the wrong direction unintended (when not knowing what the result should be like)
i think that's where things went down the drain
i don't need a UUserWidget, that was total BS
textblock etc. are also UWidget
i should have looked at engine classes earlier tbh
also shows up as UWidget
I'm working on some editor tooling and I'd like to display a TArray in an editable way, like the details view. From what I can tell, there's no easy way to do that and I need to write my own.
Is it a uproperty?
yes
FPropertyEditorModule's create single property view?
that gives me a visible array with + and trash icons, but I can't click on them.
in theory single property should work on array?
Is there anything else on the object containing the array?
yes
You could create an entire details view to edit it.
Or use a filter.
Or use the CustomDetailsView plugin.
doesn't that only work in a regular details view panel?
or am I thinking of something else
it's a single node for giving items to a character that mission designers use. I'm about to admit defeat and have them edit it in the details view, rather than on the node itself.
CDV is a plugin we developed because working with the details panel was shitty.
(it's in the engine, just enable it)
hmm. who is we?
The company I work for.
I think most of the reasons we made it have gone now, though, lol.
Time to learn. ๐
Unfortunately I think now is not the time for this task.
It's never been easier to get into slate, the only thing confusing about slate is the syntax and with copilot the syntax becomes trivial.
Are you hoping to do something like this? Creating a popup that shows an intractable but "normal" floating details panel for a uobject? https://cdn.discordapp.com/attachments/924846382911721482/1327826797534117929/bandicam_2025-01-11_19-28-41-443.mp4?ex=685eaad2&is=685d5952&hm=600d6d480137ee1c4828c7565135234a73af0251838b8d13c846bfe2781840f4&
(This video is from me having a problem with it, lol)
im using the same label name and settings, but on the level editor toolbar no label is shown
only diff between these is the section
UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu("AssetEditor.BlueprintEditor.ToolBar.GraphName");
FToolMenuSection& ToolbarSection = ToolbarMenu->AddSection("PrefabSystemSection.BlueprintEditor.Top", INVTEXT("Prefab System"));
UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolBar.User");
FToolMenuSection& ToolbarSection = ToolbarMenu->AddSection("PrefabSystemSection.MainLevel.Top", INVTEXT("Prefab System"));
it seems to be "by design" https://issues.unrealengine.com/issue/UE-170850
Look at how the other buttons do it?
I think it works if you add it with a ui command maybe?
i tracked how the platforms button is done and i tried to mimic it (while at the end it was "doing the same"), nothing to make it show the label
ill try
We've definitely had success in adding buttons with text.
uh, there is no ui command to pass when adding a entry ?
thats my code, none of the funcs asks for a command list
// main level top bar
{
UToolMenu* ToolbarMenu = UToolMenus::Get()->ExtendMenu("LevelEditor.LevelEditorToolbar.User");
FToolMenuSection& ToolbarSection = ToolbarMenu->AddSection("PrefabSystemSection.MainLevel.Top");
// preview settings options
ToolbarSection.AddEntry(FToolMenuEntry::InitComboButton(
PrefabPreviewSettings_EntryName,
FToolUIActionChoice(),
FOnGetContent::CreateLambda([this]()
{
return PreviewSettings_LevelEditor_GenerateWidget();
}),
PrefabPreviewSettings_Label,
PrefabPreviewSettings_ToolTip,
FSlateIconFinder::FindIcon(PrefabPreviewSettings_IconName),
false
));
}
Oh you want a combo button?
yeah, its a combo button
same code for the BP section button, only the toolmenu and section is different
When I said a ui command, I meant an FUICommand, not a command list. ๐
But yeah, I I'm not sure you can do that with a ui command.
seems like the leveleditor toolbar has some special rules
Check FPixelStreaming2Toolbar::RegisterMenus()
Shrug
anyone knows of any "barebones" example of a SViewport being used for a custom 3D asset editor? afaik all the uses in the UE editor are pretty complex to analyse
like the one in bp editor or anim editor? anim editor is relatively small
The one in the material designer plugin is pretty simple (DynamicMaterial plugin) It's got a fairly minimal extension of SEditorViewport.
SDMMaterialPreview
alright, thank you
Also, am I correct in thinking that if I wrap SViewport (not SEditorViewport) in a UMG widget I can spawn a 2nd world and render it in game in the UI, including in a shipping build not just in editor?
thank you
oh yeah messy is an understatement. 1 shared .cpp for all classes lol
also using some existing level in a preview scene seems very annoying to do
creating a FAdvancedPreviewScene and FEditorViewportClient and using UGameplayStatics::OpenLevelBySoftObjectPtr on the FEditorViewportClient world doesn't seem to work, it'll just use the scene generated by FAdvancedPreviewSceneAnyway
ok so I'm pretty sure that :
SEditorViewport requires a FEditorViewportClient
FEditorViewportClient requires a FPreviewScene
FPreviewScene on its own already creates and set up a world in specific ways, no apparent way to override that behaviour
so if I want to just show a level as is without interference, I might have to remake all 3 of these classes from scratch, or at least copy them and hack them into doing what I want
swell
Hi, i'm fighting with WrapBox widgets to allow for insertion of new widgets in them (since by default only adding at the end works)
I subclassed UWrapBox and made a function identical to UPanelWidget::AddChild, but using insert instead of adding to Slots array.
The result is that new widgets are still shown at the end of the wrap box even tho they are not at the end of the Slots array.
If i remove the widget from viewport and add it back, the order is now the expected one.
This means that there must be a way to refresh the WrapBox widget, but i do not know how
https://github.com/VoxelPlugin/VoxelCore#custom-toolkit seems to be what voxel plugin is doing so I'm prob gonna do something similar
how should i profile to known what takes so much time here ?
im in the editor
most of that is probably slate drawing the editor
i get random frame drop, 120 to 60
then you should look at a frame which drops
because that one is closer to 120 with 6ms
Is there a way to get the modified UV coords in material editor
i.e. I assume the DrawAs Box for SImage might have a corresponding variabl that could be accessed in the material editor?
did you try one of the other UV Channels?
would check 1/2/3/4
I had a lapse in brain function. Im using a RetainerBox which doesnt know about its child SImage and its DrawAs type so it's material most likely has no access to it by default
found a useful reference (GetUserInterfaceUV node)
note: 9 slice UV isnt actually 9 sliced for a retainer box ( which has no DrawAs option )
annoyingly, OutputPixelSize is physical pixels instead of device pixels ( doesnt account for window scale so basically useless imo... )
i thought texel density was in one, but maybe they changed it to be a separate node alltogether ๐คท
oh maybe this will help me convert to device pixels then? (will try it in a bit) im a bit unfamiliar with gpu terms tbh. ( comepletely disregarded this on the first pass looking for stuff )
Im also on an old engine version ( 4.26 )
EDIT: scene texel size doesn't seem useful for this use case. Not my favorite solution, but just going to pass in needed information as a parameter for now
EDIT2: solution for me was to modify SRetainerWidget to support DrawAsBox
I still didn't find a fix for this
Same for adding BPSummoner tabs
@grave hatch fwiw you have to apply the following to your menu entry to make it displayed StyleNameOverride = "CalloutToolbar"
Ah.
How am I supposed to update this SComboBox after I make a selection lol, surely I don't need to use SharedPtrs to the entries. In my case it's an array of FNames
.OnSelectionChanged_Lambda(
[this](TOptional<FName> Selected, ESelectInfo::Type SelectInfo)
{
SelectedStyle = Selected.Get("Empty");
ComboBox->SetSelectedItem(SelectedStyle);
ComboBox->RefreshOptions();
})
i think it has a GetContent/CurrentValue thing
thats how it works on enum combo box
i store the value somewhere else, set/get it from the get/set Slate lambdas
@grave hatch finally got it working today to , will post a link on some sample code
Yeah It does, I found my issue anyway. I can't use an option that doesn't exist in the source options. Basically I had an array of FNames and I was starting the combo box with "Empty" (just for the UI to be "nice") and it turns out bc Empty wasnt in my options it was being weird. It is all sorted now though
For anyone wondering how to add a FWorkflowTabFactory (known as Summoner) to the Blueprint Editor
https://notes.hzfishy.fr/Unreal-Engine/Editor-Only/Summoners-(Tabs)#blueprint-editor-setup
Hello! Does anybody know why focusing on a Slate widget breaks the navigation system? I have a widget structure
Border // Overwrites navigation directions Up, Down, Left, Right
L Vertical Box
L Focusable UMG widget
L Focusable UMG widget
L UMG Widget with focusable element
L UMG Widget with focusable element
L CPP Widget with focusable Slate widget
L CPP Widget with focusable Slate widget
So navigation using gamepad works fine until I get to widgets with slate SButton. Then navigation system simply stops calling functions that are responsible for getting widget to focus on.
how should i manage dynamicly editing the inside of a slate widget ?
creating new widgets on tick, calling ClearChildren and so on doesnt seem quite right
Depends what you want to do. If you want constant updates then tick or OnPaint.
If you want event driven updates then you might want to make a delegate that calls everything necessary when a change happens
? I mean you override OnPaint and make your own implementation
But yeah if you need constant updates then you need a function being called all the time. Tick works for that
If you're only moving widgets and don't need to recreate them, then you want OnPaint. OnPaint is where all widget drawing is done. It manages size changes and slot movement and all that stuff
I would assume your UWidget is potentially not calling something it should?
Might want to check what the native UButton calls and check the callstack
What do you mean exactly? I use Unreal internal system. I thought the only thing I should is to assign this function to navigation map. And UMG widgets work fine. My widget also gets focused sucessfully. It's just right after that the system breaks. I'm checking UButton, but do not really see any extra focusing logic
If you can't navigate away from the button then something calling that part of the navigation code is missing. That's why I suggested to check what is called in a working state and to check what part of that is not calling for yours.
I did a little debugging. Unreal does not send direction inputs after focusing the widget. This is the part I do not really understand.
The only option you have is to follow the functions upwards in the callstack and to check where it fails for your widget. :/
Input in slate doesn't go very deep. Starts somewhere in the FEngineLoop and quickly reaches the Widgets
The only difference from UButton I have is that I have my own SFocusButton between UFocusButton(my widget) and SButton
But it does not really matter which widget gets focus, my or SButton. Navigation system simply stops working
Yeah, I already did it. As I said, Unreal does not send inputs from FEngineLoop
The FSlateApplication::ProcessReply gets called every frame. It has a parameter FReply. Whenever I press a button, it calls FSlateApplication::AttemptNavigation. Howver, after focusing my widget it stops sending any directions, any futher navigation does not work
Does your button maybe handle input or so?
Hm, that's strange. You aren't using a InputPreProcessor by any chance?
I do not. I do override FNavigationConfig however, but I doubt it has anything to do with my issue. The only thing I do there is disabling analog navigation, so it uses DPad instead.
It shouldn't, but possible, I guess. SButton is not focusable inside my widget
I removed SButton from my widget and now the only container there is an SBox. And I still have this issue.
Hi, When I create Slate widgets, I often run into the problem that I lose track of where a given widget or slot is in the hierarchy.
So I have a question โ do you think it's a good idea to mark every widget/slot with its place in the hierarchy using comments like this:
// A text block that displays the category name [1.1.1]
SNew(STextBlock)
.Text(FText::FromString("Category A"))
.Font(FCoreStyle::GetDefaultFontStyle("Bold", 16))```
how can I draw a simple line ?
i tried to replicate what i would do with UMG: an Image stretching horizontaly and only a few pixels high, but with SImage im not getting the default white image but a default checkboard texture
nvm, SColorBlock is a thing
for some reasons it feels like adding my subwidget in a scrollbar fucks up the layout ? they are all stacked
SAssignNew(PRCDataContainer, SVerticalBox);
PRCDataContainer->AddSlot()
.AutoHeight()
[
SNew(STextBlock).Text(FText::FromString(FString::Printf(
TEXT("%i Prefab Reference Component%s found"),
CachedLoopData->CachedEntries.Num(),
CachedLoopData->CachedEntries.Num() > 1 ? TEXT("s") : TEXT("")
)))
];
for (int32 i = 0; i < CachedLoopData->CachedEntries.Num(); i++)
{
auto& Entry = CachedLoopData->CachedEntries[i];
PRCDataContainer->AddSlot()
[
SNew(SVerticalBox)
// PRC Info
+SVerticalBox::Slot()
.AutoHeight()
[
SNew(STextBlock).Text(FText::FromName(Entry->PRCName))
]
];
}
ScrollBox->AddSlot().AttachWidget(PRCDataContainer.ToSharedRef());
even with one slot in PRCDataContainer, it sounds like the bounding boxes are not here ? (see green area, its a line)
I think I solved it. I had to override OnKeyDown function, which was blocking inputs. The navigation part made it work.
FReply SFocusButton::OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent)
{
bool Pressed = false;
if (FSlateApplication::Get().GetNavigationActionFromKey(InKeyEvent) == EUINavigationAction::Accept)
{
OnKeyPressed.Execute(MyGeometry, InKeyEvent);
Pressed = true;
}
FReply Reply = Pressed ? FReply::Handled() : FReply::Unhandled();
EUINavigation Navigation = FSlateApplicationBase::Get().GetNavigationDirectionFromKey(InKeyEvent);
if(Navigation != EUINavigation::Invalid)
{
const ENavigationGenesis Genesis = InKeyEvent.GetKey().IsGamepadKey() ? ENavigationGenesis::Controller : ENavigationGenesis::Keyboard;
Reply.SetNavigation(Navigation, Genesis);
}
return Reply;
}
for some reason the issues happens because im calling ClearChildren on the scrollbar on tick BEFORE adding the slots
Ah nice. That's what I had suspected
so i found out that the issue came that slate needs more than 1 tick to update its layout, so i added a interval amount and it indeed helped.
my issue is that at every update you can see the widget being refilled, is there a way to hide that ?
welcome to slate, i fucking hate it. the editor is full of this jank once you start to see it
i guess the only positive thing about slate is how you build it in code
with the new Slate IM, can it be per world context ?
well, imslate author came back simply saying "same way you would with any other system, store a context object or ref to the world itself" ๐
IM?
I'm trying to get the absolute ScreenPosition ( in pixels ) of a widget relative to the viewport ( and use it for a dynamic material )
This seems to be fairly innacurate from what I can tell, and perhaps Im doing something wrong:
Get widget rect in screen space in units of physical pixels ( seems to be off by roughly 4 pixels but it grows slightly the larger the viewport is)
const auto TopLeftPx = InWidget->GetCachedGeometry().GetAbsolutePositionAtCoordinates(FVector2D(0,0)); // <--- get this widget's position in screen space
const auto BottomRightPx = InWidget->GetCachedGeometry().GetAbsolutePositionAtCoordinates(FVector2D(1,1));
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
if ( World && World->IsGameWorld() )
{
if ( UGameViewportClient* ViewportClient = World->GetGameViewport() )
{
TSharedPtr<IGameLayerManager> GameLayerManager = ViewportClient->GetGameLayerManager();
if (GameLayerManager.IsValid())
{
const auto& GameViewport = *ViewportClient->GetGameViewport();
const auto ViewportOffsetPx = GameViewport.ViewportToVirtualDesktopPixel(FVector2D( 0.f, 0.f )); // <--- get viewport widget's position in screen space
return {
.TopLeft = TopLeftPx - ViewportOffsetPx,
.BottomRight = BottomRightPx - ViewportOffsetPx
};
}
}
}
Get widget rect in ViewportUV space ( this is much more accurate and I dont know why ). But I need the pixel units version so I cant use it.
const auto TopLeftPx = InWidget->GetCachedGeometry().GetAbsolutePositionAtCoordinates(FVector2D(0,0)); // <--- get this widget's position in screen space
const auto BottomRightPx = InWidget->GetCachedGeometry().GetAbsolutePositionAtCoordinates(FVector2D(1,1));
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
if ( World && World->IsGameWorld() )
{
if ( UGameViewportClient* ViewportClient = World->GetGameViewport() )
{
TSharedPtr<IGameLayerManager> GameLayerManager = ViewportClient->GetGameLayerManager();
if (GameLayerManager.IsValid())
{
return {
.TopLeft = ViewportClient->Viewport->VirtualDesktopPixelToViewport(FIntPoint(TopLeftPx.X, TopLeftPx.Y)), // <--- convert to ViewportUV space.
.BottomRight = ViewportClient->Viewport->VirtualDesktopPixelToViewport(FIntPoint(BottomRightPx.X, BottomRightPx.Y)),
};
}
}
}
return {};
The absolute position is relative to the inner window border, not the desktop or anything.
So if it's off by 4 pixels, that might be due to the window having a border.
Also afaik this doesn't use UV coordinates: InWidget->GetCachedGeometry().GetAbsolutePositionAtCoordinates(FVector2D(1,1));
but I might have missed it
Why not just get the cached geometry (now called TickspaceGeometry) of the viewport instead of hte virtual desktop pixel stuff?
Ill double check, but Ive been testing those lines of code, and it should be correct
Do you need it in desktop pixels?
If your widget is 1 pixel by 1 pixel, it will be correct.
(in local space)
here is the comments:
/**
* Get the absolute position on the surface of the geometry using normalized coordinates.
* (0,0) - upper left
* (1,1) - bottom right
*
* Example: Say you wanted to know the center of the widget in absolute space, GetAbsolutePositionAtCoordinates(FVector2D(0.5f, 0.5f));
*/
FORCEINLINE FVector2D GetAbsolutePositionAtCoordinates(const FVector2D& NormalCoordinates) const
the border thing is definitely the issue tho
I was testing the x coordinate only. I decided to test the y coordinate because the border padding is much thicker on top for the title bar
and it was super offset
pain
Yeah I got it working but it sometimes gets stuck on screen and I can't work out why ๐ฆ
And the in viewport one stops other widgets working
Immediate mode
Ah.
where can I find list of all available Editor/Game Styles ?
I install a plugin called Slate Icon Browser.
It's on git if you google it.
It lists them all and the icons they provide.
https://www.fab.com/listings/04eb0964-3152-412f-85be-fdbfbda56425 also on Fab apparently
Slate Style Browser is a tool for developers working with Unreal Engine's Slate UI system. It improves your UI development workflow by providing a streamlined way to explore and manage Slate styles and brushes.Why You'll Love ItEffortless Style Exploration: Easily browse and preview a wide variety of Slate styles and brushes used in Unreal Engin...
That looks nice!
(not the plugin I mentioned, though)
https://github.com/sirjofri/SlateStyleBrowser here's the style browser git.
Seems he renamed it and expanded it. Nice.
yea, the fab page links to the same github
Lmk if you've got any feedback (or make a PR)
yeah will do
actually i have one issue @drowsy galleon
ViewportRoot eats the mouse from UI (not the world)
couldnt work out how to solve that
even if i set a low Z index
Like, any UI rendering in front of the slateIM root doesn't receive mouse events?
thing is, its always rendering over other widgets
let me show you,can i DM?
its got some confidential stuff
Sure
sent, probably in pending list
@drowsy galleon i think i solved it
sorry
is there a way for viewport widgets to be like movable in the viewport?
or are they kinda stuck in place?
Modifying the anchors at runtime should work but I haven't tested it
i have void WarningText(const FStringView& Text) { static FTextBlockStyle ThisStyle = FCoreStyle::Get().GetWidgetStyle<FTextBlockStyle>("TextBlock.ShadowedTextWarning"); SlateIM::Text(Text, FSlateColor(FLinearColor(255, 68, 51)), &ThisStyle); }
this helper
but the text is not Orange
infact its the same color
KaosSlateIM::WarningText(TEXT("No Ability System Component found."));
its like the color doesnt get applied at all
@drowsy galleon sorry for the ping ๐
even tried with no text style
so weird, works if i do FLinearColor::Red (?)
๐ค
Does the colored text in the example window work?
so it works if i use FSlateColor(FColor())
but not FLinearColor, unless its a caching issue
I'm suffering a little bit trying to use SListView, maybe someone figured these two out:
- How can I get the cell contents to clip correctly and not draw on top of the header row when I scroll?
- How can I remove the dark gray background from the header row? I know how to draw a custom widget but that border is always there -
I'm already doing this, so, really quite annoying. I might need to copy the SListView sources and make my own modified variant, was hoping to avoid that.
Well, apparently some things can be done with FHeaderRowStyle (which isn't BP exposed, but I guess that'll have to do)
Messing around with the various slate styling options sure can be a time sink.
i have spent like 2 hours trying to make an icon appear on a button so far
fucking nonsense
non-shitpost though have you figured out how to hack live coding into your edits
i am certain i shaved whole days off of my wasted time after i figured that out
sigh now why is that last one ignoring the changes :\
Yeah I know live edits help a lot and I sometimes use them but most of the time I don't
I don't know why really.
style sets are typically loaded on startup and unloaded on shutdown but you can hook into live coding to unload/reload it when live coding runs. you do have to close asset windows and reopen them before & after (else it'll crash as widgets try to use the unloaded style) but that can also be automated
Yeah I should definitely do that cause I'm burning time like this
On the off chance that anyone knows what could possibly make the last header column in a listview ignore the column style I'd love to know, cause I have no idea.
Slate was made by the evil...
Joy!!! I still have no idea what the issue actually was but I hacked it by adding another column with a fixed width of 0
I kinda understand why the header row option isn't exposed in UMG cause it's pretty broken
I guess I missed this -
is SlateIM a independant window ? or is it contained in a SWidget and be used however we want ?
im working on a plugin utility panel, which needs to be able to refresh itself, the issue is that using a regular slate widget and updating it on tick breaks the layout (as its take at least 1 frame to calc it) so rn i have to use a update interval, and you can still see the 1 frame where the window seems like blinking
its immediate mode
and yes it uses an underlying SWidget
seems like its only a 5.6 plugin
i got it to work in 5.5
i wonder if anyone here tried to use FSlateIMExposedBase to get the exposed widget to embed it in something else
currently trying and feels like you have to tick it yourself externally, and create it BEFORE it needs to be used (since it needs 1 pretick after being enabled to have a valid SWidget created)
but yeah, you can embed it (here used in a FWorkflowTabFactory)
not used the exposed widget
For anyone starting with SlateIM i wrote a few things
https://notes.hzfishy.fr/Unreal-Engine/Slate/SlateIM
if you can edit the plugin (its a one line change) you can create, init, and get exposed widget in one frame
thanks epic for putting a important function as private
What's the function? You can send me a PR
for FSlateIMExposedBase in SlateIMWidgetBase.h, remove the private for DrawWidget.
i cant do a PR because im on 5.5
got a different headache
i have 2 instances of FSlateIMExposedBase, which each one has its own SWidget, but it renders the same ?
What did you need access to DrawWidget for though? What was the fix to your issue?
the exposed widget is created from DrawWidget, which is called on slate PreTick once its enabled
meaning you can only get a valid exposed widget after 1 frame, after you enabled it
in my case i needed the widget in the same frame as i enable it
so im doing this
void FPSBlueprintPanelWidget::Initialize()
{
EnableWidget();
DrawWidget(FApp::GetDeltaTime());
}
Ah gotcha, I'll look at fixing that without needing to expose DrawWidget
This shouldn't prevent you from making a PR for what it's worth
SlateIM is a 5.6 plugin so im not sure if you'll accept a PR on a "unsupported" version
Ah yeah, GitHub might force you to at least make the PR against the release/5.6 branch since the code won't exist in 5.5
the fix was to give a unique name to each widget instance ๐
im stuck on a weird issue with SlateIM
basically i got some conditions, if its true i add a tab children like so:
if (MyCond)
{
if (SlateIM::BeginTableRowChildren())
{
/// Some more rows
}
SlateIM::EndTableRowChildren();
}
this works fine when my conditions switch from false to true (result: new child rows are added)
but no the other way around (true to false, result: child rows are still there, clicking on a expander arrow removes them)
it seems like a "refresh" issue
SNew(SCheckBox)
.IsChecked_Lambda``` this lambda will be called in the every frame, (or small interval) right?
Correct
Generally you want either an event based check (set check manually) or, if it's an expensive check, use that event to set a bool which the checkbox can read.
i can't believe how not-slow polling is tbh. i've mentioned this before but i had at least a thousand attributes bound to funcs checking on tick and as a test one day i changed almost all of them to just dumb assignments and i couldn't notice any editor performance change at all
Why is slate so horrible with right to left languages. I pretty much have to make custom logic for every horizontal container widget to insert elements in a reverse order.
otherwise everything goes wrong, like, button clicks don't register, only some elements are reversed, etc.
I used to hate Slate at first, but once I understood how to make things flexible, it became comfortable to use. But yeah, for someone new to Slate, it can be a bit frustrating. (I do have some experience with it...)
Uhm, okay.
How can I get rid of this black gray-ish background from a combo box string, I am searching for days but all I read is on the forums was Unreal overriding the color value. So do I have to create a ScrollBox Widget with buttons ?
Never mind I created a dropdown base widget from scratch and I highly recommend everyone having this issue to do the same
I found another bug for SlateIM trees, sometimes the expander arrow isnt showed
I've seen that once but didn't have a repro - do you know how to reliably repro it?
I always have it now for some reason, ill minify my code and sent it here tomorrow ๐ซก
Hi, what is SlateIM?
Plugin to slate?
Imgui slate
seems like it only happens if you call SlateIM::BeginTableRowChildren and SlateIM::EndTableRowChildren() inside a SlateIM::NextTableCell()
nvm, it still happens if you run SlateIM::BeginTableRowChildren() and SlateIM::EndTableRowChildren() AFTER it already didnt ran after a SlateIM::NextTableCell()
What does the lifecycle of a widget look like?
of a slate widget?
yes
slate widgets are all shared pointers, so thats pretty much all of it.
new - c++ ctor - SWidget::Construct
c++ dtor - delete
Thx, i thought thatโs more complicated
So what's the code to reproduce the issue?
What's the difference between Slate and SlateIM? What benefits does it provide?
you know slate right? go look at imgui (google IMGUI) and look at examples of it. IM Slate seems to be trying to create a native competitor to that, but built into unreal, which could be awesome (i haven't used it yet, but have seen a good few people praising the effort so far here and elsewhere!)
Materials used for FSlateBrush don't load when previewing in editor. ( Unreal Engine 4.26 )
Textures work fine.
Materials load when running PIE or Packaged
i see your cpp question earlier now but i think you should expand your question with more context, explain what you're building, what data inputs you have
creating a minimal repro. 1 sec
in Unreal 4.26 ( I have not checked other engine versions )
create an Image Widget,
set the image to a very basic ui material ( note: not a texture -- specifically a User Interface Material ),
restart the editor,
notice that image is blank
once I open the combo box for FSlateBrush::Image every widget using a UI Material displays correctly
( seemingly the editor code for opening the Image combo box calls something that "fully" loads the resource object being used by the slate brush. the materials persist until I restart the editor again )
updated the repro steps
Im checking if this is only for translucent UI materials
opaque and masked UI materials affected as well
odd, 5.6? i won't be opening unreal again for several hours (but might chekc locally when i can)
4.26
might help to know if it's fixed on the latest tho not sure how easy it would be to find the changes
might be on your own with that dinosaur
that's fair
i bet you've had others beat you to death on being on 4.26 by now, but is it your call to do this to yourself? ๐ or are you stuck there because of decisions of others
I did the merge in my free time back when 5.1 was out but was vetoed before even benchmarking
on 5.4 we benchmarked and it lost significant performance for our app so I was effectively vetoed but in partial agreement as well.
I heard 5.6 has improved performance but don't know if I have it in me to do an engine + project merge for a 3rd time just to see
changing our project to jump from 4.26 to 5.4 was very very time consuming
ill make on rn
shitty. FWIW it seemed like the common consensus up to ~5.4 was:
UE5 DX11 is faster than UE4 DX11/DX12
UE5 DX12 is slower than UE4 DX11/DX12
I don't know how much 5.6's improvements have affected this
Did you guys know that popup menus have transition effects built it? This is true in editor as well, all popup menus could have slick open animations. But they donโt because โbMenuAnimationsEnabledโ is disabled in FSlateApplication.
I can re-enable it from C++ viaFSlateApplication::Get().EnableMenuAnimations(true); but why is this disabled? Did this feature get lost during engine development?
i encountered a comment about that recently but never looked into it. i'm assuming it had some non-zero performance implications and they just said screw it
It's been deprecated. Not sure why I didn't see it first.UE_DEPRECATED(5.0, "Enable Window Animations is no longer used and is a no-op so calling this function is no longer necessary.")
if it still works what does it actually do lol
ah, i actually hate it lol
But I also found the inner code with some more info.
funnily enough tooltips still do this, more subtle though
It could have been used for a lot of stuff in my opinion.
The type of anim is configured per popup.
Every animation is implemented either by Slate timers or curve sequences.
But hey at least I can steal the MorphToPosition code from here
here
(video showing the issue being uploaded)
Based on the video, it seems like the bug is that the children still show after unchecking the box?
Yup
Child rows are dynamicly added fine, but aren't removed when its not asked to
Ok cool, I'll take a look, thanks for the repro
If a fix is made, ill be glade to be notified on the git commit ๐
(Or if its small enough whatever needs to be changed)
I submitted a fix for this yesterday btw https://github.com/EpicGames/UnrealEngine/commit/0e3463ecd39262375e61644c6c363cfb2b7a70a4
I just realized, you're using 255-based values for RGB, but FLinearColor expects 0.0-1.0 ranged values.
thanks !
ill apply the changes to my version in 5.5. (update: works)
i still have (in same edge cases) an issue with expander arrows not showing, ill try to find how to repro it in a sample code ill send here;
(but they will maybe be fixed with your fix)
Expander arrows don't show if there aren't any children. They should if there are
yeah but sometimes i do have children but they dont show up (didnt repro it since the above fix)
Ah.
Yeah I think that change should fix both cases
yeah i realized lol ๐
Nice thanks
when using SlateIM PopUp functions in elemnts inside a table, i have this weird glitch
they go away when collapsing tree childrens
Giving the table a max height might fix it
maybe, but the height has to be lower than what is displayed, i cant force a small height
users must be able to stretch the window however they want
**Do you guys know where these 2 underlined icons are found inside the engine content? **
I made the underlined editor widgets for myself, but I'd like to tint the icons and thus need the PNG files.
According to the source code it's Icons/icon_playInWindow_40x and Icons/icon_playInSelectedViewport_40x but those icons look completely different, as if they're the old UE4 style.
maybe UE_5.5\Engine\Content\Editor\Slate\Icons is the wrong location to search for them?
you can try using SlateStyleBrowser plugin to view slate styles
those can be from somewhere else
or from widgetreflector find where button/icon is created
at some point i copied all SVG files out to a single folder and installed a windows extension to render SVG in my file browser lol. searched for "Play"
PlayNewEditorWindow.svg
Hey fellas. Is there a way to Open & Close a ComboBoxKey/ComboBoxString via C++?
I don't know what those look like. Are they like dropdowns you click on and click off of?
If so then you could use slate application to set focus (or clear focus) probably
they create basic SComboBox, UComboBoxKey.cpp doesn't seem to call SetOpen on it but you could do that directly if accessed slate widget
since MyComboBox is private, you would need to use DefinePrivateMemberPtr.h to access it
but possible to implement/expose as BFL static helper
Holy Cow. Thank you for your response. I will look into that.
Is the table set to auto size ?
i guess, i am not using any height/width functions
i tried setting max height with like 2000f (my window is smaller than that), but this dont solve the problem
@drowsy galleon
A fixed height would do it, but you should be able to have it autoheight, but that might be a slate limitation
Does anyone have an example of how to use .Font(FCompositeFont()) on a text box? I'm wanting to change the font size but struggling with setting up the compsite font. (Still new to slate)
do you want to load your own ttf or reuse an engine font?
Just use the engine font.
one way:
FSlateFontInfo NewFontInfo = FCoreStyle::GetDefaultFontStyle("Normal", 10);
have to just store NewFontInfo somewhere like in your style class or something
common strings there are "Normal", "Bold", "Italic" ... not sure if there's more
FSlateFontInfo is depreciated though. ๐
no it isn't
no
that constructor is deprecated
still if you want it, here's an example of loading a font into an FCompositeFont and using it to build the FSlateFontInfo:
TSharedRef<FCompositeFont> SourceCompositeFont_Font_OpenSans_Regular = MakeShared<FStandaloneCompositeFont>();
SourceCompositeFont_Font_OpenSans_Regular->DefaultTypeface.AppendFont(L"Regular", Yap::FileUtilities::GetResourcesFolder() / "Fonts/OpenSans-Regular.ttf", EFontHinting::Default, EFontLoadingPolicy::LazyLoad);
YapFonts.Font_OpenSans_Regular = FSlateFontInfo(SourceCompositeFont_Font_OpenSans_Regular, 10);```
Oh i get you, my bad. ๐ I see there's 2 others I could use that aren't deprecated.
(sorry it's ugly because it's an expanded macro of mine)
any way of knowing if a slate widget is being hidden or not ? (im trying to know if at a given time a FBlueprintEditor is visible or not)
Use the widget reflector
someone else might easily have better ideas than me but the two ideas i know of are:
- it is possible to query the editor for open blueprint assets (you may be able to see what kind of blueprints or assets are opened for editing from that)
- this would be ghetto but if you have a custom slate widget you're worried about, you could store its existence in some static vars that you set/clear on creation and destruction
if 1st option sounds useful i'll go find it in my plugin
for 1 i only use opened editor, but it doesnt mean its rendered (can be in a collapsed tab or behind another)
ill go find it for you
https://github.com/HomerJohnston/Yap/blob/main/Source/YapEditor/Private/YapEditor/YapEditorSubsystem.cpp#L174
see usage of UAssetEditorSubsystem in this func and the next function below
i use it to close all open asset editors during live coding and reopen them after so i can edit and reload slate style data
thanks for sharing but this doesnt answer what I just said.
for a given BP editor (meaning its a living editor that exists, aka the user opened a BP), how can i know if its rendered/viewed or collapsed/hidden
Can you remind me, do we have something like MultiLineEditableText with color support, like in Rich Color Text Box?
SMultiLineEditableText has support for switching colors fonts and styles but it's bit convoluted to set up. It is used in the various code editors within unreal to do syntax highlighting, so you can pretty much do whatever you want with it.
There are several examples within the editor to learn from, one is the custom material expression node (in the code it's called OptimusHLSL), another is the experimental and unused CodeEditor plugin that has c++ syntax highlighting.
I managed to hack the code editor into a custom code editor for this esoteric musical programming language called ChucK, my code is on Github and can perhaps be used for reference, took me a while to set it up, would probably be easier these days with the help of an LLM - https://github.com/Amir-BK/chunreal-midi/blob/main/Source/Chunreal/Public/SChunrealMultiLineEditableText.h
FWIW the whole thing is not editor only, I managed to run the code editing widget in game, which is fun cause ChucK can be compiled on the fly. So yeah, it's possible.
Cute, I think.
I'm updating from UE5.4 to UE5.6 and I got a deprecation message that I'm using the wrong FSlateFontInfo constructor. Is there a migration guide for deprecations like this?
Scroll up like twenty messages
Do I need to make one for each flavor like Bold and italic? Or what is the point of a composite font?
That I cannot answer sorry 
I made one for each but I was not interested in learning more than making it work. Lol
I'll go with one for each then lol, thank you for the help!
anyone who can help me with this plz, whenever i am zooming my timeline, the keyframe gets dissapear, when i change the scroll offset it gets visible again.
Try not to spam multiple channels.
I'm gonna assume this is for Slate, given somewhat C++
What in the heck controls a widgets unable to tick while off-screen/ not rendered/ not visible?
what are you trying to solve?
I just wanted tick, while off-screen basically.
I thought that surely there must be a can tick.
There is, but it seems to be more about generic checks, and the off-screen seems super deep in the C++
Basically 24/ 7 tick, while the widget is added to viewport
You can register your own tick function if you want. Extend from FGCTickableObject or some such. Or set something up with a world timer.
(If you're doing this for a game)
Never registered my own tick before.
Is this what that widget extensions shit was, or something very different?
Is this some function I define, some new file, or what exactly?
(NVM, quick google was easier then expected. ๐ )
This isn't the ideal solution at all, but if it's a 3d widget that doesn't tick off screen, there's absolutely definitely a checkbox for that somewhere.
But if you can't find it, there's the pragmatic approach like this. ๐
lol
A whole like 1-2 of these will ever exist at a time, so shouldn't run into any issues, i'd hope
still wondering how i can know if a slate widget is rendered/collapsed/blocked
If I have an IPropertyHandle to something like an FGameplayTag property, how on earth do I embed that into a widget? CreatePropertyValueWidget() is not doing what it suggests?
Surely I don't have to manually setup the widget for it?
oh wait you're on 427 aren't you
it will draw the default uncustomized widget, which will be blank for a gameplay tag
this may be a massive pain in the rear. i did it once, or almost... before i discovered the new func in UE5... maybe you can study the new function and pseudo backport it...
TSharedRef<SWidget> FPropertyHandleBase::CreatePropertyValueWidgetWithCustomization( const IDetailsView* DetailsView )
{
FCustomPropertyTypeLayoutMap CustomPropertyTypeLayoutMap = [DetailsView]()
{
if ( DetailsView )
{
return static_cast<const IDetailsViewPrivate*>( DetailsView )->GetCustomPropertyTypeLayoutMap();
}
else
{
return FCustomPropertyTypeLayoutMap();
}
}();
FPropertyEditorModule& PropertyEditorModule = FModuleManager::GetModuleChecked<FPropertyEditorModule>("PropertyEditor");
FPropertyTypeLayoutCallback LayoutCallback = PropertyEditorModule.GetPropertyTypeCustomization( GetProperty(), *this, CustomPropertyTypeLayoutMap );
if (LayoutCallback.IsValid())
{
TSharedRef<IPropertyTypeCustomization> PropertyTypeCustomization = LayoutCallback.GetCustomizationInstance();
return SNew( SStandaloneCustomizedValueWidget, PropertyTypeCustomization, AsShared() );
}
else
{
// Opting to not generate the default buttons since the code path that goes through a customization would likely not have them
const bool bDisplayDefaultPropertyButtons = false;
return CreatePropertyValueWidget( bDisplayDefaultPropertyButtons );
}
}
in UE5 this function works fine if you pass nullptr for the DetailsView (i.e. if you're in a property type customization not a details customization, where you don't have a DetailsView instance)
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "DetailGroup.h"
#include "DetailWidgetRow.h"
#include "Widgets/SCompoundWidget.h"
/**
* Generates the header widget for a customized struct or other type.
* This widget is generally used in the property editor to display a struct as a single row, like with an FColor.
* Properties passed in that do not have a header customization will return a null widget.
*/
class PROPERTYEDITOR_API SStandaloneCustomizedValueWidget : public SCompoundWidget, public IPropertyTypeCustomizationUtils
{
public:
SLATE_BEGIN_ARGS( SStandaloneCustomizedValueWidget )
{}
/** Optional Parent Detail Category, useful to access Thumbnail Pool. */
SLATE_ARGUMENT( TSharedPtr<FDetailCategoryImpl>, ParentCategory)
SLATE_END_ARGS()
void Construct( const FArguments& InArgs,
TSharedPtr<IPropertyTypeCustomization> InCustomizationInterface, TSharedRef<IPropertyHandle> InPropertyHandle)
{
ParentCategory = InArgs._ParentCategory;
CustomizationInterface = InCustomizationInterface;
PropertyHandle = InPropertyHandle;
CustomPropertyWidget = MakeShareable(new FDetailWidgetRow);
CustomizationInterface->CustomizeHeader(InPropertyHandle, *CustomPropertyWidget, *this);
ChildSlot
[
CustomPropertyWidget->ValueWidget.Widget
];
}
virtual TSharedPtr<FAssetThumbnailPool> GetThumbnailPool() const override
{
TSharedPtr<FDetailCategoryImpl> ParentCategoryPinned = ParentCategory.Pin();
return ParentCategoryPinned.IsValid() ? ParentCategoryPinned->GetParentLayout().GetThumbnailPool() : NULL;
}
private:
TWeakPtr<FDetailCategoryImpl> ParentCategory;
TSharedPtr<IPropertyTypeCustomization> CustomizationInterface;
TSharedPtr<IPropertyHandle> PropertyHandle;
TSharedPtr<FDetailWidgetRow> CustomPropertyWidget;
};
make your own. it's less than 30 LOC if i remove the white space and comments lol
hopefully the new dependencies end here
@stuck jewel I found that using AddProperty from an IDetailChidlrenBuilder seems to work.
But the only problem is, my property is inside a TMap and the silly icons for deleting the entry appear with the property widget...
ahh good find i should have known that.
what happens if you pass ShowPropertyButtons(false) on it after? on the IDetailPropertyRow
Yeah I only just started looking at that interface.
Ill play with it
Cheers
@stuck jewel This worked even better
TSharedPtr<SWidget> KeyNameWidget = nullptr;
TSharedPtr<SWidget> KeyValueWidget = nullptr;
ChildrenBuilder
.AddProperty(KeyProperty.ToSharedRef())
.Visibility(EVisibility::Hidden)
.GetDefaultWidgets(KeyNameWidget, KeyValueWidget);
TSharedPtr<SWidget> ValueNameWidget = nullptr;
TSharedPtr<SWidget> ValueValueWidget = nullptr;
ChildrenBuilder
.AddProperty(ValueProperty.ToSharedRef())
.Visibility(EVisibility::Hidden)
.GetDefaultWidgets(ValueNameWidget, ValueValueWidget);
GetDefaultWidgets
From the AddProperty
ah interesting!
Lets you extract the actual Name and Value
Widgets
Which I can then embed whereever I like
Has anyone experienced, or know the reason why am i getting unresolved external symbol error when trying to call function from different module/plugin within the SLATE_BEGIN_ARGS macro ? The crazy thing is that is works just fine if i call the function anywhere else, it only happens when i try to do that here inside the FArguments constructor:
SLATE_BEGIN_ARGS(SIE_Slate_Button)
{
// i get unresolved external here
_FontSize = ULibFromOtherModule::DefaultFontSize();
}
doesn't really matter what or where - it is cross-module import/export problem.
1 - you're missing dependency of module that contains that class. the module that does the call must have calee module as dependency
2 - class does not export function (no api macro on class/function)
and since function body in header - whatever uses it will require linking to appropriate module
if you want to hide it - break down using intermediary
SLATE_BEGIN_ARGS(SIE_Slate_Button)
{
InternalInit(*this);
}
static void InternalInit(SIE_Slate_Button::FArguments& Self);
// in cpp
void SIE_Slate_Button::InternalInit(SIE_Slate_Button::FArguments& Self);
{
Self._FontSize = ULibFromOtherModule::DefaultFontSize();
}
making modules that se SIE_Slate_Button::FArgs link to InternalInit function instead of ULibFromOtherModule and avoid needing extra module for linking
I'm gonna post this in here, cuz its widget related, but at the same time feels more generic UE C++ related.
I'm using the FTickableGameObject after someone suggested it, so I can have my widget tick 24/ 7 while its "added to viewport"
But, if I idle for like 30 seconds - 1 minute
I get an exception, but no direct crash, if I simply just tell it to resume.
The stack drops into BP, since it calls my BP function.
But, nothing is implemented in BP yet.
That thread get, is this.
Hmmm.
After a bit of testing, i'm a bit lost on what to check for.
I have this (image)
But, a widget that doesn't exist is somehow reach-able, and doesn't have said flag
Is there some special value to check for?
At this point I'd kind of like to ask why you need the widget to tick while off screen ๐
The widget might be being destroyed when not rendered off screen.
30s - 1m is the GC time (60s)
You could try doing ->AddToRoot() on the widget.
We're getting way out of the "good coding" playbook here, though ๐
What you should probabyl do is not have any of your "tick every frame" shit in the widget at all, put it in another object and use the widget as a view to whatever other process is going on.
So it doesn't matter if the widget is alive or not.
1st is that I wanted an event, for when the widget itself was added to viewport, and removed.
2nd, I'm following the suggestions of have widget pull data from code on tick, but if the widget is empty/ hidden (no data), it can't continue to tick to display data.
that's just it though (what daekesh said). your game "model" should be ticking. if the widget isn't visible, why should it tick. there could be exceptions to this of course but it's the starting point
you're having a chicken/egg problem of some sort?
I didn't wanna constantly destroy, remove, add, create 1 widget class over and over.
So I just set its visibility, when theres no data.
Which makes it unable to tick
Do the ticking somewhere else.
Wasn't that the whole point of moving it to the widget?
Seems weird to like triple obfuscate the ticking visual.
Something gathers data.
Widget display data
But, 3rd thing computes it all?
But, wouldn't the same issue occur?
A tick is occurring on the widget, when its not supposed to. (that be caused by itself, or caused by the Hud calling tick.
Why is the thing that's gathering the data not the thing doing the updating?
Why does the widget do anything at all in that respect?
Thats what someone had suggested, and to me it made sense.
Something only gathers data, doesn't need to worry about certain stuff being valid, ready, or etc.
Widget can just exist whenever, and get the data from the thing doing the gathering.
(This all stemed from how the hud begin play occurs after controller, which means all my gathering would need widget valid checks, just to be safe)
Indeed.
The thing doing the gathering can trigger events to notify any listeners of important changes, rather than having a direct connection.
Hmmm, ok.
I can swap to that, just seemd like a tiny waste, when at the end of the day it'd just be a glorified tick delegate.
hence just using direct tick on widgets.
Then, what about #1.
I use it for a tiny thing, but its quite useful, when I don't wanna step on myself by accident constantly.
There no form of C++ function override for being added, just initialize, but I don't want that.
I guess I could scuff it by just keeping a timer running on tick, so when the timer actual completes, it means tick stopped.
Hey all, I have an issue with text input for editable text boxes and I hope this is the right place to ask this question.
I'm trying to get a text chat system working which works fine, but it only works for English character inputs. When changing my language to KR/CH/JP, the game and editor forces me to be inputting English characters. However, when I create a new project, it allows me to switch language input. What could be the problem with my other project that it forces me to only input English characters?
What do you mean 'forces'? does it ignore language switch and inputs only in english or are you seeing weird characters? Cause I'm using editable text boxes with non english languages in one of my projects and if you use a font that supports the language everything works fine
Forces as in it automatically changes my keyboard to input English characters whenever I focus on the unreal editor window. And same with a packaged game, whenever I open the game, it forces English input
When I open my other project however, it lets me freely change input to Japanese in this example, and I can type Japanese characters in the editable text boxes
when application starts it uses system-default language, it should be able to change as it is on OS-level and not App-level controlled.
not really related to slate.
initially i thought it was about non-cjk font but that should not prevent input or swaps
any widget can be hit traced?
I wonder if I could make subclass of Horizontal Box to capture mouse click instead of passing it to child components
Hey, is there any way of making the joyistick navigation a little bit more forgiving? Like with a larger or bigger radius of detecting the next focus target?
hey there, is there any command that hide/show all the ui? or slate related?
I want to test something because my ui doesnt show after I use loadingscreen when I load same level from same level
even default unreal console ui doesnt show
Need help with the Size box with Slate heres my Example code I guees:
SNew(SOverlay)
- SOverlay::Slot()
[
SNew(SBox)
.WidthOverride(300.f)
.HeightOverride(150.f)
[
SNew(SImage)
.ColorAndOpacit(FColor::Black)
]
}
After I go into the engine it ust gives me a black Box with it covering the whole screen
You probably need AutoSize on the slot
With the overlay slot correct?
Anyone knows how to extend FDragDropOperation?
I'm suffering brain damage sifting through the engine code to figure it out
nevermind I did everything but reading the class' comment which literally says how 
Thank you.
Unfortunately, neural networks are still incredibly stupid when it comes to anything deep.
i'm playing with slate and Unreal editor UI stuff
i'm looking specifically to create something like in the image,
a timeline of sort with layers and keyframes,
this one is from Gearbox Borderlands 3 stream in youtube
i'm looking for anything similar, maybe sequencer can be used here or other base timeline class.
any help or guide would be appreciated
i was successful in creating my asset type and initializing a custom editor for it, not i just need to continue on with the logic
You want to recreate sequencer?
no no, in unreal some stuff like the viewport or details panels can be called and just work on top of it.
i just need it -or any other timeline- to build like a day night cycle , something similar to the one used in borderlands
with GPT i managed to open sequencer in a custom tab , but the code was unstable , i dont rely in AI on such a big task
If you rely on AI at all, you're gonna run into a lot of road blocks with UE.
Especially with the lower level stuff.
looks promising, thanks
yeah, its too confident that it knows the answer, and the result is mostly functions it came up with,
gpt: you want to create a new menu item, just the the CreateMenuItem()
Hehe. Indeed!
Extending the unreal sequencer other than where you're meant to (like custom tracks and stuff) is kinda hard, I mean, there's the motion designer sequencer (which @grave hatch was heavily involved with) but if you'll look at it it's like a very big thing, not so easy. Making your own custom timeline though can be pretty simple depending on what you're going for exactly, I made a midi pianoroll, which is a timeline in a way, and it wasn't too difficult.
But yeah really, the unreal sequencer itself has a lot going for it, if you'll check the Level Sequencer code or the Avalance Level Sequencer (motion designer) you'll see that thing is massive, I wouldn't recommend.
Pianoroll, for reference - https://github.com/Amir-BK/unDAW/blob/main/Source/BKMusicWidgets/Public/SPianoRollGraph.h
Making a simple timeline and a pannable panel is not too hard (I mean, it is for me cause I'm stupid and I had plenty of trial and error but conceptually, it's not too hard)
i'm still checking it out, but its really impressive
I wouldn't say "heavily" ๐
as far as I'm concerned you did the whole thing by yourself
๐
If you want to add custom tracks to the existing level sequencer I also did this thing, which is very similar to the pianoroll but paints the notes on the unreal sequencer - https://github.com/Amir-BK/UnrealMovieSequencerMidiUtils
whaat, the motion design sequencer guy is you, thats amazing
It's mostly my manager, but I did some of the initial work.
also good, i think this is a good place to start, i really appreciate it amir
this is the closest i came to a UE developer
I did a lot of work on the motion design viewport stuff. The draw modes. Snapping, grid (it still looks awful...), the material designer, remote control, media viewer, plenty of other random crap.
you sound indifferent, but you're describing really interesting stuff ๐
how long have you been with epic
based on how long it takes to make something as simple as a slate graph widget, by my math, i would estimate approximately... 67 years
around the same time as Unreal 17
I don't work for Epic. I work for a third party they contract.
ah ok.
it was really nice meeting you and @pallid gyro
Thanks!
hey, in unreal insights, Slate3D refers to drawing widget components right? suddenly having it take up 6ms per frame on lower end platforms and I can't figure out where it's coming from
yes, as for confirming - just search for "Slate3D",
which you will find DECLARE_GPU_STAT_NAMED(Slate3D, TEXT("Slate 3D"));
and then use cases of ISlate3DRenderer will lead you to WidgetComponent and WidgetBlueprintEditor
thank you
as it turns out though it also covers retainer boxes with materials for some reason
does UE have a native "GetParentOfType" slate function that just iterates the hierarchy getting for an FName match? Just don't want to be reinventing the wheel here
Also another question, are all widget types supposed to implement the macro SLATE_DECLARE_WIDGET_API(SCompoundWidget, SWidget, SLATECORE_API)(this is from SCompoundWidget obv)
I would be curious of why they aren't supposed to in some cases because that would seem weird, but I might be wrong
Here is why I ask, I have this popup window and the widget inside needs to close it when I hit a button.
Its supposed to be like a throw away call once and forget function so no one holds the SWindow besides
FSlateApplication::Get().AddWindow(Window); so the component within needs to find the parent and call close when we are done
This Doesn't work since SWindow doesnt implement the macro SLATE_DECLARE_WIDGET_API but its parent does, so this returns "SCompoundWidget"
if (TSharedPtr<SWindow> Window = BF::Slate::TryGetParentOfType<SWindow>(SWindow::StaticWidgetClass().GetWidgetType(), W))
{
Window->RequestDestroyWindow();
}
I can obviously just write "SWindow" myself but I figured i'd use slates impl of a static class and be more "official" but it seems to be half supported so I am curious as to why (if any) the reason would be for SWindow and plenty of child classes not doing that
my very VERY entry-level understanding is that SLATE_DECLARE_WIDGET_API is supposed to just be kind of a helper to give slate widgets similar typedefs as UObjects (ThisClass), and it also forces you to set up a PrivateRegisterAttributes function which i think is supposed to somehow give more intelligent (performant) attribute/dirtying behavior. but i also have no idea if that's really true or not. i just use it sometimes to get Super/ThisClass
but what's the window for, is it like click on a button and get a popup to do things in and then you want it to go away?
Yeah it's like a custom popup - afaik UE doesn't have anything native that lets me create a popup but pass the content of the popup to the spawner
I did try that (its for a right click context menu button when I right click an asset in the content browser), It just despawned the menu once I clicked my entry and I couldn't see SMenuAnchor
I might have been doing something dumb though
it vanishes if it doesn't have focus. i can't remember 100% how the base class works with regards to that
but these clickers are all a "popupbutton" class i made by inheriting from SMenuAnchor https://gyazo.com/83b9e1ca7f77575277cb77644b395ac3.mp4
Yeah that was probably the issue since the right click context menu despawned when I click an entry it loses the context to anchor to
here is my use case (ignore the formatting of the widget lol, still a wip)
when I click the menu entry it despawns the right click menu
UX wise i feel like everything in this video looks proper ๐
or maybe you mean this is working correctly but you did a hack to make it
this is via my own throw away func that spawns a window (I was just showing why I think the SMenuAnchor route didn't work for me)
TSharedRef<SWindow> SpawnSlateWindow(const FString& WindowTitle,
TSharedRef<SWidget> Content, ESizingRule SizingRule, float WindowX, float WindowY,
const FOnWindowClosed& OnWindowClosed)
{
TSharedRef<SWindow> Window = SNew(SWindow)
.Title(FText::FromString(WindowTitle))
.ClientSize(FVector2D(WindowX, WindowY))
.SupportsMinimize(false)
.SupportsMaximize(false)
.SizingRule(SizingRule)
.CreateTitleBar(!WindowTitle.IsEmpty())
.UseOSWindowBorder(false);
Window->SetContent(
SNew(SBorder).Padding(8)
[
Content
]
);
Window->SetOnWindowClosed(OnWindowClosed);
FSlateApplication::Get().AddWindow(Window);
return Window;
}
But yeah what I have now works, It was just what lead me to wonder if UE had a native get parent of type as well as why the macro was only implemented in some classes but you kind of explained the latter
@pallid gyro @grave hatch hey guys.
the timeline i started working on is coming along nicely
Just curious, what did you find lacking in unreal's built in features?
it wasnt lacking, i tried the day sequence plugin, loved it, but i though to make it myself and see how far i go with it. plus i like writting coding.
also, the plugin is kinda heavy on performance, didnt dig deep to know what the cause, have you been working with it to notice.
๐ cheers, no i haven't used it yet just browsed through its docs and thought it seemed very thorough
oh yeah it is thorough, i found out they use very scientific math to calculate accurate sun\moon rotations and light values and stuff
Has anyone used UE's MVMM plugin? Just wondering what your thoughts were about it if you have.
it's awesome, once you figured out how it works
In c++ it feels great and very reliable in BP there are some quirks, but either way itโs better than creating a bunch of delegates or having logic on the tick event
Do we have any example that demonstrates how to create a slate Widget that allows you to add custom tags to a Custom Event or Function? I remember finding for variables, but I don't remember finding for functions.
add custom tags to a Custom Event or Function
what kind of tags?
One sec.
https://www.fab.com/listings/6410b8cb-4726-4320-b90d-2b491126bc65
Some like here, custom metadata tags, in this plugin for var.
ไธญๆ๏ผ/ ๆๆกฃ / ๆ็จEnglish๏ผ/ Documentation / TutorialsExamples:ย Key๏ผGetOptions Value๏ผFunctionNameKey๏ผLongPackageName Key๏ผRelativeToGameContentDirKey๏ผForceInlineRowKey๏ผCategories Value๏ผXXX.XXXKey๏ผExcludeBaseStructKey๏ผBaseStruct Value๏ผ/Script/Module.StructDisplayPriority, EditCondition, etc...
thats not "tags", that is "metadata"
Ok, metadata tags.
maybe, if you dig where the details view reads custom event data could track to corresponsing UBlueprint/UEdGraph and find how to assign metadata to corresponding generated UFunction or it's source
for BPVariables it is just stored in bp variable definition itself and it can use BlueprintEditorModule.RegisterVariableCustomization for the property to inject editor
https://github.com/DoubleDeez/MDMetaDataEditor/blob/main/Source/MDMetaDataEditor/Private/MDMetaDataEditorModule.cpp#L28C33-L28C84
compared to function it is significantly simpler
still it will be limited only to Custom Events and BP-declared Functions.
start point will be details view with selected event or function, then bp graph source
TLDR: possible with enough research about engine bp internals, no solution out of the box
Ok.
Thank you!
Can you not just do GetOptions if the list is static? (not possible for function inputs)
It's pretty trivial to add context sensitive ones to any function. You can customise the function input value to show whatever you want.
If you search for PinFactory from me (maybe in here or #cpp) I posted an example.
If you need it on details panel it's a lot harder. Mostly because the details customisation system is shit, but it's effectively the same thing.
Thank you. I complete what i want to add.
Does one know, how to make the Label of a SGraphPin invisible (best collapsed)?
Seems like I need to create my own SGraphPin child and give the label a NULL Widget..
another update,
this slate thing is fun
the timeline is mostly complete, just the play and reverse buttons i think
Nice so this whole thing is a custom sequencer in its own toolkit?
Does it implement isequencer or is it an entirely custom widget?
yeah, it is its own thing ,
didnt find anything on how to implement sequencer
Also making progress with my Dialog Editor..
just the Pins are annoying.. need to find a way to remove those Labels..
I have a custom class, inheriting from the SGraphPin..
then just set bShowLabel = false?
is that bool in any form protected?
Cause i cannot get my Custom Pin to work..
Either the Image i want it to have is squeezed or distorted...
Or it does not react to any input of the mouse..
ok.. i managed to get the labels be gone.. beside Option Pin.. which should have "Options" stand beside.. which i have done with another custom Widget containing a text..
But..
The custom Pins do not react to any Mouse input.. so i can not drag a wire from or to them..
And they all have this weird, slighty grey border around them..
Now we are talking about style:
looks sweet ๐
Reminds me of the allsop mouse mats!
Is anyone here currently versed in the current state of Automotive HMI with Unreal? Only seeing a few projects out there at the moment. Teaching a class this Fall and I wanted to teach the class how to build a shippable prototype of an HMI in 14 weeks and Iโm not sure how relevant the Automotive HMI Template is these days.
Question:
i ant to implement an embed ColorPicker to Detail Tab.
What Delegates do i need to use to update stuff WHILE selecting a new color (while dragging the indicator)?
DataCategory.AddCustomRow(LOCTEXT("CommentColorRowFilter", "Comment Color"))
.WholeRowContent()
[
SNew(SColorPicker)
.TargetColorAttribute(this, &FDialogTreeDetails::GetCommentNodeColor)
.??????(this, &FDialogTreeDetails::OnLiveColorChange)
.OnColorCommitted(this, &FDialogTreeDetails::OnSetCommentNodeColor)
.UseAlpha(true)
];
ok.. nvm.. got it..
Hi..
Thanks for the Tip with the bShowLabel.
I got another thing i cannot get my head around, how to remove/change it.
The normal Brush of the Pin works fine.. showing my Ring..
But the Hovered is showing a Linear gradient Rect behind the Ring (maybe cause it is stretched..)
Is there a way to remove that hovered brush or change it to not being drawn?
I am struggeling with font measure service.
I just want to draw two texts (using MakeText) right after each other.
But they will overlap. The longer the first text, the more there is an overlap.
The font doesnt have any outline.
FVector2D Start = Position;
FSlateFontInfo FontA = Font;
FString TextA = TEXT("First Text");
FSlateFontInfo FontB = Font;
FString TextB = TEXT("Second Text");
FVector2D SizeA = FSlateApplication::Get().GetRenderer()->GetFontMeasureService()->Measure(TextA, FontA);
FSlateDrawElement::MakeText(OutDrawElements, LayerId, AllottedGeometry.ToPaintGeometry(FSlateLayoutTransform(Start)),
TextA, FontA, ESlateDrawEffect::None, Color);
FVector2D SecondPos = Start + FVector2D(SizeA.X, 0);
FSlateDrawElement::MakeText(OutDrawElements, LayerId, AllottedGeometry.ToPaintGeometry(FSlateLayoutTransform(SecondPos)),
TextB, FontB, ESlateDrawEffect::None, Color);
What am I doing wrong?
it may not take DPI scaling into account, and as result your final widget size will be different?!
If you mean Application Scale.... that is at 1
It should be better if you use vector fonts.
I forget exactly what they're called in ue.
There aren't many in the engine by default.
It could also be the slate layout transform call that's not correct.
If i use the same for boxes or lines the layout transform works just fine.
What is it font dependent? It should work regardless of font.
Anyone? #slate message
did you check all the brushes in the style class for the widget? there's often a lot that's hiding there
I have a struct of float properties I'm using for stats, that are EditAnywhere. i want to be able to set some stats to not be modifiable in runtime depending on the item by my stat upgrade system, by setting a bool somewhere.
i cant think of a good way to do this, as making a TMap and assigning each stat to a bool and then turning them on or off is kind of annoying, and i wouldnt know the best place to put it.
i had the idea to use the InlineEditCondition option on the UPROPERTY macro for this purpose, and i need some advice on how i can access the meta properties in normal runtime, and check if the EditCondition is false or able to change it
like so
oh. just nest structs
Meta properties are not available at runtime.
Simply having a struct with a float and a bool and your interaction with that struct always checks the bool is, of course, always available anywhere.
i dont know why i didnt consider that simple solution
and i can make the struct always show its inner properties right, so it doesnt clutter detail panels
Sometimes you see a rabbit hole and you simply have to jump down it ๐
and i can still use edit conditions i guess, so the check box shows next to the item
You can make it be an edit condition still
And it'll hide it and put the checkbox on the name bit.
The one disadvantage with a struct is you need a new one for each data type.
yeah. currently they are just floats so it should be easy enough to swap over
but i can make it so the individual structs do not show up in the detail panel as a separate dropdown right. so my outer struct only shows the inner properties of the float structs
Yeah. That should work.
Remove the inner properties thing and see if it fixes itself.
(you'll have to unfurl them then, though)
k
The details panel is a beast that must be tamed.
Often with customisations.
Save yourself now!
lul. i do know the pain
took me forever to figure out my first slate project
removing the inner thing didnt fix it
do i need both to declare it?
or one. or do i only need the Inline one at all maybe?
You could try adding EditAnywhere to the bool.
smart. also, i think the InlineEditCondition might need to be on the bool itself
not on the thing it works on
Possibly?
This has examples of all of them.
ok yeah. according to this, seems i should have it on the bool
which does make sense
benUI coming in with the good info again
huge. now i can try the inner properties again. oh and i need TitleProperty maybe also. idk where the outer name goes if i show the inner
TitleProperty I think just works on arrays/maps/sets.
Details panel things
i could make a detail customization, go through hours of effort and tons of bugs and needing to learn how to write slate code again, or i could give up
๐
I wrote one and a template-based slate property exposure system.
For making a wysiwyg slate editor.
Never finished the editor, though.
that sounds difficult
There was some mind-bendingly bad templating.
my relatively simple slate plugin had like 400 lines of detail customization code in it. i cant imagine doing something bigger. that would be cancer
this took me weeks
ive learned to not do it again
lol
the reset button alone took me days of research and googling, because i couldnt get the normal InlineReset thing to show up
this dude
Just gotta run that "create reset button" function!
i did! didnt do anything
i think i did. idk i tried everything before deciding to just make my own button and put it on the same line
It'll be invisible if the property can't be reset to default.
idk it was a while ago. i dont remember all the things i tried
pretty sure i went over every reset option on the property, row, and category options
Do you know about the widget reflector?
i do
uh. what does ctrl+w do? i thought that was the widget reflector, but i think it closes windows
woops
ctrl+w is the generic close window bind.
ah right. i knew it was in tools. didnt know it was in a sub group
this is the invisible reset button i assume?
i dont see the "create reset button" option. on the property
idk i think its because im doing manual name/value creation for the rows.
On the IPropertyHandle
i dont see it
and i think i tried the other things like making custom reset to default
honestly i dont rly wanna dive back into this. i wasted too much time on it lol. i have buttons that do what i want now anyway, so im good
Haha.. you don't wanna see my 2000+ Lines of Custom Details for my Dialog Editor.. where each Node has its own custom Details to replace the Structure Details of a Datatable..
Without a proper modular basement.. you go crazy with Slate..
Should be IDetailRow::CreateResetButton() afaik
you wanted ctrl+shift+w lol
cant figure out how to get the detail row object anymore tho. its been too long.
but again, im good honestly. i got my reset button working manually and thats fine enough.
appreciate it tho.
ah. one key away from success
hello everyone
I am doing a loading screen using Slate and the Movie Player
Do you know if the Time node in a material is updated during this?
I have tried to invalidate the SImage but seems like it is still not updated. Did anyone hit this issue before?
the time node in materials is constant and always running
"Small" Update to my Custom Detail for the Mesdsage Node..:
@static lion ran into your level selector plugin on github, cool stuff! I modified it a little bit to use SSearchableComboBox (actually asked copilot to do the heavy lifting)
I dunno why the favorites icon doesn't load, actually the favorite icon does load it's the 'unfavorited' icon that doesn't.
I currently do a new iteration, containing a filter for a tag and a search function..
Will take the Slate style problem of the UnFav icon into the current sprint, too
the refresh icon also appeared squished, I tried to fix it but as you can see I wasn't fully succesful.
That has already been fixed..
Just not pushed yet ๐
I updated the Plugin:
https://github.com/BDCPatrick/BDC_LevelSelector
a FREE plugin to add a level selector Combobox above the Viewport, listing all levels inside the Content browser recursively, for easy switching. - BDCPatrick/BDC_LevelSelector
@pallid gyro
My right mouse down click is not processed in FSceneViewport::OnMouseButtonDown while in a menu due to these lines:
const bool bProcessInputPrimary = !IsCurrentlyGameViewport() || HasMouseCapture() || (ViewportClient->GetMouseCaptureMode() == EMouseCaptureMode::CapturePermanently_IncludingInitialMouseDown);
const bool bAnyMenuWasVisible = FSlateApplication::Get().AnyMenusVisible();
// Process the mouse event
if (bTemporaryCapture || bProcessInputPrimary)
{
if (!ViewportClient->InputKey(FInputKeyEventArgs(this, InMouseEvent.GetUserIndex(), InMouseEvent.GetEffectingButton(), IE_Pressed, 1.0f, InMouseEvent.IsTouchEvent())))
{
CurrentReplyState = FReply::Unhandled();
}
}
since both bools always seem to be false while inside of my menu.
Is suspect that bAnyMenuWasVisible should return true, but I can't find much about the Slate MenuStack. Is this still in use? I am using Unreal 5.4.
Or could there be another reason why my input is not processed?
In the editor or game?
hey
i hape a question about SNumericEntryBox
the min value works fine, but the max value is always 100
SNew(SNumericEntryBox<double>).AllowSpin(true).AllowWheel(true).MinDesiredValueWidth(30.0f)
// .SpinBoxStyle(&FCoreStyle::Get().GetWidgetStyle<FSpinBoxStyle>("SpinBox"))
.MinValue(20.0f).MaxValue(512.0f).SliderExponent(1.0f)
.Delta(0.1)
.Value_Lambda([this]() -> TOptional<double>
{
return TOptional<double>(fff);
})
.OnValueChanged_Lambda([this](double NewValue)
{
fff = NewValue;
})
.OnValueCommitted_Lambda([this](double NewValue, ETextCommit::Type CommitType)
{
fff = NewValue;
})
did you try setting the max slider value parameter?
yup, it was the one ๐
thank man,
is there anything like SSplitter which could be used to control size of a target widget?
SBox?
yea kind of, was more thinking of something which provides visual "handles" for the user
so guess i would have to make my own
SSplitter works but it is limited, I also ran into issues with it and I believe that just using a bunch of SBoxes is the the way to go. I'm pretty sure that the unreal sequencer just uses a few SBoxes inside an SScrollBox, but it's been a while since I looked into it.
Anyone knows how HitTestInvisible works under the hood? Does it go to each child widget in the hierarchy recursively and set their visibility? Or maybe it only sets it on the widget you specify and children are ignored by checking if their parent is HitTestInvisible?
I think it's just the widget and the children use their own visibility? Maybe?
Ran a quick test, turns out it doesn't set visibility on all children, like you said. If a child widget was visible, it stays that way. Cool :p
Thought so!
I use that specifically for floating panels that need to be click-through-able, but contain buttons and the like.
Yeah it's neat! Currently using it to prevent the client from dragging items around. It covers that short window before the Inventory has replicated back after an action. Mostly useful for high ping players
Hello, can someone
help me ? I created a widget with a specific ratio using a SizeBox that wraps the widget, and I would like to add several of them in a Vertical Box. However, it doesnโt exactly maintain the ratio. The width is correct and matches the width of the Vertical Box, but the height is incorrect (visually, the widget looks correct, but the Vertical Box adds a huge space above and below). This is not a padding issue. Could you help me?
That's because your vertical box is filling the space of its parent.
You'd need to set the alignment of the slot your vertical box is in or wrap it with a box.
Or you can try fiddling with the vertical box slots, e.g. setting .AutoHeight() on each slot
Thanks It help, also seting the scalebox wich wrap my widget to fill X helped to
Does someone know why my widget invisible after creating and adding to viewport successfully?
Use the widget reflector to find out.
was this
Youโve hit a classic UMG pitfall: youโre building/changing the WidgetTree in NativeConstruct. Thatโs too late. The actual Slate widget hierarchy is already built by the time NativeConstruct runs (itโs built in RebuildWidget). So reassigning WidgetTree->RootWidget or creating a new root/canvas in NativeConstruct will not affect whatโs actually rendered. Thatโs why your C++-created content never appears (and doesnโt show in Widget Reflector), while the BP text (โay cabronโ) does.
Hi y'all. I've got an interesting situation. I'm using Slate.ApplyDisabledEffectOnWidgets=0 to not apply transparency on disabled widgets, but the transparency is still being applied upon children within a** Retainer Box**. Any hopes of my being able to fix this without moving to a source build?
anybody else missing the option to click on the cine actor button to get into the options of it quickly?
as a programmer how much can i get away with actually not creating UI, in the sense of assigning functions in pure cpp and drawing etc, similar to persona workflow per se, creation of buttons, windows similar as to ImGui type of deal but that game ready, as for more context i have a couple of game features that rely on UI to function properly(Strategy Game), show selected units and other useful stuff sleek and functional nothing special and ugly.
If you write stuff in slate, you can stick to C++. It's not gonna be immediate like ImGui, but well.
That said, if you aren't running into performance issues, using Slate instead of just UMG doesn't make too much sense.
You can create C++ class for the UUserWidgets in which you can have native UWidgets and your own UUserWidgets as BindWidget variables. Those will then be automatically linked up with the Blueprint UserWidgets once someone creates a child of the C++ one and creates matching Elements with the type and name.
Is there a way to make a custom widget and have its display text be editable from the HUD it's housed in? I know I could set up a function to change it at runtime or the like, but it would be nice to edit it directly in the editor.
Ah sorry, I mean editable in the HUD blueprint, the way one would edit a regular text widget, rather than a runtime-editable text block. Because the text widget is part of my custom button widget, I don't have access to the text to edit it.
Honestly not sure, I'm pretty new to Unreal's UI systems.
Widgets on the hud are interactable as long as your player controller is set to 'UI only' or 'Game and UI'
Ah, here we go. People had recommended making an editable text property which is applied on construct to the child text widget, but then I wasn't able to compile the HUD blueprint. I did pre-construct instead and it worked fine.
I stand corrected, it compiles but still doesn't allow me to save the blueprint.
Figured it out, it's because I had overridden the accessibility settings in the button blueprint.
ty man
i did some slate shit, but its not looking to good not bad either
but i found this
Yeah but that's UserWidgets again
i dont think it can be involved
Then you are back to the usual flow. Peeps usually only use Slate for the Editor, when performance for a specific part of the UI is needed or if there is no alternative.
Other than that one usually uses UUserWidgets.
You can expose Slate Widget via UWidgets to UMG too fwiw.
i also looked at this but :/ :https://coherent-labs.com/powered-by-coherent-labs/
But the MVVM and CommonUI are mainly meant for UMG.
How about you just use UMG :D idk why you are trying to go around it and making it harder for yourself
well im going now
๐
explored options to not touch Visual scripting ๐
Pretty core part of UE. Gotta use another engine then :D
i think anything can subscribe to the field notifies if i'm not wrong?!
Possibly, but it's still very heavily integrated into the actual BP version of the UMG widget.
And the thing they want to get around is UMG overall. :D
Which isn't even relevant to MVVM in that case.
Youโre not wrong.
The interface supplies an โAddFieldValueChangedDelegateโ function or something similar
Does anyone know if you need to do something special to have a widget recognize touch gestures? I'm trying to implement pinch zoom in a slate widget and it's really strange, the touch gesture event never fires while the touch move event does (with the gesture type always being 'none' in the touch event)
Is there a gesture enable toggle?
couldn't find anything like that
iirc i had to override a enable input focus method to even get input to work on Slate widgets. If you didn't do that, it might be worth to check for that?!
which method is that?
iirc for me it was this
virtual bool SupportsKeyboardFocus() const override; but that was for keyboard input
i have no idea about the whole mouse/touch stuff
Hello everyone, does anyone knows a tutorial or way to Drag and Drop Files from Windows (OS in general maybe) inside the game and basically gets its file path. I am creating a game that will require this implementation.
try to find where it happens in the editor
some elements are in editor only code you'll have to extract and create a runtime equivalent of but other thingies are supported in runtime builds.
probably the ContentBrowser module would be a good place to look for the implementation.
Hey all, I think this has been asked before but I didn't see an answer.
I am trying to use a Retainer Box to apply an Post Process Effect to my HUD only.
The issue is, the Alpha from the Render Texture is wrong, translucent elements in some cases have solid Alphas, or maybe it is hidden elements still rendering their alphas into the texture?
Anyone had a similar issue? as it stop being able to set correct opacity so it can't blend back into the scene correctly.
Are you sure the alpha isn't just inverted?
that is for sure not Slate related at all, and cross posting is against the rules...
It seems you've forgotten to set the thing to fix it
Hi. Is there any global delegate when a new Slate opens - a new Window opens in Unreal Engine?
Don't suggest rewriting a function in a class like PlayerViewport.
Check FSlateApplication
It has the open window functions and any events, if they exist, will be triggered in those functions.
I didn't find anything useful there.
But i check one more time. Thank you!
trying to find why slate prepass is ticking like a monster any ideas?
In the editor?
does the same in standalone
Do you have many nested panels?
I'm surprised slate doesn't have a better breakdown.
i have one nested widget but i put it in an invalidation box, the actual slate process was showing that just cant really find the prepass stuff
If there's no further profiling info, all I can think is to remove things until it steps being silly.
Guys
lets suppose i have a c++ code that fetchs an API
what is the best way to pass this data to a viewmodel that the blueprints are gonna use?
do I instantiate the viewmodels in c++ side and return the for the bp, using manual initialization?
Using the UMVVM base view model object thingie is a good option I think as it allows you to display the info in a UMG widget with very little fuss and no need for any custom code to display updates.
yeah, have some object derived from UMVVMViewModelBase and just pass that to the widget.
tbh if you only have one instance you could also probably make a global view model thingie but I am not familiar with that, NewObjecting a UMVVMViewModelBase derived object is easy enough
If you only have one instance you can register it with the Global Viewmodel Subsystem, which makes it accessible with a "Global Viewmodel Instance" Creation type, but the annoying thing there is that it's basically this weird lookup with a Context object of the Viewmodel's class and a magic string FName.
I'd say have your fetch logic callable by blueprint and have it return a Viewmodel, and then yeah you can set it to Manual creation that wya.
Looking for some help with an unresolved external symbol.
I've got an ordinary DA class in my game's code:
UCLASS()
class UTAbilityTagRelationship : public UDataAsset
I've got a detail customization struct in the editor side which includes the .h, finds an instance of that DA, and wants to call a function on it:
#include "Character/Data/UTAbilityTagRelationship.h"
.
.
void FTGameplayAbilityCustomization::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)
.
.
FGameplayTagContainer OutTags;
MyAbilityTagRelationship->GetRelatedTagsForExactTag(Tag, OutTags)
then I get an unresolved external error for the GetRelatedTagsForExactTag call (which is a real function on my DA class).
I get the sense that this would be fixed by adding another module dependency... but what dependency, and to which .build.cs file?
Unresolved symbol generally/usually means it can't find the cpp implementation of the function, either because it's in another module which wasn't added as a dependency, or because you never wrote it
you're definitely right, if I move the cpp implementations into the .h file, for instance, it does work... newbie question, how do I know what module my .cpp files are part of in order to include it in the editor.build.cs?
do you have a MODULENAME_API macro somewhere? it's MODULENAME
ah! I do, thank you, that was able to fix
another silly question - I'm doing a detail customization to change the value display for some fields in a class. per some advice I'm using Category->AddProperty with my new customized widgets. This seems to change the order that the fields are displayed in from their original layout... is there an alternative to customize the value display of certain properties without changing the order they're displayed in?
can you describe what you're doing a little more detail?
your high-level options are a full customization of the details panel like you're doing, or building property type customizations e.g. for custom structs (think of FVector as a common example)
I was able to find what I was looking for - a difference of using DetailBuilder->EditDefaultProperty(PropertyHandle) instead of Category->AddProperty(). I figure this is the obvious way I was supposed to do that, just had a hard time finding the method name
ah, right on. i don't even think i knew about that one, lol
typically if i know i want some custom behavior for a kind of property i consider making it a custom "type" (struct) and building a property type customization for that struct, which gives me something reusable. but that could often just be overengineering ๐
Will also push attention here.. cause it also fits here: #editor-scripting message
Edit: Solution found in the messages below that linked one..
Does someone knows, how to make part of plugin slate window dock able?
I just want part of the window to be dock able. Found something in source, FTabManager not sure if that is thing to use or how to use it
I am not sure on the exact mechanism but if you use the FAssetEditorToolkit it'll use an FTabManager and all the content tabs will be dockable, this tutorial might be helpful - https://dev.epicgames.com/community/learning/tutorials/vyKB/unreal-engine-creating-a-custom-asset-type-with-its-own-editor-in-c
I am making a small Editor plugin to automate some tasks in UE4, due to limitations of Python. I am wondering how to do layout of the UI without painful cycle of tweaking C++ code and reloading UE4 like every minute
Are you on linux?
No live coding?
there is no live coding with UE 4.27 afaik
I am on Windows
and I mostly did BP with UE, so I don't really know much about C++ / hot reloading / live coding ๐
Ah, diving into slate new to c++ is going to be quite a trip.
4.27 has live coding
Slate is.... Special.
is there a better (easier) way to make layout of the plugin's UI ?
Umg?
I know nothing about what's available in 4.27 cause I've only ever used unreal 5 but other than Editor Utility Widgets which you can design in UMG you can also conceptually make some standard UMG widget and then use it in an editor customization using TakeWidget but if you really want editor only fancy c++ functionality this is almost certain going to have quite a few iterations involved.
Like generally if you're learning slate and editor modifications expecting a few recompilation cycles and some trial and error is par for the course, live coding helps but that's still recompiling stuff, if your testing project is light enough and you're not changing headers that are used in many .cpp files it's really not that bad.
My brain still hasn't grok'd the difference in setting up anchors and stuff in umg vs slate since umg puts the settings in the child and slate you write the darn things under the parent
(Meaning: unless you're very XP, just making a UMG layout will not massively help with making a slate layout)
Conceptually you can make some base c++ widget class with all your function definitions, then make a UMG BP class inheriting it and fully design that fella and then just use the class reference CreateWidget the mofo and TakeWidget the TSharedRef and throw that into your whatever, but really idk
I tried doing these sorta thing once or twice but you still need to iterate and compile, pretty much whenever you want to add a new method, it's pretty miserable
and the unspoken secret is that UMG editor widgets tend to look quite awful and even when epic make them they don't quite look the same as editor slate
yeah live coding edits to classes likes to crash a lot. i felt like i had more success w/live coding if i only added new funcs/vars onto the bottom of an existing class, but that just becomes a mess. you also have to make sure to close widgets in between live codes because changing it while it's in use crashes most of the time too
They're the same settings, but umg just displays the slot settings in the child settings instead of when adding the slot to the parent.
Yeah I know. It still makes it really hard to translate settings from umg to slate
It does help if you then forcefully apply all those settings. The slot stuff being slightly different isn't even the bad stuff. The bad stuff is that the default values differ. So spawning a horizontal box (just an example. Don't know if horizontal boxes suffer from this) in UMG vs Slate without changing any settings on either will result in two different layouts...
Good stuff...
Same for Border.. which does not exist in Slate.. they are just SBox with a Style applied..
...it doesn't use SBorder?
Yeah SBorder definitely exists
Never used it.. 
Maybe because it simply is an SBox with a style xD
๐คทโโ๏ธ possible..
Tested it in the past 30 minutes.. does not seem to be different in behavior..
SBorder doesn't manipulate the size of its contents like SBox does + it has some slate events for handling mouse interactions and stuff
Ah - understand
Can I somehow cover all cases of "Widget is focused that can consume key presses"? I want to skip some debug logic if a player is typing into any form of input box (so not only text box, but whatever else can be typed into, slate-wise).
Currently using const TSharedPtr<SWidget> FocusedWidget = FSlateApplication::Get().GetKeyboardFocusedWidget();, but I'm not sure if that entails a button having keyboard focus for navigation.
Is it a matter of expecting a SEditableText widget as leaf?
Keyboard focus is def covering more than just things one can type into, hm.
It should do. I believe buttons can have keyboard focus. And CommonUI, for instance, definitely works with focus for gamepad navigation.
(and mouse)
Yeah I checked a bit more and Keyboard Focus def doesn't cut it.
That's already "true" for the GameViewport...
Checking for SEditableText is also not enough cause there are multiple widgets that can handle text.
Think I just have to stay away from input chords that can be pressed while typing messages.
On top of that, the console window doesn't seem to be an actual slate window and is handled specifically by hand inside the ViewportClient..
Hello.
Is there a way to override the output of a DynamicSection with another DynamicSection for a UToolMenu?
For example:
UToolMenu* Menu = UToolMenus::Get()->FindMenu("ContentBrowser.AssetViewOptions");
Menu->AddDynamicSection(
"AssetTreePickerDynamicEntry",
FNewToolMenuDelegate::CreateLambda([](UToolMenu* InMenu)
{
UContentBrowserAssetViewContextMenuContext* Context = InMenu->FindContext<UContentBrowserAssetViewContextMenuContext>();
if (Context == nullptr)
{
return;
}
UToolMenu* Menu = UToolMenus::Get()->FindMenu("ContentBrowser.AssetViewOptions");
Menu->FindSection("Test")->FindEntry("Test");
//Do some funny things;
As far as I can see from CallStack, much of the work with UToolMenu in Dynamic Section mode is done in isolation in a separate Temporary Tool Menu, and then The results are merged into one Tool Menu Result. (712 ToolMenu.cpp)
{
TArray<FToolMenuSection> RemainingSections;
UToolMenu* ConstructedSections = nullptr;
for (const FToolMenuSection& OtherSection : Other->Sections)
{
if (!OtherSection.IsNonLegacyDynamic())
{
RemainingSections.Add(OtherSection);
continue;
}
if (ConstructedSections == nullptr)
{
ConstructedSections = NewToolMenuObject(FName(TEXT("TempAssembleMenu")), NAME_None);
if (!ensure(ConstructedSections))
โ is there tutorial how to use Widget Reflector -> TakeSnapshot and use it's navigation debug options ?
โ is there any comprehensive guide on how CommonUI, EnhancedInput and focus works ?
I mean beside docs, the're hard to follow, hopefully somebody can recommend one where somebody figured out how those systems work in conjuction
For common ui, I'd ask #umg unless you specifically have a question about the slate side of it.
Then it's better to ask a specific slate question 9r check the common ui source. It's not that big.
Hey! There is a useful slate compendium here, is perfect if you know what you need explaining, at least to point you in the right direction. But I would suggest taking it a step further and digging into the source code yourself...
https://github.com/YawLighthouse/UMG-Slate-Compendium
A Compendium Information Guide for UMG and Slate in Unreal Engine. - YawLighthouse/UMG-Slate-Compendium
Does anyone knows how landscape mode set these icons #cpp message
I tried to replicate it(I copied parts of the code exactly the same way epic did it) but all I got was a button with text Only, I dont understand how Epic set these icons!!!
It's part of the interactive tools framework.
You set up a command which has an icon set in a style, then add that as a tool to a tool set, which is part of your custom editor mode.
Good luck!
I copied the code from landscape editor mode and i understand it, the only thing i dont understand is the icon, in UE the icon is not set in the command which is kinda blowing my mind let me look for github link of the command they are using
https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorCommands.cpp
UI_COMMAND(NewLandscape, "New", "Create or import a new landscape", EUserInterfaceActionType::RadioButton, FInputChord()); NameToCommandMap.Add("Tool_NewLandscape", NewLandscape);
And?
you said You set up a command which has an icon set in a style, where's the icon style in this command?
In the style class.
this command creates button with text only
where is that
I don't know. Look at the module for a style class.
i think i found out where the engine does it, i always ignored the file because i thought star fucking ship is some UE sample, so i ignored it
who would name a place where editor tool style is a starship !
That'll be the general editor styles, not sure if the landscape editor ones will be there.
it is set there
but i always ignored the search result that had starship because i never thought main editor code would be in a place under that name!
it's in starshipeditorstyle a perfect name to describe code related to UE landscape editor style all the editor styles are set there in the FStarshipEditorStyle::FStyle::SetupLevelEditorStyle
sadly the whole style system feels like an absolute piece of ass
but... it's a thing we've got
like... how come you can define something in FStarshipEditorStyle, and then just read that data from FAppStyle? wtf?
i guess i've never tried reading across from other children styles, maybe there's some inheritance system at play i've never noticed
the whole engine has some nasty stuff but nothing like that like that, this one take the cake, I used to hate the chaotic naming convention inside a single system, for instance it seems like the person who wrote static mesh and the person who wrote skeletal mesh live in different universe there's no consistency in the naming between the two. Now This!
style set inheritance was added in 5.0, with routing changes. Starship is the name of UE5 editor style set
in UE4 if you want editor items you access those via FEditorStyle, for non-editor items in FCoreStyle but it was all unified under FAppStyle.
in UE5 FEditorStyle, FCoreStyle now simply forwards calls to FAppStyle
in UE5 there is a single FAppStyle entry point which points to whatever app-default style set in runtime - CoreStyleSet, EditorStyleSet, StarshipStyleSet which also support inheritance to simplify search. When editor is running AppStyle set to Starship, when game is running AppStyle set to Core, when Program running you can set AppStyle to something else
If you ever need to write engine-agnostic editor code you can use this helper trick
#if UE_VERSION_OLDER_THAN(5, 0, 0)
#include "EditorStyleSet.h"
using FSlateStyleHelper = FEditorStyle;
#else
#include "Styling/AppStyle.h"
using FSlateStyleHelper = FAppStyle;
#endif
FAppStyle is only to read the current style set, if one want o modify the style set - you need to find the ISlateStyleSet and modify it
Gross! Thanks for the info though โค๏ธ lol
When I set style like
Set("LandscapeEditor.NewLandscape", new IMAGE_BRUSH("Icons/Landscape/Landscape_NewLandscape_x40", Icon20x20));
does this have to be in specific format for instance "LandscapeEditor.NewLandscape" to "MyModuleName.MyToolName"? or is it just a descriptive name
It's based on the name of the style I think. Or something like that.
It's not the module.
First you have to look what styleset is this. And slateicon located by pair of styleset-iconname. The first param is icon name, it is free form naming
What to write here if i am making my own style
: FSlateStyleSet(StyleName)
{
//MyPluginContentFolder/Editor/Icons/
Set("What to write here", new IMAGE_BRUSH("Editor/Icons/MyIcon", CoreStyleConstants::Icon20x20)
FSlateStyleRegistry::RegisterSlateStyle(*this);
}```
Do you have a commands class?
yes
You provide a style name as a parameter there.
I think it's that style name . command name
E.g. MyStyle.MyCommand
and what about the Set in my style can i give it any descriptive name or does it have to be specific format
Set("What to write here", new IMAGE_BRUSH("Editor/Icons/MyIcon", CoreStyleConstants::Icon20x20)
I literally just told you that...
Oh so this is for the parameter okay mybad sorry
MyCommandContext.MyCommand is what worked for me
LandscapeContext here
FName FLandscapeEditorCommands::LandscapeContext = TEXT("LandscapeEditor");
https://github.com/EpicGames/UnrealEngine/blob/684b4c133ed87e8050d1fdaa287242f0fe2c1153/Engine/Source/Editor/LandscapeEditor/Private/LandscapeEditorCommands.cpp#L20
the context name you put in the ctor of the command
i have a unique case where i need a secondary UI window and the main window renders the game on a different screen. i'm currently using this plugin
https://www.fab.com/listings/d57cac24-2827-457a-a47d-37e694f57388
it just spawns a new SWindow which works great, but if i interact with any hit-testable UI on that window, it freezes the game on the main window. anyone have any ideas to prevent this freeze?
I need some advice on how to structure these UE5 U.I. asset?
I have a story system that runs 2D animations and a multiple choice dialogue system in a U.I. widget so I can overlay these quickly onto a 3D world. Currently I stream in the asset as they are needed, but all those assets are still present in a single UE5 level and load up when the editor is openned. In the past I actually could not open my UE5 project due to memory issues in the editor. I'm afraid I am going to hit that limit again soon when I merge in the 3D gameplay level.
Any suggestions on how I should structure these assets to not overload the UE5 editor? Is there some way to not have the tool load all these 2D animations and audio all the time?
Video of what I am doing included.
Use soft references?
They are all soft references, but the actual art files are still loaded into the editor, and some of these characters have 1000s of frames.
They shouldn't be loaded when you open the level if you're using soft references correctly.
yeah the game runs fine, it's actually the UE tool that runs out of memory. I had to upgrade my video card to 32gb just to open the file
The editor does have a tendency to keep things alive. But that all gets flushed when maps are reloaded. What's opening all the assets when you open a map?
Maybe that's it, since they are all on one level. Would moving each scene to it's own level and then streaming in the level help with the editor?
I mean when the level editor loads a new main map, sorry. Not streamed sub levels!
I still don't know what's actually loading all of that data when the level opens.
is it when the level opens or is it after you click on too many of those things one by one (whether closing them in between or not)
You don't appear to be playing 50 videos when the map opens.
I was thinking of moving all the 2D frames to unique levels maybe I should go ahead and do that.
He did mention it almost made his maps unopenable before, so I assume map open now.
also feels like kind of a weird UX choice to let someone open up all of them at the same time ๐
Multiple opens was just to help me debug them all, in the game it's one at a time. If I move the actual art over into the streaming levels. And just try playing the scene when the level loads... maybe that will make them not overload the editor. Was not sure if that was the right aproach
You just have to remove all references to a asset and it will be unloaded... Eventually.
no it won'
No?
i mean aside from maybe changing the main map, that i haven't checked
That does it for sure.
i made this silly thing to garbage collect assets so i could debug async loading behavior but... it might be useful for you here, you would just have to mash this silly button once in a while and hope it frees up some memory. it might work for you to hit it in between PIE's for example https://github.com/HomerJohnston/UE-EditorGCButton
Btw, the editor doesn't even load async things in a different thread unless you pass a specific startup flag. It's great ๐
thanks, will check that out. I did get super paranoid once I ran out of memory. Everything is soft reference and was moving towards separating each scene into a level as well. Worst case I could just not load all the levels into the main game until ready to build
Yeah. It's all done in the main thread in editor builds, unless you specifically tell it not to.
Not sure about -game behavior.
This wa a case though, where the editor would not even start up... just complained not enough memory to load the project
that sounds like wrong soft pointer usage somehow then
(you could also have both issues and be getting extra confused by seeing them at different times, the world is your oyster!)
Sadly not the uworld.
O.k. then maybe I'll be good then... I have since made big pass at all most references, was just worried as next week I merge the 3d gameplay into the main file
I want to create a property customization for a uint32 bitflag that allows me to set the individual flags with check boxes rather than the default combo box menu. (See attached VeryHighQualityโข mockup). I've managed to figure out how to create a row for every non-hidden flag in the bitmask, but I'm not sure how to add a checkbox that will set the appropriate flag bit. Slate is still very very new to me; can anyone point me in the right direction with this?
void FJoltCollisionLayersCustomization::CustomizeChildren(TSharedRef<IPropertyHandle> PropertyHandle,
IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& CustomizationUtils)
{
if (!PropertyHandle->IsValidHandle())
{
return;
}
uint32 NumChildren = 0;
PropertyHandle->GetNumChildren(NumChildren);
auto LayerFlagsHandle = PropertyHandle->GetChildHandle("LayerFlags");
auto& LayerFlagsRow = ChildBuilder.AddProperty(LayerFlagsHandle.ToSharedRef());
// The individual flag bits are named using the EJoltCollisionLayer enum as the BitmaskEnum property
// To minimize clutter we only generate rows for values of EJoltCollisionLayer that are not marked as UMETA(Hidden)
// This corresponds to layers that have been set up in the project settings.
auto* Enum = StaticEnum<EJoltCollisionLayer>();
for (int32 Idx = 0; Idx < Enum->NumEnums(); ++Idx)
{
if (!Enum->HasMetaData(TEXT("Hidden"), Idx))
{
ChildBuilder.AddCustomRow(FText::GetEmpty())
[
LayerFlagsHandle->CreatePropertyNameWidget(Enum->GetDisplayNameTextByIndex(Idx))
];
}
}
}
(screenshot of the actual property customization in the details panel doesn't quite match the code because it was taken earlier in the process but it's still illustrative of what I have)
You specifically want checkboxes instead of the dropdown menu?
(You can get that to work with up to 64 bits afaik)
I would add a custom checkbox entry that links to the property and knows which flag it is toggling.
If you want checkboxes.
Yes. This is editor integration for my project that I'm integrating Jolt physics into and
1.) I want to make the workflow as familiar as possible for the rest of the team, and Chaos collision setup uses checkboxes
2.) This is something that designers will be touching a LOT so even though a combo box isn't necessarily high friction it can get tedious to set up once collision layers are filled out
Yeah, then add an SCheckBox which has OnStateChanged (or whatever) which passes the payload of the flag it's changing. If you have no owning outer, it can have a weak ptr to the property in the payload too.
Honestly I can't remember the lifetime of the customisation for storing properties and the like.
This value is just going to live in a UAssetUserData object that mimics UBodySetup so I should be able to rely on having an outer, I think
I mean an outer to the scheckbox that can store the property handle. But if it's just changing a specific uobject, you could pass a weakptr to the uobject in the payload.
void FJoltCollisionLayersCustomization::CustomizeChildren(TSharedRef<IPropertyHandle> PropertyHandle, IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& CustomizationUtils)
{
if (!PropertyHandle->IsValidHandle())
{
return;
}
const auto LayerFlagsHandle = PropertyHandle->GetChildHandle("LayerFlags");
auto& LayerFlagsRow = ChildBuilder.AddProperty(LayerFlagsHandle.ToSharedRef());
auto& LayerFlagsGroup = ChildBuilder.AddGroup("LayerFlagsGroup", INVTEXT("LayerFlagsGroup"));
const auto LayerMaskHandle = PropertyHandle->GetChildHandle("LayerMask");
auto& LayerMaskRow = ChildBuilder.AddProperty(LayerMaskHandle.ToSharedRef());
auto& LayerMaskGroup = ChildBuilder.AddGroup("LayerMaskGroup", INVTEXT("LayerMaskGroup"));
uint32 NumChildren = 0;
PropertyHandle->GetNumChildren(NumChildren);
for (uint32 ChildIndex = 0; ChildIndex < NumChildren; ChildIndex++)
{
auto PropHandle = PropertyHandle->GetChildHandle(ChildIndex);
if (PropHandle->GetProperty() == LayerFlagsHandle->GetProperty() || PropHandle->GetProperty() == LayerMaskHandle->GetProperty())
{
continue;
}
ChildBuilder.AddProperty(PropHandle.ToSharedRef());
}
}
I'd like to indent LayerFlagsGroup and LayerMaskGroup one extra indentation layer. How can I do that? SDetailRowIndent or whatever the widget is called is private within the PropertyEditor module
I got it working!
I have this widget that is like a paint window (a midi piano roll) and I want to keep things modular so it's a slate with a UMG wrapper yada yada, I now want to have another widget that is like a 'palette' it lets you pick which some settings and tools that affect the main widget, now I figured I'd like to have some keyboard shortcuts, what would be a good way to achieve that? when I used asset editors and toolkits I used FUiCommands, would this approach be suitable here as well? just bind/unbind them when I create the widget?
Like what I 'worry' about here is that if I'm focused on the editor just using key pressed events won't affect the palette widget, but reFUiCommands I also probably wouldn't want to react to them when the widget is no longer focused, so I'm not sure about that.
I might also want to intercept Ctrl+Z to implement undo specific to this widget. Part of the motivation is that I also want this editor to be accessible in game runtime, so people could use it not just as an editor thing. Not that anyone is really likely to use it, but stil.
Should probably just experiment I guess.
it's this thing: https://github.com/Amir-BK/UnrealMidiExtensions
Commands would be the way to go, yes.
You could use an input preprocessor to add a "global" keybind.
Screwing around with the editor toolkit's keybinds is just annoying.
how do i get widget element's screen position?
get its tickspace geometry and it'll be on there somewhere.
Absolute position is the position within the window, not the screen, I think?
There's probably some conversion functions somewhere.
i'm using a custom URichTextBlockDecorator class to render images inline with a richtextblock, but I was wondering if theres a way to display the SImage without it taking up line space? so it doesn't shift the text at all and text could potentially be behind the image?
You could probably exploit overdraw to do it. I don't think there's a good way, though.
yeah there really isn't.. i guess i could use a canvas or something and just draw the image overtop seperately
By exploit overdraw, I mean add a zero sized element and use overdraw to draw the image outside of it.
Maybe combined with render transform.
Whether that would appear behind other things is a whole other question.
Will absolutely fail at the end of lines and stuff.
You could use an SOverlay to just put something behind the text and try to align it manually?
Not sure if this is more of a slate question or #materials but I'm trying to get the cursor position in a material. I'm using the UGameViewportClient->GetMousePosition method which returns a local mouse position but the material ScreenPosition > PixelPosition is in the frame buffer space.
It gets tricky when I need it to work in editor, in a popup editor window, and stand alone game. The viewport client mouse is always in a different hierarchy and it's not as simple as converting the mouse from local to absolute coords.
Have you tried getting the mouse position of the viewport, rather than teh viewport client?
That doesn't work in the editor because the viewport is a smaller rect than the editor window which is the space the pixel position is in
It works great in standalone though!
if (GEditor) { do one thing } else {do other thing} ๐ข
This seems to be working!
FSceneViewport* Viewport = ViewportClient->GetGameViewport();
FIntPoint LocalMousePosition;
Viewport->GetMousePos(LocalMousePosition, true);
const TSharedPtr<SViewport> ViewportWidget = Viewport->GetViewportWidget().Pin();
const FVector2D AdjustedMousePos = ViewportWidget->GetPaintSpaceGeometry().LocalToAbsolute(LocalMousePosition);
FLinearColor CursorPosition;
CursorPosition.R = AdjustedMousePos.X;
CursorPosition.G = AdjustedMousePos.Y;
I'm making my first plugin... and this Slate is insanely more difficult than UMG. I did not realize what I was getting into lol.
Any suggestions when you make an SWindow with a title how to really stop the X button from closing the window? I create a title and set the HasCloseButton(false) but like 20% of the time you can still click that close button and then it messes everything up. I can't find a callback for determining that the close button specifically was clicked, either.
Or if anyone could recommend handling close buttons in a more pragmatic way? Basically what I have are delegates that I've bound to with return values, and when the SWindow is created, I write this at the bottom to wait for the values to be input, and then I request destroy the main window from inside the lambdas for the text commits or button clicks and then it returns the values.
FSlateApplication& SlateApp = FSlateApplication::Get();
SlateApp.AddModalWindow(Window, FGlobalTabmanager::Get()->GetRootWindow());
while (Window->IsActive())
{
SlateApp.Tick();
}
return bConfirmedPassword;
I can't seem to find a decent way to call for requesting the destroy of this Window by clicking the X close button in the title
And then naturally the first thing someone mentions to me when I demo the stuff to them is that it would be nice to have a title bar so they can understand better what all these things are doing
I agree with them tho
Manually locking the thread and ticking the SlateApp sounds problematic
There is more stuff that happens during the Engine Loop than that
o this is good to know
Also if I looked better I could've just read that if I set all of those values to false it won't create the close button
No close box, no minimize, no maximize and it doesn't create them. If any of them are true then it creates them