#slate
1 messages ยท Page 18 of 1
ah, nice
I've also found I should do
FSlateApplication::Get().SetAllowTooltips(false);
that saves another 0.031 ms
is there anything else that I didn't know about yet that I can disable for my VR-only game?
cursor updating
obviously I don't care about anything that takes 0.002 ms. what time is cursor updating part of in the profiler?
ah? interesting. never saw anything like that in the profiler
synthesize mouse movement in slate app tick?
synthesize mouse movement is just calling ProcessMouseMove I think?
and that I killed already
im sure there's something
I don't see cursor updating there
or is that not part of "TotalSlateTickTime"?
or is it part of the 0.018 ms "Self" of TotalSlateTickTime?
Yeah slate input runs at the start of the frame
do I need SlateInput?
you need the keyboard part of it
even if I don't have any keyboard inputs?
alt f4 out of the game?
thats not what anyone should do
๐
I need widget interaction components to work, thats all.
they dont go through there so you should be fine
I'm happy that ProcessMouseMove isnt required for them
try killing it
in 4.20 these things should be faster b/c of fast widget path and parent pointers
the bulk of the work is building up the widget path
ok
btw, this stuff:
RedrawViewports
is most of that stuff just because STATs are running?
DrawStatsHUD definitely sounds like its the red text in the top left with the time how long stats have been running etc
is CanvasTextItem Time also that?
hopefully you don't have the stats UI up when you capturing stats
@silent patrol the stats UI is always up when youre capturing stats, I don't think theres any way to disable that in UE4
whenever you type in stat startfile, you get red text at the top left that tells you that youre capturing stuff, for how long you have captured, how big the file is etc
maybe you mean some other stats ui
@silent patrol how?
stat dumpave -root=stat_slate -num=120 -ms=0
captures 120 frames of stats and averages them
is that same like stat startfile and stat stopfile regarding everything else?
should be
ok, didnt know about that command
It's a really good shorthand capture method on idle frames
thanks for making me aware
use it allll the time to optimize
and that doesnt bring up the red stat text?
nope
nice
any good workarounds for UWidgetInteractionComponents clashing with each other because of VirtualUserIndex when doing multiple PIE?
maybe before Activate set
VirtualUserIndex =
VirtualVirtualUserIndex + (GIsEditor ? WorldContext->PIEInstance * [num_reserved_per_pie_instance] : 0));```
@silent patrol is there a better way?
and any danger of running out of indexes? I've got 3 per instance (an interactor for vr left hand, vr right hand, 2d crosshair)
actually it looks like I'm just using one index for all three
with different pointer indexes
ended up with:
// IMPORTANT no auto activate, activation relies on the VirtualUserIndex and
// we don't know that until runtime, not construction time. Need a custom
// VirtualUserIndex to keep PIE instances from clashing with each other.
MC_L_WidgetInteraction->bAutoActivate = false;
MC_R_WidgetInteraction->bAutoActivate = false;
CrosshairWidgetInteraction->bAutoActivate = false;```
in constructor
and
auto ActivateWidgetInteractionComponent = [this](UWidgetInteractionComponent * WIC)
{
WIC->bEnableHitTesting = true;
WIC->SetComponentTickEnabled(true);
int32 DesiredVirtualUserIndex = 0;
if (ensure(GEngine))
{
auto W = this->GetWorld();
if (W)
{
auto WC = GEngine->GetWorldContextFromWorld(W);
check((GIsEditor && WC->PIEInstance >= 0) || (!GIsEditor));
// NOTE WorldContext->PIEInstance will be -1 in standalone game, but GIsEditor should be false and we fallback to 0 offset
DesiredVirtualUserIndex = DesiredVirtualUserIndex + (GIsEditor ? WC->PIEInstance * VIRTUAL_INDEXES_PER_PIE_INSTANCE : 0);
}
}
WIC->VirtualUserIndex = DesiredVirtualUserIndex;
WIC->Activate();
};```
later where I activate
I could see blueprint-only people running into a blocker with this if FWorldContext or some way of getting the pie instance isn't exposed
tested and it works though, so that was the whole issue
This works, but do I need to do more in terms of memory management?
ah yes, the brush problem... Simply declare your brush in the widget then pass it as a parameter
For gameplay programmers writing C++ code.
that way it's pretty sure you don't leak memory since the garbage collector takes care of it on destruction
Roger that, thanks
Does anyone know if I can utilize TCommands in game build? http://api.unrealengine.com/INT/API/Runtime/Slate/Framework/Commands/TCommands/index.html It is classed under Slate so I assume I can. I'm already using them in separate editor module but I dissected larger independent chunk of my codebase to it's own game module and I would like to refactor it to use what is already in engine.
A base class for a set of commands.
You can use anything that's in any module in the Runtime directory, so yes.
Thank you for clarification!
@median basalt I'm curious, what kind of thing are you going to do with them outside the editor?
use them in in game editor, that's the plan
Anyone know of a way of getting the widget under the cursor?
heh, well if you can, I'd appreciate it ๐
I guess I can as it's engine code after all
I found something here that might get me partway there: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/58427-example-virtual-analog-cursor-in-umg-slate-destiny-style
FWidgetPath WidgetPath = SlateApp.LocateWindowUnderMouse(OldPosition, SlateApp.GetInteractiveTopLevelWindows());
For gameplay programmers writing C++ code.
That's basically that
Haven't tried myself, but that's how it's done: cpp FArrangedWidget NGAInputProcessor::GetArrangedGraphPanel(const FPointerEvent& MouseEvent) { FSlateApplication& slateApp = FSlateApplication::Get(); FWidgetPath widgetsUnderCursor = slateApp.LocateWindowUnderMouse(MouseEvent.GetScreenSpacePosition(), slateApp.GetInteractiveTopLevelWindows()); for (int i = widgetsUnderCursor.Widgets.Num() - 1; i >= 0; i--) { if (widgetsUnderCursor.Widgets[i].Widget->GetTypeAsString() == "SGraphPanel") { return widgetsUnderCursor.Widgets[i]; } } return FArrangedWidget::NullWidget; }
np, didn't do much here ๐
@royal geode Have you used LocateWindowUnderMouse much? I'm trying to work out why some widgets that are visible on-screen are not found by this method
Looks like the raw widget that I called AddToViewport on is found, but any children that are added subsequently (e.g. AddToVerticalBox(UWidget)) don't register
Looks like SBorder responds but not other types... this is weird :S
well
have you used the widget reflector
if a widget is marked as HitTestInvisible, im pretty sure mouse queries wont work
check their visibility
@toxic dove That was my first guess too. I've used the Widget Reflector and yeah it's all SelfHitTestInvisible in the parent list, and then Visible
dig into engine code
SelfHitTestInvisible turns off hit queries for that widget alone
HitTestInvisible turns it off for that widget and all child widgets, regardless of the child setting
(just in case someone wasn't sure)
Thx!
Yeah that was the first thing I checked, @craggy holly but even widgets not set to HitTestInvisible seem to be skipped
It might be that they're inside a parent widget that's invisible
Hey guys, can you recommend me some links to start learning slate? I'm interested in extending the editor.
@silent patrol @trim kestrel in 4.20 comboboxes have stopped opening in UWidgetComponents
I've tracked it down to:
SMenuAnchor::SetIsOpen```
within that it calls:
FSlateApplication::Get().GeneratePathToWidgetUnchecked(AsShared(), MyWidgetPath);
if (MyWidgetPath.IsValid())```
and the widget path is invalid
it works in PIE, but not in standalone
I looked through GeneratePathToWidgetUnchecked and it calls FSlateWindowHelper::FindPathToWidget which seems to have had a lot of changes in 4.20
and in there it checks against GSlateFastWidgetPath and does different logic depending on it
I tried setting Slate.EnableFastWidgetPath 0 on the console and it fixes the UWidgetComponent combobox behavior in standalone
There is also a bug that Slate.EnableFastWidgetPath will initially report zero when queried on the console in standalone, even though the underlying global is set to true
hmm
I'm getting some suuuuuper bizarre behaviour here on 4.19.2. Widgets that react to the mouse, have correct visibility settings etc. are not being found by LocateWidgetInWindow. I'm trying to work out if they're even being added to SWindow::HitTestGrid right now. Is there any reason why widgets might be interactable but not found by LocateWidgetInWindow, or not added to HitTestGrid?
I just put in one for it, Case # 00021980
I found what the problem was. I was trying to check whether the mouse was over a widget owned by my UserWidget, but doing the checking during same UserWidget's NativeTick, when the UserWidget has not yet been painted, and so isn't in the hit test grid.
So I guess I need to move my checks to some kind of post-tick. Maybe something I have to create myself...?
I'm trying to work out whether an SWidget is owned by a particular UserWidget of mine. But there's no way of going from SWidget to its parent UWidget, it seems?
I tried checking the Tag on the SWidget, but it seems I can't set the tag on the SWidget after its construction
So is it just lines that do not anti-alias correctly? Or does it apply to other draws as well? Cause right now if I turn on anti-aliasing for lines they straight up blur into nothing... that a common thing?
Does DrawLines draw a line from the last line to the first line at the end or something?
how long would it take for me to get skilled with c++ ? I made something with blueprints that is actually UI, and i thought it would also be cool to replicate it in C++ (slate) some day, as that seems to be the right way & i guess it would be a bit lighter? No idea, pls lmk. Would it be worth it? I've always wanted to learn c++ but its just way more difficult than learning blueprints. There aren't as many tuts and its way more complicated/spaghetti than blueprints.
What i'm basically asking is.. in what case would i need to learn/use c++ ?
If you are using Unreal, learn unreal C++. There is no reason not to, and every reason to do so. Im not saying stop using blueprints. Sometimes a blueprint shaves development time and the performance difference (which is minimal these days with nativization) isn't always a concern. Now the question of whether you should learn unreal c++ for the UI, im 50/50 on. Part of me says UMG is perfectly fine and makes sense over using Slate counterparts. Another part of me says if your UI is during gameplay, then Slate is the better option.
@strange topaz
but how long would it take? can it even be done? I keep thinking that i wont make it all the way thru and learn c++ and that just kills my motivation. Plus i've been really busy with blueprints. If i start c++ i wont be able todo anything, which means until i learn c++, i will not be developing anything.. so i dunno. I feel like learning c++ only if i have to, and so far i don't see a reason. There hasn't been a limitation with blueprints, that would make me think of c++.. so i keep thinking of learning c++ in the future but always just have no plan about when. ๐
its normal that you dont see why you'd need C++
you just dont know enough to know better
So @strange topaz - C++ isn't "the right way" or "lighter". It's a more technical approach that enable developers to extract additional performance when they need it, and when they have the skills to do it, but if you're at a learning stage, C++ is going to cause more issues than it will solve
My personal top reason for doing mostly C++ is that it's a text file I can version, diff, read on a phone from my bed and update without fear of never be able to come back
Being text-based is a huge thing for long-term maintanability
Now if C++ terrorizes you and you are comfortable working without it, then keep working like that
You might need to learn some C++ at some point for some obscure feature - when that happens, take it slow, make sure to understand everything, don't rush it
Just don't go into saying "I need to redo it in C++ because it's better"
blueprints are also disgusting to debug with
its a maintenance nightmare
even with the new blueprint debugging callstack and watch window imporvements in 4.20
@bleak tapir yes. You define a series of points and it draws all lines between those points.
Also, my approach for UI - write the classes and code in C++, then use UMG to actually subclass and design the widgets. Best of both worlds IMO.
that is how it is intended
@silent patrol Hello Nick, have you experienced some rare scroll box stucking when using touch ? We are experiencing it quite often in our project. I tracked it down to some weird behavior when scroll box losts capture, however it does not lost it by usual way (OnTouchEnded()) because this function is also reseting bTouchPanningCapture variable to false. Sometimes it losts capture but bTouchPanningCapture is still true, so scroll box ends up in stucked state because new scroll requires capture to be false and also bTouchPanningCapture to be false. Sadly, no good repro steps, as it is usually replicated during crazy scrolling ,window switching and scroll box content updating. Easy (maybe hacky, not sure), fix would be setting bTouchPanningCapture to false in OnMouseCaptureLost(), however I can not really do it in subclass, as it is private.
There is probably some other way by which can widget (scroll box) lose mouse capture which scroll box is not expecting
Hey
Yeah it should get cleared in capture, but it's trickier than that I think, as it's actually not recording enough information i think
it needs to ensure that the pointer losing capture was the one that started the trigger
each finger can hold capture independent of the others
Ah, I see. Hmmm, so if I understand correctly it should be better to remember pointer on capture and then check against the remembered pointer when we want to end interaction, right?
but yeah, there is not enough information to do that in OnMouseCaptureLost(),
if you're looking to hack it up, you can use the #define private protected cheat
at the top of the Cpp
just make sure to undef it at the bottom hehe
hahah, yeah, thanks for help. I will see what I can do. Maybe I will endup just copy pasting whole class :)
@silent patrol is it possible to prevent map preloading on app startup until the splashscreen video completes? if so I can't find it under FLoadingScreenAttributes
Just create an empty map and load into that instead
That's what I do usually, just have an "Entry" map that takes almost no time to load
Then load the actual start level when startup movies have finished, usually main menu
its fine, i figured out the hitch i wanted to avoid and fixed that
@toxic dove what'd you do to fix the hitch in the startup movie? have a similar issue on a project
it was just the GameInstance that had raw asset references so it was preloading the packages
dumb spaghetti BP
might actually be the same issue for me, ill look into it thanks
you can look at the asset's size map, it was an issue with a BP cast in the game instance, this hard references the BP, which can be bad if it has other hard references, and so on.
hard references to assets (textures, meshes, etc.)
Hey guys, does somebody know what this means please? UI is almost UMG only
LogOutputDevice: Error: Ensure condition failed: BrushResource->DrawAs != ESlateBrushDrawType::NoDrawType [File:D:\Build++UE4+Release-4.19+Compile\Sync\Engine\Source\Runtime\SlateCore\Private\Rendering\ElementBatcher.cpp] [Line: 261]
This should have been filtered out earlier in the Make... call.
happens when scrollbox and its content finish hide away from screen in animation
sadly, nothing there is nothing really useful in debug mode
look at the callstack and inspect what widget is firing this
PS: an ensure is not fatal though, so your game will not crash if this happens
hey, guys, I've created my IDetailCustomization class with all the layout etc..It's all registered in module StartupModule and paired with my UObject class..So far so good. My question is, how can I now display this in the tab? In Content [] ??
I'm using Editor Toolbar Button plugin layout
@flat panther You want to create a details view widget?
@flat panther I don't know what it meant by displaying in the tab, but you can get the details widget by creating a widget derived from SSingleObjectDetailsPanel and use your object class as the return value of its GetObjectToObserve method. And, you can put it literally anywhere in the editor, you can add it to your own custom window, or you can let it be part of unreal editor by adding it in your own docktab
SSingleObjectDetailsPanel will automatically apply the customizations that you've made for the observed object
This is what I want to create and this is the tab I mentioned. On the documentation I read I need to create child of IDetailCustomization It's also used on many places in Editor..
Yes, if you create new plugin, you see it's derived from FModeToolkit and there is the function Init There is all slate code included, therfore my question, how do I put there my IDetailCustomization object ?
I guess registering your own custom tab spawner in mode toolkit will add the doc tab in that toolkit
because it is the mode window
The plugin creates all the tab window and also some demo code
SAssignNew(ToolkitWidget, SBorder) .HAlign(HAlign_Center) .Padding(25) .IsEnabled_Static(&Locals::IsWidgetEnabled) [ SNew(SVerticalBox) + SVerticalBox::Slot() .AutoHeight() .HAlign(HAlign_Center) .Padding(50) [ SNew(STextBlock) .AutoWrapText(true) .Text(LOCTEXT("HelperLabel", "Select some actors and move them around using buttons below")) ].....
like this
this is working well, I need help with displaying my own IDetailCustomization class in it
oh, then just use SSingleObjectDetailsPanel
oh, I'm lost ATM..there is so many ways doing something..
I was following this and it's used almost everywhere in the engine
details customization is to customize the details panel
which is the details of an object
SSingleObjectDetailsPanel is the container of details view of an object
the details view is generated via many customizations in the editor, including yours if you make one
but this is not an asset editor, just an object details panel
project settings is a good example of a details panel, it is used to display the CDO of project settings class
ok, what I want in general is to have this nice categories with header and arrow on the left, and I want to show/hide content if I click the arrow. There I want to use my own slate layout
hmm.. let me get something clear, does it has anything to do with a UObject? if it is then do it in your own IDetailsPanel class, it has a lot of limitations but it's easy to use
if it's not, then just create you own widget
Both of them..but how can I create this functionality in pure Widget?
everything related to UI is possible using slate ๐
You can make your own details panel if you want to
I didn't notice it's there ?? Like I can't create this funcionality via SNew? right?
PropertyEditorModules automate the creation of this widget for you
SNew is special function to create a widget
Widget has A LOT of macros (slate_args, slate_delegates, etc.) and it simply can't be created by using the c++ new function
it has its own flow of constructing the widget
understanding Slate was super hard for me at first, due to the lack of documentation, but now I can create almost anything I can create with other ui tookit (wxwidget, qt, etc.)
except for convenient dialog panels like FileBrowser and stuff
UE decided to use the system's native dialog for that, but they do provide an interface to opens up and querty this native windows
well, I gtg, good luck with whatever you want to do ๐
thanks for your time
bool UWidgetInteractionComponent::PressKey(FKey Key, bool bRepeat)
{
[...]
if (bHasCharCode)
{
FCharacterEvent CharacterEvent(CharCode, ModifierKeys, VirtualUser->GetUserIndex(), bRepeat);
return FSlateApplication::Get().ProcessKeyCharEvent(CharacterEvent);
}
return DownResult;
why does having a char code elide the DownResult?
docs say PressKey shouldn't even do the ProcessKeyCharEvent and you should use SendKeyChar for that?
shouldn't it at least be:
if (bHasCharCode)
{
FCharacterEvent CharacterEvent(CharCode, ModifierKeys, VirtualUser->GetUserIndex(), bRepeat);
return DownResult || FSlateApplication::Get().ProcessKeyCharEvent(CharacterEvent);
}
return DownResult;
}```
does anybody have an idea how I can programmatically set the focus to an editable textbox widget?
worked like a charm ๐๐ผ thanks @royal geode
FYI, all I did is Alt Shift S + SetFocus @warm vault ๐
Actually I searched smthg like slate Set Focus
Then Alt Shift F on SetUserFocus
To see if it was used
oh ok
And somewhere there was FSlateApplication::Get().SetUserFocus
didnt know about Alt Shift S
rly
its better than Ctrl T
Damn
i was using Ctrl T xD
You know Alt G?
now I do
hello! Can I get information in the moment the level is opened/loaded?
the 2nd question is how can I focus to actor in the level ? Like if you press F ?
you can get the current World, maybe that helps
and the stuff about focusing is teached in https://academy.unrealengine.com/Learning-Extra/Viewer Template
btw, does anybody know how I can define a detailcustomization not just for one class, but for all its subclasses too?
currently, the details for a subclass is added on top of the details for my base class
@warm vault thanks. I can take a look at World..About the focus, I don't want to focus at runtime, but in Editor ( from my plugin ) when I click on SButton I want to focus to Actor ( like when you press F )
then I guess you have to dig into the code
I would search for EKeys::F, there shouldnt be too many occurences
only as many as there are bindings
this is nice ^^
going to try this
UI_COMMAND( FocusViewportToSelection, "Focus Selected", "Moves the camera in front of the selection", EUserInterfaceActionType::Button, FInputChord( EKeys::F ) );
looks like you found something related
๐
I found this
"D:\Epic Games\UE_4.20\Engine\Plugins\Editor\MeshEditor\Source\MeshEditor\MeshEditorCommands.cpp(108)": UI_COMMAND(FrameSelectedElements, "Frame Selected Elements", "Moves the viewport camera to frame the currently selected elements.", EUserInterfaceActionType::None, FInputChord(EKeys::F));
ok I kinda bruteforced my way, but I found a way to customize the details panel the way I want to
I found 2 ways in case someone is interested
GEditor->MoveViewportCamerasToActor (a[0], true); // a[0] is AACtor*;
or
GoHereAction.ExecuteAction = FExecuteAction::CreateStatic(&FLevelEditorActionCallbacks::GoHere_Clicked, ClickLocation);
GoHereAction.Execute ();```
the first one probably does more than you want to (it seems to set the cameras of all viewports)
anybody have an idea how to control the clipping of a textblock when there is no space left?
i want to display ellipses: ... if a word is too long,
not really...there is 2nd argument which force focus on active viewport only
to the topic above. you can create 2 horizontal boxes with the actual text and text containg ... that shows up once the text is too long ?๐ค
good idea
but that would require knowing the size of the text before its being rendered
there are already helpers for shortening text with an ellipsis
i forgot what it's called. take a look at the Editor - it's used in several places. then use Widget Reflector to find the widget code.
there are also functions to measure the size of a string in pixels
i will look into it, thx ๐ but I never noticed that the editor shortens text with an ellipses, on the contrary, I only remember that it its lacking that feature ๐
and I cant find any example of shortened texts right off the bat
btw @earnest gyro i watched your plugin tutorial on academy.unrealengine.com and it was really great ๐๐ผ helped me to start customizing the editor and now I have done quite a bit just in a few days
nice, i'm glad it was useful. i had a pretty bad cold when we recorded it. we had to redo the second part.
let me see if i can find that ellipsis code
it was super useful ๐๐ผ yeah I think your voice was a little strange in some videos ๐ค i think the audio for one of them was even recorded afterwards. At least, the audio and and your lips werent in sync ๐
ok, it looks like you're right. all the ellipsis stuff in the code base is based on string length. however, there is one example that uses string measure: FGameplayDebuggerCategory_EQS::DrawDetailedItemRow
take a look at the for-loop near the top of that function
it first measures the string and then, while it is too long, it shortens it by one character and then measures again
you could probably optimize that, i.e. by doing a binary search
if you use a monospace font, then you could calculate the width directly
found it ๐ looks rather simple, to be honest. I will only have to figure out how to get a UCanvas, but a default instance would probably do the trick?
thanks a bunch ๐๐ผ
might be worthwhile checking out what UCanvas does under the hood. there might be some low-level helper function that you can use directly
yeah but unfortunately the editor does not use monospace fonts, and I dont want to enforce it ๐
for arbitrary fonts, binary search is probably the best approach. if your strings are short, linear search is fine, too
they are just names, so it doesnt have to be efficient ๐
UCanvas::MeasureStringInternal is being used under the hood, but I think not using functions nested that deep will be easier to use
surprisingly, that function is public xD
you would expect internal functions to be private
never xD
Haha. Yeah, celebrate, write a bunch of code, then bang your head on the desk when linking fails because it turns out the function wasn't exported.
My usual approach ;)
yaeh
but maybe one can just submit a pull request to expose such stuff
i dont see why not xD
Absolutely. Helps if you really like waiting, though.
i dont think accepting pull requests that only expose stuff will take so long ๐ค
Last I checked (which was a while back because I lost interest), there was a backlog of PRs months long that hadn't even been reviewed.
It had been getting longer and longer for a while, at that point I just gave up even thinking about submitting any more.
How do I use widget reflector with invalidation box? According to the docs it should show green red and yellow borders around widgets but nothing shows up. Do I have to take a snapshot or something?
Also did I misunderstand invalidation box? I thought it disables paint calls on widgets all together unless I invalidate the widget or set it to volatile
There is button or some checkbox named something like debug invalidation or debug caching, on top of widget reflector
orange one
Yeah i used that one, but I don't see anything happening
Try to enable both Invalidation Debugging and Widget Caching
how to add custom folder at ContentBrowser
at the path view of it, there are Content, C++ Classes , Engine Content, myCustomFolder
Content
C++ Classes
Engine Content
myCustomFolder
I want to add a root folder at the path view at the left side of CB
why would you need something like that? Plugins have custom root folder automatically, so if you are making plugin it is available for you. If you are making game then it belongs to game folder. If you are doing some engine stuff then you are going to use engine folder.
any one is familiar with SListView? the OnItemScrolledIntoView Event does not work
what do you mean it doesnt work? how did you set it up?
hey guys can i have some help with my UI i am working on a main menu and for some reason the button multiplayer works when i press it but when i select settings it comes up blank for example
Is there a function like FSlateDrawElement::MakeLines that allows for rendering material/textured lines? Looks like MakeBox takes a SlateBrush...
@mild oracle maybe take a look at how the splines in the Blueprint editor are implemented
@earnest gyro Good idea! Do you know where that might be? I've seen FSlateDrawElement::MakeSpline
I don't know where it is exactly. Probably buried somewhere in the lower level graph editor code
there's one in the CurveEditor widget OnPaint
i think the curve editor lines are not textured though, so it may not be what he's looking for
worth a look though
I see
for the graph editor, you can use the Widget Reflector to find the code for the blueprint editor, then dig down deeper from there
blueprint editor is built on top of graph editor. the line drawing stuff is probably handled in the lower layers
it's been a couple years since i looked at it
Curve editor uses MakeLines yeah
Poking around in GraphEditor I've found stuff about pins and nodes but nothing about edges, connections, lines, or anything else
Using WidgetInspector doesn't seem to work on the lines either
There is an effect when you hover an exec node that makes the lines thicker so they must be using something...
ok found it, it's in FConnectionDrawingPolicy::DrawConnection, it calls FSlateDrawElement::MakeDrawSpaceSpline
It lets you choose the thickness but that's about it
๐ฆ
@mild oracle There is a custom slate element that lets you implement an interface and draw anything at a lower level. That should let you do it, but it's a fair bit more work and requires a lower level knowledge of the code.
@limpid atlas Oh interesting, do you know what any of it might be called? I'm looking at SWidget...
Start with ICustomSlateElement
Hah, I was about to link you to a plugin of mine that used one as an example. Then I realized it was probably you that posted the question on the forum thread? https://github.com/kamrann/KantanCharts/blob/develop/Source/KantanChartsSlate/Private/Charts/CustomDataSeriesElement.cpp#L16
uh-oh ๐
Yeah I posted there earlier today
I'm looking into how to make nicer-looking line charts for player-facing stats
oh wow the code in DrawRenderThread there is really useful, I never would have been able to work that out myself. So that's how you do low-level rendering
Well, word of warning - that's how some engine code that I found about 3 years ago did some custom slate drawing. I suspect the approach that it used (with the FSimpleRenderTarget class, also in that plugin code) was far from optimal even back then.
But it seemed to work okay. So depends on your requirements I guess as to whether that's good enough.
I've no doubt that drawing directly onto the main render target would be more efficient, but for some charts it's probably not super critical anyway.
hmm looking at that func more it still seems like you're passing in points and a size. But maybe I can use this same thing to render some custom polygons to make textured curves/lines
Yeah in that example I just used a canvas to draw some stuff that couldn't be done using regular slate elements. For your case, I'd assume you could use the RHICmdList parameter in the DrawRenderThread override to draw lines/triangles with a material.
Though I don't know exactly how. If you can somehow get a reference to a FPrimitiveDrawInterface or similar, then you'd be good. I don't have any experience with the FRHICommandListImmediate class though.
oh thanks for the tip!
I remembered now there's something called SMeshWidget, maybe I can refer to that
Yeah that would be a good move I think. It's a bit newer, and not so long ago I asked Nick Darnell about that custom element code due to some clipping issues, and he suggested to look into the mesh widget.
Thanks again, I think I have a bunch of stuff to investigate now ๐
I wonder if I could use SMeshWidget to make a UMG/Slate-space particle system
Hello! I've been searching (without success) for the name of the resizable scroll bar used in the bottom of various keyframe panels throughout the UE4 Editor. I want to know if the element in question is simply called "scroll bar" with some additional parameters or a different type of UI element entirely. It's different from other scroll bars because it has 3 movable buttons, 2 to resize the button in the middle and the middle one is used like a regular draggable scroller
To be clear, I just need to know how a UI designer would call such a UI element. I don't need a class name or any specific string.
@warm vault Tried the widget reflector yet?
@royal geode nope. Why?
To get the name of that widget?
I didn't know there was such a thing
I'll give it a shot
Apparently it's STimeRangeSlider. Not the answer I was hoping for :/
Or rather, the element as a whole is unnamed in the Editor. A "range slider" in itself isn't a scrollable element. It's missing the middle draggable element
Again, I just want to know what a UI designer would call such an element. Does anyone know any source (book or web page) with listings including such advanced elements?
Anyone any experience with getting SScaleBox to behave?
The thumbnail is in a scale box set to fit with maintained aspect ratio (square image), getting 30% of the width.
But the scale box still requests the full height of the underlying thumbnail even though it's scaled it down, so I get the big borders above and below...
lol
you probably need to fit it into an SBox @limpid atlas
or maybe SSizeBox, i am not sure
i know that with SBox you can override the width and height, clipping the contents if they are too large
if you use a SScaleBox to scale it to the overriden width and height it should solve everything, I guess?
but I would be interested in the solution as well
I did try messing around with SBox, although it was kind of random experimentation. I'll look into SSizeBox, forgot about that one.
Seems weird though that SScaleBox wouldn't adjust its own size based on how it sized its contents.
ikr ๐คท๐ผ
inside what did you place your SScaleBox before?
use cases I found in engine code all indicate that you need to contain the scale box in a widget which determines the size. then you just create the scale box like this
SNew(SScaleBox).Stretch(EStretch::ScaleToFit)
to scale the contents of the scale box to the size/dimension of its parent
Hmm, yeah it's possible that it's a limitation I guess, that it just doesn't work properly if it's supposed to determine its own size.
In the above case, it's in a horizontal box, with fill ratio of 0.3. So the parent is giving it its width, but asking it what height it should be.
Thinking about it, if I can't get it to work I could probably just do a custom implementation.
i dont think its a design limitation. one could compose the scale box out of two nested widgets, one for size and one for scaling...
I think its just a design principle that each widget is only for exactly one purpose
hey, I'm trying to remove item from SList array and got an exception thrown at
// Last shared reference was released! Destroy the referenced object.
ReferenceController->DestroyObject();
My idea is to remove the item from this feeding array and then do RequestListRefresh
Is this correct approach or how am I supposed to remove an item from slist?
Update: It's working, just had TSharedPtr to AActor insted of AActor* in the struct that was a row in the SList...
Wait, what?
TSharedPtr<AActor> is absolutely not valid.
You can't mix and match reference counting with garbage collection.
Yes, therefore it was not working. As I'm learning the slate in the late evenings I just made a mistake ๐
use TWeakObjectPtr in your struct
especially if it's an actor
if you keep it strongly referenced, if the actor is destroyed, the object can be alive in memory but the actor could be invalid, you will run into problems with this
@toxic dove yes, it's an actor in the level..If I press the button on the SList row, I delete the actor and delete the row too ( my struct holding AActor* and FText ) I'll try TWeakObjectPtr - it sounds exactly what I need
Thanks
Trying to understand IDetailCustomization . I've everything prepared in my own DetailCustomization, I've added categories , etc... DetailCustomization is registered in StartupModule...Now the question is, how can I display this in some widget?
void SAHTestWidget::Construct(const FArguments& InArgs)
{
ChildSlot
[
SNew(SBox)
.VAlign (VAlign_Top)
[
// HOW ???
]
];
@flat panther Need to load the PropetyEditor module interface, then call CreateDetailsView.
hm but detail view is TSharedPtr<IDetailsView> and I've TSharedPtr<IDetailCustomization>..Am I missing something?
FPropertyEditorModule& PropertyEditorModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
FDetailsViewArgs DetailsViewArgs(false, false, false, FDetailsViewArgs::HideNameArea, true);
DetailsPanel = PropertyEditorModule.CreateDetailView(DetailsViewArgs); // .h TSharedPtr<IDetailsView> DetailsPanel;
now I suppose have DetailsPanel and need to put the content of the IDetailCustomization somehow?
If you've registered your customization, it will be applied automatically if you assign an object of the type you registered it for to the details panel.
After creating it, you need to call the SetObject method.
ok, I see, it's working now ๐ thanks
Hey guys, does anyone know a good or didatic book/tutorial/learning documentation for someone who knows nothing about Slate, please? I want to learn how to create an editor window for a custom asset, but the few material available are giviving me a hard time (deprecated, no starting point, not for begginers, terrible explanations when there is some, etc.). Thank-you very much.
I don't think there are any such materials, @warped pebble
the best option would be to dig into the Editor account and learn from that
as for tutorials, the closest I can think of is a blog post I wrote last year:
that should get you started with new assets, and it also shows how to create a simple asset editor window
there's also a video tutorial on plug-ins that covers some of this stuff:
I also have a two-part high-level overview on Slate:
@earnest gyro Actually your tutorial is exactly how I manage to create my custom asset so far, thank-you by the way, it's the only good one I could find and a secondo part would be great. I'm watching your class in Unreal Academy too, but still having trouble to open a custom editor for my custom asset, probably because of my own lack of knowledge ๐ . I'm reading about editor toolkit now. Thanks.
yeah, it's relatively easy to get started with custom assets, but it can get complicated quickly, depending on what you're trying to achieve
my recommendation is to following the tutorial, get a simple asset up and running, and then look at some of the other existing asset editors in the engine
if you know the basics, it will be easier to follow the more complicated stuff
Yes, I'm trying to follow this path. Thank-you for the help.
I still need to fill out the slate part of my tutorials on http://benhumphreys.ca/unreal/ there's not enough there yet
ohhhhhhh
@mild oracle That's a nice website, created using manual html/css?
Or some kind of tool
Thanks!
In my widget, I need to get callback once the level is loaded and populate my list with specific actors from level. Where is the best place to subscribe to such a event? In the SCompoundWidget ? Also checking in Paint is I think a bad idea, right? And speaking of the callback, I found FCoreObjectDelegates::PostLoadMapWithWorld . What would be your approach?
What would you guys say on making some public funding for 4k monitors for Epic devs? I guess that would finally fix all those DPI issues. :D It's getting boring that new DPI issues are introduced almost every version.
What kind of issues @ancient wigeon ?
In 4.19 you needed to click about 200 pixels (depending on the dpi) away from actor if you wanted to use on clicked/on touched event.
In 4.20 it probably works but now all screen space widget components have offset (ignoring DPI)
so deprojection world -> sceen is not respecting it
@warped pebble just download the TextAsset plugin from github and view the code as everything is explained the UE academy videos. I managed creating my own asset editor just by taking that plugin and replacing everything with my own code. doing that will also help you understand the effects of every code line. you should also slowly get used to read/navigate the engine source code this way, which should help you in creating a lot more advanced stuff just by copy-pasting engine source code.
@warm vault Yes, I did that ๐ . I succeed to create a custom editor for my asset reading the plugin source code. Thanks for the help.
"Cards Assets" (for card game) and a "Visual Novel Dialog Asset"
i see
Hey! Please, how can I add in custom property layout featrure you can see in default regular AddProperty layout you see on the top and bottom?...Can't figure it out
@flat panther Have you seen NameContent() and ValueContent()? Searching online or in the editor's codebase might help for that
@mild oracle yes, I've noticed that earlier but was not aware this has sometehing to do with that "moving divider" stuff.. Will take a look at this....
Hey guys, So i have a problem where when I change resolution in fullscreen, or if im changing from windowed to fullscreen, sometimes the gamewindow will crop down to quarter the size of the screen and be up top left corner. Also sometimes it completely is tabbed out and im unable to get it back up again. Anyone who knows what it could be? im using ue 4.17
yeah, ben is right, there are two slots called nameContent and ValueContent, you need to place your widget inside these in order to have them rendered properly
nice, thank you. work like a charm ๐
Anyone have a clue why when i change the variables for a UMG that is wrapping a custom slate widget that it updates fine in real time with synch props but when i hit umg compile it defaults too the slate widgets default variables
are you maybe resetting them in the slate widget constructor
compile destroys the slate widget and makes a new one
I dont think so
im doing what all the other slate widgets are doing
so idk wtf is going on
anyone knows how is it supposed to use FSlateDrawElement::MakeCustom or FSlateDrawElement::MakeCustomVerts for drawing polygons on slate?
int32 TestCustomVerts(const FOnPaintHandlerParams& InParams)
{
const float Radius = FMath::Min(InParams.Geometry.GetLocalSize().X, InParams.Geometry.GetLocalSize().Y) * 0.5f;
const FVector2D Center = InParams.Geometry.AbsolutePosition + InParams.Geometry.GetLocalSize() * 0.5f;
const FSlateBrush* MyBrush = FCoreStyle::Get().GetBrush("ColorWheel.HueValueCircle");
// @todo this is not the correct way to do this
FSlateShaderResourceProxy* ResourceProxy = FSlateDataPayload::ResourceManager->GetShaderResource(*MyBrush);
FSlateResourceHandle Handle = FSlateApplication::Get().GetRenderer()->GetResourceHandle( *MyBrush );
...
}
Also, why the only code example i was able to find, use an not correct way of doing things? Are there some usage example with the correct way?
does anyone know how to register a FDesignerExtension to UMGEditor?
Does anyone know why splines retain some sort of same thickness when you zoom in and out of the editor?
probably because it doesn't scale the width
well i mean
when u zoom out in the umg editor
they get bigger
as if they are ignoring some sort of screen space
or something
Its only in the UMG editor though
Boarder images do the same as well in the umg editor
Oh yeah i guess that would make sense
Does anyone know how a slot could get removed correctly from a UPanelWidget but not the underlying child of the SConstraintCanvas?
I have a UUserWidget for my HUD that is hidden using RemoveFromParent() and then when I show it again using AddToViewport() it seems to be recreating a widget that was destroyed while it was hidden.
So my HUDWidget has a UCanvasPanel* IndicatorPanel. And while the HUDWidget is hidden via RemoveFromParent(). I also am removing some of the children widgets of IndicatorPanel via RemoveFromParent()
The slot that is holding the child widget is removed correctly. However, when I re-show the HUDWidget with AddToViewport I end up with an extra child on IndicatorPanel->MyCanvas that is slot-less
are you adding a widget at runtime (in the Construct)?
I am creating the widget at runtime. Character::OnRep_PlayerState -> ... -> CreateWidget and IndicatorPanel->AddChildToCanvas
But these aren't hit an extra time or anything
The widget I'm working with here is an above head nametag
When the player presses tab it shows a scoreboard and hides the HUD
If a player kills an enemy, the nametag is destroyed
If a player kills an enemy while the scoreboard is up and releases tab to hide the scoreboard (and re-show the HUD). Then I get an slot-less nametag that is stuck on screen
The slot-less nametag doesn't get created until the player releases tab tho (which calls AddToViewport on the HUDWidget)
It seem that this is the chain of events AddToViewport -> AddToScreen -> TakeWidget -> TakeWidget_Private -> RebuildWidget.
And the parent/child hierarchy is
HUDWidget -> IndicatorPanel -> Nametag
For some reason it is rebuilding the nametag that was destroyed while the HUDWidget was hidden
And by "destroyed", I mean calling RemoveFromParent on the Nametag
RemoveFromParent will call the Destruct
it will also call remove on its children iirc
you should break into the Destruct and Construct of your UI (the scoreboard?) and watch the container that contains your rows of nametag widgets
it sounds to me like your logic just needs readjusting for it to behave the way you want
would be easy to configure out
The nametag is on the HUD. It is the name that appears above a players head. The scoreboard doesn't really have to do with much. It's just when I hide the HUD (to show the scoreboard), kill a player, and then re-show the HUD. It is re-creating the nametag widget that was destroyed while the HUD was hidden
And I don't know why
we dont have to know about your logic
simply debug your UI by placing breakpoints in the destruct/construct and data breakpoints in whatever panel widget contains your nametag widgets
"It is re-creating the nametag widget that was destroyed while the HUD was hidden" isn't my logic. It's an issue that I am debugging.
๐คท data breakpoint will tell you why
yeah I've been doing that, haven't been able to figure it out yet. Will keep at it
what do you mean? if you use a data breakpoint it will tell you exactly what is adding it
you can just look at the callstack
Well yeah, I see that RebuildWidget is re-creating it. I just haven't figured out why
AddToViewport -> AddToScreen -> TakeWidget -> TakeWidget_Private -> RebuildWidget
that bit
paste the callstack
UE4Editor-PortalWars-Win64-DebugGame.dll!APortalWarsHUD::HideScoreboardWidget() Line 119 C++
UE4Editor-PortalWars-Win64-DebugGame.dll!APortalWarsPlayerController::OnHideScoreboard() Line 546```
UPortalWarsNameIndicatorWidget is that the nametag widget?
yes
paste the functions from the callstack i pasted
HUDWidget is a UUserWidget. The hierarchy goes HUDWidget -> IndicatorPanel (UCanvasPanel) -> NameIndicatorWidget
HUDWidget doesn't have a construct
well there you go then
if your widget tree for HUDWidget contains a UPortalWarsNameIndicatorWidget , it will rebuild its whole widget tree and call construct recursively
Hmm I'm removing the NameIndicatorWidget when the player is killed tho
I'm creating the NameIndicatorWidget at runtime tho
The HUDWidget has
UPROPERTY(BlueprintReadWrite, meta = (BindWidget, OptionalWidget = true))
class UCanvasPanel* IndicatorPanel;```
And then the NameIndicatorWidget's are created in `Character::OnRep_PlayerState` and added to the IndicatorPanel
you should make sure in the Destruct of HUDWidget that it is removing all NameIndicatorWidget in IndicatorPanel and make sure all references to these NameIndicatorWidget are nulled so that the GC can properly destroy the widgets
(otherwise you are actually causing a memory leak)
Interesting, I didn't know that. I'll try that right now ๐
use MemReport after a minute or so and see if you have any NameIndicatorWidget objects alive
Like this?
void UPortalWarsHUDWidget::NativeDestruct() {
Super::NativeDestruct();
if (IndicatorPanel) {
for (int32 i = IndicatorPanel->GetChildrenCount() - 1; i >= 0; i--) {
UPortalWarsIndicatorWidget* Widget = Cast<UPortalWarsIndicatorWidget>(IndicatorPanel->GetChildAt(i));
IndicatorPanel->RemoveChildAt(i);
}
}
}```
no there's no need to go Widget = nullptr, that's a local variable
when you add UPortalWarsIndicatorWidget where are you doing it?
there is also a better function to clear a panel widget's children
UPortalWarsIndicatorWidget* UPortalWarsHUDWidget::CreateIndicator(AActor* Actor, TSubclassOf<class UPortalWarsIndicatorWidget> IndicatorClass) {
if (!Actor || !IndicatorClass || !IndicatorPanel) return nullptr;
UPortalWarsIndicatorWidget* IndicatorWidget = CreateWidget<UPortalWarsIndicatorWidget>(GetOwningPlayer(), IndicatorClass);
IndicatorWidget->IndicatorActor = Actor;
// Add to Indicator Widget Panel
UCanvasPanelSlot* CanvasPanelSlot = IndicatorPanel->AddChildToCanvas(IndicatorWidget);
CanvasPanelSlot->SetAnchors(FAnchors(0.5f));
CanvasPanelSlot->SetAlignment(FVector2D(0.5f, 0.5f));
CanvasPanelSlot->SetAutoSize(true);
return IndicatorWidget;
}
you can simply go IndicatorPanel->ClearChildren or Empty or Clear, I forget what it is.. it's something like that
Character::OnRep_PlayerState eventually calls that CreateIndicator
ok and you are not referencing UPortalWarsIndicatorWidget anywhere else?
wait
show me OnRep_PlayerState
okay
void APortalWarsCharacter::OnRep_PlayerState() {
Super::OnRep_PlayerState();
// [client] as soon as PlayerState is assigned
if (PlayerState) {
CreateNameWidgetForCharacter();
}
}```
CreateNameWidgetForCharacter now
void APortalWarsCharacter::CreateNameWidgetForCharacter() {
APortalWarsPlayerController *localController = Cast<APortalWarsPlayerController>(GEngine->GetFirstLocalPlayerController(GetWorld()));
if (localController && localController->GetPortalWarsHUD()) localController->GetPortalWarsHUD()->CreateNameWidgetForCharacter(this);
}```
void APortalWarsHUD::CreateNameWidgetForCharacter(AActor* Character) {
if (HUDWidget) HUDWidget->CreateNameIndicatorForCharacter(Character);
}```
void UPortalWarsHUDWidget::CreateNameIndicatorForCharacter(AActor* Character) {
CreateIndicator(Character, NameIndicatorWidgetClass);
}```
Which calls that CreateIndicator function above
ok its just CreateIndicator returns a UPortalWarsIndicatorWidget so i was wondering if you were caching a reference to it
but you arent
yeah I"m not caching any references
so you can just call if(IndicatorPanel) { IndicatorPanel->ClearChildren(); } in the Destruct and it should be fine
okay, I'll try that now ๐
Hmm the problem with this is that I want the nametags for characters who are still alive to be there again when I re-show the HUDWidget
I was actually already trying to remove the Widget from the IndicatorPanel when the player dies in several places, but it was getting re-created
I am trying to remove the NameIndicatorWidget from the IndicatorPanel on lines 11, 24, and 57 of this paste https://hastebin.com/edakalilub.cpp
if you do it this way, the widget should get GCed
and you also should really consider moving to an event-driven system instead of checking everything on Tick
as for UPortalWarsIndicatorWidget i would make it handle its own visibility. Give it a reference to the character it represents (a weak pointer), and let it bind to its OnDeath delegate, and let it remove itself if the character dies (or gets destroyed to make sure as a failsafe)
seems like the simplest way
NameIndicatorWidget has a normal point to the character it represents
class APortalWarsCharacter* IndicatorCharacter;
make it a TWeakObjectPtr
what you are saying makes sense. I don't understand why this tick solution isn't working
also whenever you have raw pointers like that to anything UObject-derived (like an actor in your example) you have to make sure to wrap it with UPROPERTY() to prevent GC as it creates a strong ref to it
but you shouldn't do that for actors, you should use weak pointers (because once that character dies and gets destroyed, you are keeping the object alive in memory)
Right, I didn't make it a UPROPERTY because I didn't want to interfere with GC. Since in my IsValid I check to see if IndicatorChracter is null and if it is then I call RemoveChildAt
as for your tick solution, it's a mess to debug properly compared to an event-driven system, although i dont see why you cant debug it either way with data breakpoints... its not anything obscure or abstract. it's just data not behaving the way you want ๐คท
Fair enough, I'll try debugging it further again. And if I can't figure it out will move to the event-driven system
@toxic dove So yeah the following fixes the issue (using delegate instead of lines 7-10)
void UNameIndicatorWidget::NativeConstruct() {
Super::NativeConstruct();
IndicatorCharacter = Cast<APortalWarsCharacter>(IndicatorActor);
// Double check that all data and pointers are valid b4 moving on
/*if (!IsValid()) {
RemoveFromParent();
return;
}*/
IndicatorCharacter->OnDeathDelegate.AddDynamic(this, &UUserWidget::RemoveFromParent);
}```
It seems like they should be doing the same thing, but must be a timing issue or something
@silent patrol hey nick, its surely possible to tell the background blur widget inside of a retainer box to just use some background from some random viewport when not caring about any correct position of anything?
or even any custom render target or texture
just something so that the retainer box thinks its rendering on top of anything that isn't black
@placid beacon try to use event-driven systems in the future
in UMG the whole binding system is pretty awful since it is basically polling for data on tick
also make sure for every binding call to a delegate, there is an unbind (in your case in the NativeDestruct)
and you should check if it's already bound to add/remove
it will assert if you try to add twice in a row, etc.
I see, yeah just delaying a tiny bit before calling RemoveFromParent "fixes" the ticking solution. So its definitely a timing issues somewhere.
void UPortalWarsNameIndicatorWidget::NativeConstruct() {
Super::NativeConstruct();
IndicatorCharacter = Cast<APortalWarsCharacter>(IndicatorActor);
// Double check that all data and pointers are valid b4 moving on
if (!IsValid()) {
//RemoveFromParent();
FTimerHandle Foo;
GetWorld()->GetTimerManager().SetTimer(Foo, this, &UPortalWarsNameIndicatorWidget::Test, .1f);
return;
}
}
void UPortalWarsNameIndicatorWidget::Test() {
RemoveFromParent();
}```
Yeah the event driven system is much cleaner
Thank you for the help majo, yeah debugging it was definitely difficult
this is a retainer box with its render target initialized to a different color before the widgets inside are rendered: https://puu.sh/BAUDt/be9fd88b9a.png
so if I'd copy the viewport render target into the retainer box render target before the retainer box starts its widget rendering, then the background would look fully correct I think?
@main hedge
I would think that too
btw, where are you going with this
are you also trying to make blur with rounded corners?
no, I'm trying to display UI in the VR spectator screen while being able to blur the spectator screen behind
ah
yeah. I mean, the whole thing you see there is 1 retainer widget, and the blur is part of it
how did you get it to work?
the way I mentioned above ๐
nice
copying cropped eye view into retainer render target before it renders its widgets
anyone knows how to properly create a FSlateDynamicImageBrush ?
i tried this code here
UTexture2D* brushResource = Cast<UTexture2D>(StaticLoadObject(UTexture2D::StaticClass(), NULL, *Path);
const FSlateDynamicImageBrush* kMyBrush = new FSlateDynamicImageBrush(Clazz, FVector2D(16,16), kName);
and this
UTexture2D* Clazz = FindObject<UTexture2D>(brushResource, *Path);
const FSlateDynamicImageBrush* kMyBrush = new FSlateDynamicImageBrush(Clazz, FVector2D(16,16), kName);
but every time i use this code line for having a FSlateResourceHandle
FSlateResourceHandle Handle = FSlateApplication::Get().GetRenderer()->GetResourceHandle(*kMyBrush);
the handle is NOT valid and i can't find away to create this brush and having a valid handle. What am i doing wrong?
Hey everyone!
I would highly appreciate the upvote of the following bug in Slate:
https://issues.unrealengine.com/issue/UE-64214
wherer is SizeToContent in slate?
i think it's called AutoSize in slate
is there any cast function for slate? like Cast<>() for u objects?
is dynamic_cast safe for widget?
Anyone had a similar issue with slate doing this at all?
what's the issue
Well it should just be a square, but randomly its getting wacked an infinite amount too the left
for (auto _handle : Handles)
{
if (!&_handle)
{
continue;
}
FSlateColorBrush _Brush = FSlateColorBrush(FColor::White);
FLinearColor _Color = _handle.Color * FLinearColor(1, 1, 1, 0.25f);
_Color.A = 0.25;
FSlateDrawElement::MakeBox(
OutDrawElements,
(LayerId + 99990),
AllottedGeometry.ToPaintGeometry(_handle.Size, FSlateLayoutTransform(_handle.GetHandleAnchored())),
&_Brush,
ESlateDrawEffect::None,
_Color);
}```
i mean its nothing fanncy
just drawing a box
Maybe its my lack of slate understanding with the _Brush
Do you need to define slate brush sizes or something even if its just an fill?
open fresh widget bp with it in
click the object
drag it
issue happens
hit compile it fixes,
cant cause it again with out reopening the widget lmao
oh a nice we are executing on pre construct event
oh a note*
oh ignore the layer thing LOL, it was happening before i did that, i was testing a thing
@pearl badger You can't use a local variable for your brush, since you're passing a pointer and it stores it.
Also, it won't actually be causing any issue, but your if (!&_handle) doesn't make sense. Not sure what you're trying to check.
oh the handles are ptr's to other uprop's
not an actual whole data struct
ptr to ptr i guess
The point is you've taken the address of a local variable. It can never be null.
oh right okay, i was copying what i seen in some of the engine doc stuff
Does anyone knows which is the right way to create a FSlateBrush and add a valid resource to it? I need it to draw on a canvas
@pure cargo Right click, new slate brush in content browser
@quaint zealot oh. I was looking to much in achieving it through cpp code, probably. I'll look at it. Thank you so much. ๐
Resources are not created in C++ usually
yeah, i'm not that used to ue4 pipeline and i more acquainted to cpp so i wasn't looking in the most obvious place, the engine ui.
Has anyone hit this error before? SObjectWidget for '%s' destroyed while collecting garbage. This can lead to multiple GCs being required to cleanup the object.
I can't work out what's causing it. I have a UWidget => SWidget hierarchy and I can't tell which one is to blame
did your UWidget get garbage collected before the UI was manually destroyed?
the error happens if a UWidget is killed by the garbage collector while still owning an SWidget
it was added in 4.20
It happens when in the editor I hit Compile on my UserWidget that contains my UWidget/SWidget
The full error mentions "ReleaseSlateResources may not be implemented for the owner of this pointer" but I don't have to implement that for UserWidgets that refer to UWidgets inside them through BindWidget, do I?
you shouldn't have to
I've managed to cause this error in lots of strange ways like it happens if you have a widget component on an actor and forgot to call super::endplay
oh hmm
I still don't 100% understand the error really
Or why it could happen in editor when hitting Compile
not sure how it could happen there
check your destruct
pretty sure destruct is processed when you have a template open and compile it and have an instance of it open in another tab
What's up with this change? https://github.com/EpicGames/UnrealEngine/commit/da0aac16ff992f5b4a52b5e0acf0f179852bf7bf#diff-40011a99e562c0b4f1eb5d820c2d0c06
Looks like it prevents setting dynamic material instances for a font outline material since 4.20 as it thinks nothing has changed
Assuming it's accidental
Our development build is crashing when trying to create a widget on line: Assertion failed: (InHasTemplate && InAllowDynamicCreation) || (!InHasTemplate && !InAllowDynamicCreation) [File:D:\Engine\Source\Runtime\UMG\Private\WidgetBlueprintGeneratedClass.cpp] [Line: 133] How can I figure out which widget, without having to debug in and catch it before the check()?
I presume this is because of the potential bug with force slow contruction path: https://issues.unrealengine.com/issue/UE-59665. I would just disable force slow on all my widgets, but I've got 1000s and you can't seem to through the mass matrix?
We're in 4.20.3 too.
An easy alternative would be: List all widgets with slow creation enabled, then I can manually disable it.
it's easy to just debug and look at the callstack
it will tell you which widget
climb the callstack to the widget responsible
That'll require an engine rebuild being we're using a custom rocket build, but yeah I guess that is probably the easiest way.
It's really bloody annoying that the assert doesn't just print the name of the widget in question though.
why would it require a rebuild?
you attach VS to your editor, or launch the editor through VS, and then reproduce the crash
then just look at callstack ๐คท
The crash only occurs in builds, not in the editor.
oh I see
With Slate widgets, do widgets inherit the SLATE_ATRRIBUTES of their parent class?
And call the Construct() function with those args?
Anybody know how to declare PROPERTY_BINDING_IMPLEMENTATION for a non-slate type?
UPROPERTY(EditAnywhere, Category = "Radar", meta = (ClampMin = "0.0", UIMin = "0.0"))
float PulseFadeTime;
UPROPERTY() FGetFloat PulseFadeTimeDelegate;
PROPERTY_BINDING_IMPLEMENTATION(float, PulseFadeTime);
UPROPERTY(EditAnywhere, Category = "Radar")
FVector RadarSourceLocation;
UPROPERTY() FGetVector RadarSourceLocationDelegate;
PROPERTY_BINDING_IMPLEMENTATION(FVector, RadarSourceLocation);
UPROPERTY(EditAnywhere, Category = "Radar")
uint8 RadarTeam;
UPROPERTY() FGetByte RadarTeamDelegate;
PROPERTY_BINDING_IMPLEMENTATION(uint8, RadarTeam);```
FGetFloat works fine
FGetVector and FGetByte don't compile. Totally guessing as to what they're supposed to be, since there's no documentation on this and very few examples.
Is there a quick way to do that in slate? For editor plugin
What exactly @lyric shoal?
Doing that outside of a detail panel?
Cuz the easiest way might be to create a detail panel widget
it's SNew(SDockTab)
I want custom tab with specific stuff for our game
probably I can just put text field there and load file that way
but this thing looks better
So you want to show an object properties?
It's data asset selection
๐ค
UPROPERTY(EditAnywhere)
does that in blueprint window but I need it in the tab
And I was like there got to be a way to do that properly without recreating every button of this thing
Yep create a detail panel
I not sure I understand how to do that. Well got to google
i can create detail panel for my custom tab?
@lyric shoal ```cpp
FPropertyEditorModule& PropertyEditorModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
FDetailsViewArgs DetailsViewArgs(false, false, false, FDetailsViewArgs::HideNameArea);
WorldSelectDetailsPanel = PropertyEditorModule.CreateDetailView(DetailsViewArgs);
WorldSelectDetailsPanel->SetObject(MyObject, true);
And then can use WorldSelectDetailsPanel.ToSharedRef() to get the widget
thanks I will try that. Do you probably have some links what I can read about it?
I usually just look at the engine code
ยฏ_(ใ)_/ยฏ
There's probably some blogs mentioning it though
Yeah it's just kinda slow way to do that ๐
hehe
I kinda think the opposite ๐
Using engine code guarantee you to have the latest code
How do you find what code to read? Widget reflector?
- Ctrl Shift F
You really just spawn a DetailsPanel.
That's what Epic uses everywhere.
You can point it to an UObject Instance that holds Variables.
And these variables will show up in the DetailsPanel just like they do in a normal Blueprint.
It's basically the exact thing you see when highlighting an Actor in the Scene and looking at the Details Tab on the right.
That means you simply create a UObject Child. Put all your information you want to display into that and then create the DetailsView and set the Object to an Instance of your UObject Child.
The rest is handled in the Engine.
You can further customize this with a DetailsCustomization
Epic has a Stream in which, I think, Michael Noland talks about it and shows an example.
@lyric shoal https://www.youtube.com/watch?v=zg_VstBxDi8
Engine Programmer Michael Noland walks us through a project designed to show how to add custom functionality to the editor.
@low bluff But can I do that without actor in the scene? I don't have that
Yes, it works on a UObject basis
The Actor thing is just an example
Watch the video I posted please
@lyric shoal
I watched it. Probably just have to stick with it for some time to understand
it's just buttons that I created in new tab work great. And this UObject thing is something I need to merge with my buttons. So I am confused atm
Well you can leave the buttons in there?
You can always put the DetailsView in some VerticalBox or so
And your buttons below that
Or above
Or HorizontalBox
Whatever you want
Thanks I am going to try that
So there is SNew(SObjectPropertyEntryBox)
and looks like it's what I need
Has anyone tried turning off pixel snapping in the engine?
Hoverloop_Win64_Shipping!FHittestGrid::FindFocusableWidget<<lambda_20e01330dba2e93322511effa011bc64>,<lambda_89daff5bf47f11501fe467461d258219>,<lambda_cbd514484e8df5aac6c36d9225987898> >()
Hoverloop_Win64_Shipping!FHittestGrid::FindNextFocusableWidget()
Hoverloop_Win64_Shipping!FSlateApplication::AttemptNavigation()
Hoverloop_Win64_Shipping!FSlateApplication::ProcessReply()
Hoverloop_Win64_Shipping!FEventRouter::Route<FReply,FEventRouter::FBubblePolicy,FAnalogInputEvent,<lambda_a5074b48e3f487d955abe2a2156baffa> >()
Hoverloop_Win64_Shipping!FSlateApplication::ProcessAnalogInputEvent()
Hoverloop_Win64_Shipping!FSlateApplication::OnControllerAnalog()
Hoverloop_Win64_Shipping!XInputInterface::SendControllerEvents()
Hoverloop_Win64_Shipping!FWindowsApplication::PollGameDeviceState()
Hoverloop_Win64_Shipping!FEngineLoop::Tick()
Hoverloop_Win64_Shipping!GuardedMain()
Hoverloop_Win64_Shipping!GuardedMainWrapper()
Hoverloop_Win64_Shipping!WinMain()
Hoverloop_Win64_Shipping!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll```
Anyone an idea why this happens? It's UMG, but since this is Engine code, #slate makes more sense.
As far as I can see, it tries to navigate based on controller input and crashes on FindFocusableWidget when trying to focus the next widget.
4.19 and seems to happen when going from gameplay level back to mainmenu
Sadly doesn't seem to happen outside of a shipping build, so I can't debug further
Seems like it's "fixed" in 4.20.3 Hotfix
Now I have 0 idea if that means that it was only broken in 4.20 or also in 4.19 already
@silent patrol Is it possible for you to check if "UE-64239" was reported in 4.19 already?
The issues page is not listing it for me (probably a private entry).
I would just like to know if I'm doing something wrong of if this is something Engine related.
Idk if @fluid steppe has access to the issues page and could check that for me.
Still pinging just in case :P
@low bluff Weird, nothing looking like that in the commits between 4.20.2 and 4.20.3
Have you tried in 4.20.3 to see if it's actually fixed? ๐ค
No, don't know what is cuasing it and can't update the project atm
Does any of you have problems with custom cursors ? The scale is off by quite a bit
you should be using hardware cursors
look at your project settings and search hardware cursor
(this is assuming you are in 4.18+ i think)
@toxic dove How come, are they better ?
of course hardware cursors are better
ok i'll give it a swirl, thank you @toxic dove
@low bluff I am not seeing UE-64239
Amanda already looked it up for me. The bug you just posted got listed in the 4.20.3 Hotfix Forum Thread
The 4.20.3 Hotfix is now live!
Feel free to discuss this release on the 4.20 forum thread (https://forums.unrealengine.com/unreal-engine/announcements-and
Simply wanted to know if that bug existed in 4.19 or ealier already.
I can't see the history of it from here.
But Amanda said it only got reported in 4.20, so no one knows I guess.
Hello, all. I'm trying access a TSublcass<> property in a custom property editor
But I CANNOT find how to access the selected class through the PropertyHandle
There is a GetValue for everything except classes
Can anyone point me in the right direction? Thanks!
Found it. It appears one must use AccessRawData and then reinterpret_cast which makes my heart stop
TSubclassOf<UBBSAttribute> AttributeClass;
TArray<void*> RawData;
AttributePropHdl->AccessRawData(RawData);
ensure(RawData.Num() == 1);
AttributeClass = *reinterpret_cast<TSubclassOf<UBBSAttribute>*>(RawData[0]);
if (IsValid(AttributeClass)) {
}
Please help if you can. I don't want this to be the correct way to access a subclass drop-down property
Anyone using FSlateDynamicImageBrush with 4.20 ?
Apparently the class was refactored and ResourceObject is private
@silent patrol with your loading screen plugin, when bWaitForManualStop is used, what do I have to call for stopping it?
@toxic trench "StopMovie" on the MoviePlayer
It does a bunch of tests
// Continue to wait until the user calls finish (if enabled) or when loading completes or the minimum enforced time (if any) has been reached.
// Don't continue playing on game shutdown
while ( !GIsRequestingExit &&
((bWaitForManualStop && !bUserCalledFinish)
|| (!bUserCalledFinish && !bEnforceMinimumTime && !IsMovieStreamingFinished() && !bAutoCompleteWhenLoadingCompletes)
|| (bEnforceMinimumTime && (FPlatformTime::Seconds() - LastPlayTime) < LoadingScreenAttributes.MinimumLoadingScreenDisplayTime)))
{...}
One of them is (bWaitForManualStop && !bUserCalledFinish)
Means if bWaitForManualStop is true, it would stop if you set bUserCalledFinish to true
void FDefaultGameMoviePlayer::StopMovie()
{
LastPlayTime = 0;
bUserCalledFinish = true;
}
So if his Plugin exposes that, then that's your answer. If not, then you'd need to expose it yourself.
Since you use the Plugin, I assume you use this in BP atm?
@low bluff thanks!
not quite sure why you think using the plugin is related to using BP? ๐
I always use a mix of BP and C++
Cause if you use C++ you don't need the Plugin?
@toxic trench
I mean spawning a Loadingscreen is a few lines
why should I spend time with doing it myself if I can let the plugin handle it
Well, I needed a few lines. Idk what the Plugin does, but for a Loading Screen it doesn't need much
void UHLGameInstance::BeginLoadingScreen(const FString& MapName)
{
if (!IsRunningDedicatedServer())
{
FLoadingScreenAttributes LoadingScreen;
LoadingScreen.bAutoCompleteWhenLoadingCompletes = true;
LoadingScreen.bMoviesAreSkippable = false;
LoadingScreen.bAllowInEarlyStartup = false;
LoadingScreen.bMoviesAreSkippable = false;
LoadingScreen.bWaitForManualStop = false;
LoadingScreen.MinimumLoadingScreenDisplayTime = 5.f;
LoadingScreen.WidgetLoadingScreen = SNew(SLoadingScreen_Base).InLoadingScreenImages(LoadingScreens);
GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
}
}
Is the Plugin any faster or smaller?
well the plugin needs 0 lines of code ๐
So it exposes it to the Editor?
its fully configured through project settings
Ah well, then I wrote that wrong, that's what I see as BP too
Kinda at least
Everything outside c++, exposed to the Editor. Sorry
@low bluff is it normal that begin play is only called after the loading screen is over?
That I'm not sure. I usually use it with the settings I posed above
For us it's only for between two levels when loading
I want to end the loading screen on begin play + delay of 4 seconds, but I see that it never ends since begin play never runs. Only if I click the loading screen to skip it, then begin play starts executing
That can totally be normal
As BeginPlay is seen as the start of the match or?
Might be that the BeginPlay stuff waits for the MoviePlayer to stop playing
But not sure
well I don't just want to use that loading screen for the level load itself but also for my own stuff that I start doing when the level is loaded, so I need begin play on all actors to run while the loading screen still plays
I'm not sure what the exact usecase of that thing is
It might be tied into the Loading of Maps
You could bind to the Start and End of Map Loading
And when the Map finishes loading, you just create the loading screen widget "again"
So that it seamless goes over from map loading screen to the one you control
Just a random idea, could also be that you can somehow get the map loading screen to stay alive with begin play calling
Might be worth digging into the source when beginplay is being called
pretty hard to make the movie continue play at the exact same time though
I just have a Slate Widget show images, tipps, loading throbber etc.
LoadingScreen.WidgetLoadingScreen = SNew(SLoadingScreen_Base).InLoadingScreenImages(LoadingScreens);
I use a 16 second movie
Hm, then I'm not sure tbh. Check if BeginPlay depends on the movieplayer
I guess I have to do that, yeah
actually, its Tick that doesn't run, BeginPlay runs
but since Tick doesn't run the Event Begin Play in BP also doesn't run
@silent patrol would be nice if you could comment on that
Can't seem to find any hint towards the MoviePlayer
I'm up to the TickTaskManager already and it's pretty much chaos down here
I assume the MoviePlayer or LoadingScreen being infront of everything is actively stopping your frame with being started
So Tick is also not happening
Could be a stupid side effect?
shooter game does:
ScreenRes = Viewport->GetSizeXY() / AllottedGeometry.Scale;
Docs say FGeometry.Scale is deprecated; where should be used in its place? I got one crash when resizing window where it caused a divide by zero there
protected against it, but then saw that var is deprecated
ah looks like it was changed to:
if (Viewport)
{
const FVector2D Size = Viewport->GetSizeXY();
ScreenRes = (Size / AllottedGeometry.Scale).IntPoint();
}```
fixes int rounding issue that caused divide by zero, but still using deprecated Scale value
Is there a way to create slate/UMG widgets with custom-shape hitboxes? I want to make a two-part button that's split diagonally, clicking on the top-left triangle area does one thing, bottom-right does another.
I figured I'd ask here over #umg as it seems a lower-level issue
Oh looks like Nick suggested an idea here https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/27801-circle-widget-with-button-in-pizza-piece-shape?56972-Circle-widget-with-button-in-pizza-piece-shape=
Build powerful visual scripts without code.
In most cases you'll have to math it out @mild oracle
E.g. for your diagonal cut you can math out if the player clicked above or below it
Half sure there is not custom hitbox. It's a rectangle or nothing :D
@silent patrol was there a reason the Slate.PixelSnapRenderTransform cvar (and functionality) was removed in 4.20? Will try to add it back into our engine fork for now, but curious if there was some important reason it had to go away?
I'm creating some custom editor tools for the first time, is there any better way to create slate layouts other than manually? At Valve we had similar markup but also had a visual editor that produced code.
I have a blank widget to capture drag/drop events and I added it to the main GameViewportClient SOverlay with a high Z priority. It gets the drag/drop events, but doesn't let normal mouse events through to siblings in the SOverlay, even though they are unhandled
seems they only bubble up the hierarchy and don't visit siblings.. is there a way to change that (I've seen some routing policy stuff in the code?)
reeally ugly but this is what I ended up with:
Super::AddViewportWidgetContent(DragDropWidget.ToSharedRef(), 1000 );
FWidgetPath OutPath;
if (FSlateApplication::Get().FindPathToWidget(DragDropWidget.ToSharedRef(), OutPath))
{
if (OutPath.Widgets.Num() > 2)
{
auto ParentOverlay = OutPath.Widgets[OutPath.Widgets.Num() - 2].Widget;
auto OverlayParent = &(OutPath.Widgets[OutPath.Widgets.Num() - 3].Widget.Get());
SOverlay * CastedOverlayParent = OverlayParent->GetType() == FName(TEXT("SOverlay")) ? static_cast<SOverlay *>(OverlayParent) : nullptr;
if (ensure(CastedOverlayParent))
{
Super::RemoveViewportWidgetContent(DragDropWidget.ToSharedRef());
CastedOverlayParent->RemoveSlot(ParentOverlay);
CastedOverlayParent->AddSlot(0)
[
DragDropWidget.ToSharedRef()
];
DragDropWidget->AddSlot(0)
[
ParentOverlay
];
}
}
}
```
DragDropWidget derives from SOverlay and handles drag/drop events.. I get widget path and inject it as a parent of the main UGameViewportClient::ViewportOverlayWidget
I'm sure there is a much better way to have done it..
@eternal wave I think it is this: cpp /** Request that this window be destroyed. The window is not destroyed immediately. Instead it is placed in a queue for destruction on next Tick */ void RequestDestroyWindow();
on SWindow
There is also:
/** Warning: use Request Destroy Window whenever possible! This method destroys the window immediately! */
void DestroyWindowImmediately();```
better to use the former from the comments there.
hi - is there a way to use FSlateDrawElement::MakeLines such that it stays within a scissorrect? specifically i am trying to paint lines onto a widget, and i want them to stay within the bounds of the widget and not overdraw
here's an example of what i mean. i am moving it with the mouse. i want it to stay within the bounds of the black box and not move out into the gray area
nvm. i figured it out. i needed to set the clipping property
Hey ๐ Please, I need help. How can I get my transform in editor? I mean, I want to spawn some objects in front of me....something like MyRot().fwdvector()*100.f; It's possible in editor?
@flat panther What does that have to do with Slate?
@low bluff I'm working on plugin, extending editor..after I click the button, I want to spawn, but can't figure out how to get my location in viewport...
hm I see there is maybe a better place
Probably can check the ViewportClient class
never noticed #editor-scripting
But this is really not Slate related
Either #editor-scripting or #plugin-dev
But #editor-scripting is pretty much dead
is it possible to apply a rotation to the hardware cursor?
Hi, I need to create a horizontal scroll widget that hold children.i want all children to have the same width that match screen width. I tried with a size box but I can't get it working properly.
In fact I take the screen width and tried to remove the dpi scaling but the result in slate unit is not correct so my widget don't have the good size. Can anyone can drive me I the right path to do this?
My goal is to create a menu like Clash Royale that has a horizontal scroll menu. Each menu item has the width of the screen. Thanks
make a vertical box widget... add it to the screen... make it "fill" alignment and it will cover the whole screen
My widget are in a scrollbox. I can t use this trick.
so what? same principle. make the scrollbox fill align
I need the widget inside the scroll box to "fill" I mean I need each child to have the same size with Width = screen Width
The Scrollbox already fill the screen but the child inside it don't follow the same rule. They are using the DesiredSize.
then don't let them use desired size
How do you suggest to do that? How can constrain to the parent width?
guys I need you're help, I'm attempting to copy this new 3D widget MAT which is supposed to help fix the washed out 3D widget browser
https://answers.unrealengine.com/questions/466689/browser-3d-widget-looks-washed-out.html
I'm relatively confident the only difference is that I haven't added the "SlateUI"(can't find it). I'm using texture sample in it's place but the 3D widget is just white, hopefully it's the SlateUI thing I need to fix.
what exactly is your question..?
@toxic dove So basically how do I add the "SlateUI" (left) shown in this image. I need to add it to my material but can't find it.
https://answers.unrealengine.com/storage/temp/213422-cjpaul-fileswebbrowser.png
that looks like a texture sample
I also tried a texture sample but mine looks different
๐คท its definitely a texture sample
hmm ok, I guess that's not the issue then. The above material setup is supposed to fix my widget issue but it doesn't work for me.
I'll ask in the forums
Has anyone implemented something like this in UMG/Slate? https://www.youtube.com/watch?v=Hxc7l06xhv4
The DragListView library can be used when you want to be able to re-order items in a list, grid or board. https://github.com/woxblom/DragListView
I've found SDragAndDropVerticalBox that looks like it might help...
@heavy badger What is the issue you're trying to fix?
You probably want to use a RetainerBox. With that you can set your Param2D (needs to be a TextureParameter2D) by name in the RetainerBox's details panel, "Texture Parameter" input box
I just got done using it for something else (curved HUD material) so that'd be my guess.
I've got it kinda working now, instead of creating the material from scratch I just found the parent material which had the SlateUI.
any idea on how the ue4 colorpicker's eye dropper works? Is it possible to check the source-code of the colorpicker and see how the eye dropper works?
So i suppose i found it. It was under SEyeDropperButton.cpp, but i didn't get much from that, considering i'm completely unexperienced with c++ and github.
https://imgur.com/8xTZaPg This is what i ended up with and ofc i still don't understand how the color eyedropper works, but i'm pretty sure that it isn't possible to make the eyedropper system in blueprint which is what I'm experienced with.
So my question is this. Is it possible to make an eyedropper plugin? (because then i'd be able to add it in a bp)
Well, there are multiple ways to expose that
I assume this is not a widget in itself?
If you only want the Coler EyeDropper, you can probably use the FPlatform stuff they use and expose that
I guess yeah, it's possible to make a plugin.
hello i have a c++ menu and wanna fake a left mouse click on it, like a macro of many mouse positions and clicks combined in 1 click
can i use WidgetInteractionComponent on c++ menu?
it has Mouse as Source, but doesn't really work in 2D
Does anyone here know If there any example project out there that uses SWidgetCarousel of unreal engine, or any project that has a carousel UI that I can look into ?
@desert lark There are a bunch of widgets in slate that aren't really used. I'd search the test code in the engine and google but that's about all there is
@mild oracle, thanks for replying, searched engine code, it isn't used anywhere. And I don't see any projects that use it. Well, I think I'll make my own carousel using UMG and animated widgets.
anyone knows if possible to get cursor location in SMultiLineEditableTextBox. like row number and character?
Is there a tutorial to add a button to the editor's toolbar somewhere?
I can add the button just fine, but whatever I do to change its texture and text, it crashes with no information whatsoever.
This is likely the dumbest module from UE4 that I came across so far.
And everywhere I look on the internet, it's just "how to add a button", "how to make a list". No explanation whatsoever about how everything is tied (loosely glued) together, apart from the one the vaguest sections the official docs have to offer.
look at engine source code
will localization gather correctly parse NSLOCTEXT split over multiple lines so it doesn't become multiple monitors wide?
it seems like the style in the engine source is just to make it ridiculous wide..
Thank you for the very helpful tip. It never crossed my mind to look at the engine's code. I was hoping to get away by bashing my dick against the keyboard and pray for some magic.
that always works out
@elder badger There is one single Epic Games Stream about it
Not a tutorial, but at least some info
Yeah, it helps a bit, but well.
Found the answer in the mean time, but thanks! Took me 2 days to add a button with text and an icon.
For the rest: Plugins can be created with Templates. One of these adds a button already.
Yea, I looked at those. They're sort of helpful
But as a first time slate experience, every single step was horrible. A macro hell-hole.
Does anyone know if ReadPixels should display the UMG widgets currently on screen? Its not showing for me.
Anybody else experience slate crashing during map travel?
Seems to occur all the frigging time
Problem is it's in the Render Thread, so it's almost impossible to trace
SlateRHIRenderingPolicy line 798 - which is even more puzzling
Does it persist if you remove all widgets?
Figured it out.. turns out you can't use the Movie Player for seamless travel ๐ฆ
Which is annoying because it breaks my loading screen.. dangit
And naturally, steam doesn't work without seamless travel. RIP
Guess I should update my loading screen tutorial :/
Was having so many strange issues with it, turns out that's likely the cause
Only reported on UDN though ๐ฆ
Apparently you can use UMG/Slate widgets added via the usual method for seamless travel, and use the media framework to play videos etc.
But anything done with Movie Player isn't safe for seamless travel apparently ๐ฆ
Alright well now I'm getting the crash with no loading screen. Lord I hate seamless travel
Hm I'm actually all for it
Cause of the easy way of passing stuff
Does it only happen with seamlesstravel?
yeah, absolute travel seems okay
seamless seems to cause crashes pretty much every time in slate
Sooo.. seems to be related to SMeshWidget
If I remove those, I get perfect seamless travel
Greaaaaaat
@craggy holly Are you getting loading screens working at all for seamless travel?
I use the same GameInstance call etc. but it seems my screen stays black
Actually I use the MovePlayer ๐ค It's not crashing for me
if (!IsRunningDedicatedServer())
{
FLoadingScreenAttributes LoadingScreen;
LoadingScreen.bAutoCompleteWhenLoadingCompletes = true;
LoadingScreen.bMoviesAreSkippable = false;
LoadingScreen.bAllowInEarlyStartup = false;
LoadingScreen.bMoviesAreSkippable = false;
LoadingScreen.bWaitForManualStop = false;
LoadingScreen.MinimumLoadingScreenDisplayTime = 5.f;
LoadingScreen.WidgetLoadingScreen = SNew(SLoadingScreen_Base).InLoadingScreenImages(LoadingScreens);
GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
}
You got UDN access? The only post on the subject was from 2016.. maybe it's been changed since then
Nope.
Quick other question, if I have UIOnly Input Mode, what class grabs input events if nothing is focused?
GameViewport?
Has anyone dealt with supporting 2x resolution UI textures for 4k/high-DPI? Did you roll your own solution?
@quaint zealot Doesn't that make the UI really blurry? :S
It didn't, provided you make sure to use power-of-two assets with the "UI" domain & compression
What compression did you use?
The "UI" one
For me that's defaulting to "DXT1/5, BC1/3 on DX11""
UserInterface2D is uncompressed
I guess I can test w/o any fancy 2x solution and see how it feels at 4k
A lot of other frameworks/platforms have a 2x asset solution
You can definitely build that too
Create a slate style set that holds all your assets, make a 1080p and a 4K version with dedicated assets
you'd have to carefully design the ui with that restriction in mind, otherwise you'll absolutely need non-power of 2 textures for ui ๐ค