Right at the beginning when you create the widget c++ class, you can actually just scroll to the bottom of that menu and there are default constructor options for both slate widget and slate widget style that do all the default includes automatically
@steffennilsen21324 жыл бұрын
If you come from a webdev environment, the composition syntax of slate is quite easy to digest
@RandomGuyyy4 жыл бұрын
This helps me understand the UI code in the ShooterGame example project as that's all Slate based. Thank you!
@TechNova454 жыл бұрын
Very cool. What I usually do is create a C++ user widget class, then a widget blueprint and change its parent to the user widget C++ class, with that I have the flexibility of widget blueprint for adding buttons etc easily and I can use C++ for anything else like drag enter, mouse enter or anything else really.
@Teturarsyra3 жыл бұрын
If you wonder what's the 'class' in 'TWeakObjectPtr OwnerHUD;' it is just a concise way to use forward declaration, it's equivalent to: class AMainHUD; TWeakObjectPtr OwnerHUD;
@PBOZAI3 жыл бұрын
An issue with code at 17:21 This might be a change to more current versions of Unreal, but GEngine might be shared between multiple PIE windows. This often leads GEngine->GameViewPort to point to the incorrect viewport. This can be avoided by using something like ULocalPlayer* LocPlayer = Cast(PlayerOwner->Player); if (LocPlayer && LocPlayer->ViewportClient){ auto* VC = LocPlayer->ViewportClient; VC->AddViewportWidgetContent(SAssignNew(MenuWidgetContainer, SWeakWidget).PossiblyNullContent(MenuWidget.ToSharedRef())); and similar for VC->RemoveViewportWidgetContent The LocPlayer client is guaranteed to be the correct client for each AHUD instance in this edge case.
@PBOZAI3 жыл бұрын
As of writing this only fixes a bug that occurs when multiplayer is being tested in editor. Thought, the documentation indicates that Unreal might further use this type of behavior in the future.
@daigriff19894 жыл бұрын
This has helped me a great deal! Slate code absolutely terrified me but now I understand it, and it's weird syntax a whole lot better. Thanks for the great tutorial
@karthikeyatsvr383811 ай бұрын
Best video ever. Very helpful. Also could you please do a video on how to make the buttons UI design like icons(fps, replay, file explorer icons with functionalities) and Also hover and Click animations
@faei18976 ай бұрын
For anyone else curious about what adding const before override does - it just goes "hey, we won't change anything about this object!". I had a copy of C++ Programming 4th. Edn. on hand and went looking. Page 307 on §12.1.2 explains the parts of a function declaration.
@Guraw2 жыл бұрын
Still 100% accurate and working in UE5 early access. Thank you for a great tutorial!
@philboltt4 жыл бұрын
Thanks for this! It's a huge help in getting over that initial Slate WTF moment :) More Slate tutorials pls!
@IsaacCode952 жыл бұрын
thank you! your c++ are the best i've seen, would you consider making a c++ tutorial that is relevant to UE5 ?
@andikarizkyoktavian85812 жыл бұрын
my button is greyed out and when mouse hovered above it, there is no sign of my button being hovered. and i can't click the button too. is there something wrong in my code or this is bug in UE5?
@DevGods4 жыл бұрын
I bought the course before it was finished but don’t have access to the rest of the lessons! Been trying to get in touch with Reuben but he’s been absent really want to finish this course for learning purposes
@artoriasdenostradamus36284 жыл бұрын
Could you do a tutorial to do for example an dynamic health bar and enemy kill counter with this method of slate ,please ?
@hydrogen50873 жыл бұрын
**Help!** When I compile at timestamp 13:08, I get: Error C2660 'SWidget::Construct': function does not take 1 arguments How should I proceed? Kindly help me, please.
@gamemakerdude4 жыл бұрын
Outstanding tutorial as always! I have a request, please. Would you please consider making a tutorial on how to move pawns in a circle?
@frankhilpert48934 жыл бұрын
thank you! this is exactly what i was looking for. you have the ways of a great teacher about you. great to listen to.
@Aethrax86 ай бұрын
Do you know how can I add textures as a png (like in UMG in unreal) to images or buttons in slate ? I will be very greatfull if you know and answer. Thanks already.
@ayoubtouaty82552 жыл бұрын
Can anyone tell me how to create a custom button position editor like mobile games have ❤️🙏
@mr-lks4 жыл бұрын
what is the differences between making ui on c++ or blueprint? Is there any efficiency
@redjohn48863 жыл бұрын
Where is the MenuGameMode class coming from ?
@李佳奇-w9z Жыл бұрын
i think the reason is your project is a blank project.
@noahsteam82143 жыл бұрын
Thank you for putting this together. Very helpful.
@irajmh4 жыл бұрын
Can we have a tutorial on how to add a SvirtualJoystick?
@Atl3m Жыл бұрын
can this be done in user widget also . not slate ?
@robinj6997 Жыл бұрын
Such a great tutorial! Thank you
@mourirsilfaut67692 жыл бұрын
It looks weird when I change background color.
@katietooher8472 Жыл бұрын
Hello, does anyone know if this is possible to create with an SWindow instead of using a HUD class?
@rukiandtheenok4374 жыл бұрын
Hi I am new at dev in UE. I have a problem in my MenuHUD.cpp in this row: GEngine->GameViewport->AddViewportWidgetContent(SAssignNew(MenuWidgetContainer, SWeakWidget).PossiblyNullContent(MenuWidget.ToSharedRef())); There is an Error (E0312) on MenuWidget.ToShareRef ... I don't find any differences to your code :-(
@ElodinMaster4 жыл бұрын
I also have an error with that line. Did you find the solution?
@rukiandtheenok4374 жыл бұрын
@@ElodinMaster Hi no sry. A friend of me wrote the script on his project. And I copied that stuff. I don't now whats wrong with that line
@ElodinMaster4 жыл бұрын
@@rukiandtheenok437 Found out the problem in my case. I forgot to write the public keyword before SCompoundWidget when doing the inheritance of SMainMenuWidget
@maxedwardsantos3 жыл бұрын
For those that have this problem in the future, make sure you are subclassing SCompoundWidget in your SMainMenuWidget class
@JoshDucote3 жыл бұрын
how would i go about making options menu to pop up when i click it?
@DanielOraraVA4 жыл бұрын
howcome the module is there in the files, but not automatically implemented or included?
@Cronofear Жыл бұрын
The problem with slate are the slow iteration times/slow compilation. The system itself is as simple as json.
@Dan-zw2sc3 жыл бұрын
This seems really useful for making custom widgets. But is there an advantage over BP for doing the layout of the widgets in the HUD in C++?
@volkadrum4 жыл бұрын
Thanks so much for this great tutorial! I would love to learn more about using slate to store player input (e.g. player name) from a editable text box. Con someone help?
@vegitoblue21873 жыл бұрын
So in theory this slate widget could be made from anywhere not just HUD right?
@biedagejming4 жыл бұрын
Will this Survival game course be some day on Udemy ??
@matheus-kirchesch3 жыл бұрын
Are you planing on a more in depth slate tutorial? would be nice
@matheus-kirchesch3 жыл бұрын
if not, do you have a doc or something with alot of information about it? maybe the code of a Custom Editor UI of yours
@artoriasdenostradamus36284 жыл бұрын
The Survival game course is developed in pure c++ or both c++ and blueprints?
@leonardo6631 Жыл бұрын
Great video!!
@lennysmileyface4 жыл бұрын
Can you only make slate widgets that inherit from classes like SCompoundWidget?
@darkferiousity2 жыл бұрын
This kind of reminds me using React Three Fiber which is pretty cool. I was happy I found your vids I just like doing everything in c++.
@Teturarsyra3 жыл бұрын
No need to over-complexify the code, here is a straightforward way to add your widget to the viewport with Slate: void AMyHUD::BeginPlay() { if (GEngine && GEngine->GameViewport) { mainMenuWidget = SNew(SMainMenuWidget); mainMenuWidget->owning_hud = this; GEngine->GameViewport->AddViewportWidgetContent(mainMenuWidget.ToSharedRef()); } }
@DaBaSoftware2 жыл бұрын
Tested and works great in UE5 Preview :)
@wayancientmoon11424 жыл бұрын
Thanks a lot for this nice tut! I thought it's just a half hour course, acutally took me one day to understant it. XD Just got one question: why my VA cannot use "Add Include" ? it is grey and I cannot click it.
@perregrinne25004 жыл бұрын
At 3:55, I think you could just add "Slate" and "SlateCore" into the addRange line above instead of making a second line, but that's a pretty insignificant nitpick. Still a really useful tutorial. Also, just started getting back into Cryengine last week. Any tutorials there would be absolutely welcome!
@cDogRage9 ай бұрын
Thank you so much for this.
@karthikeyatsvr383811 ай бұрын
Very Helpful🎉
@arkanzock40823 жыл бұрын
Slate or UMG? Whats bettrer?
@tophinski4 жыл бұрын
I've been considering purchasing your Survival game course and I"m wondering which version you use. Thanks, great content as always, Reuben.
@reubs4 жыл бұрын
We use 4.23 in the course.
@tophinski4 жыл бұрын
@@reubs Perfect, thanks for the reply!
@tophinski4 жыл бұрын
@@reubs One more question, does the survival course use a projectile system or ray casting for the bullets?
@VampNeo3 жыл бұрын
Wow, awesome. I am actually following your course on Udemy also. Any chance I can learn more , I mean I want to make slate widgets customizable, like you provide a edit layout window and then the user can edit different widget position and sizes. Actually I am trying fps mobile game , and its pain to find any tutorials . Most of the tuts are also about umg and not about the slate widgets. But I came to know that for touch Interfaces slates are the way to go, but can't find good tutorial on how to make them customizable like drag and drop umg
@RedFlowering3 жыл бұрын
Thx! You are My Super Great Teacher!!
@张某某-m9p4 жыл бұрын
how to use set a image for simage
@SouravUE4 жыл бұрын
Hi, I wanna learn game development i really like unreal and to start in it but every one's suggesting to learn unity. What's your opinion as a beginner should i learn unreal ?? and how much time it would take to learn C++ for Unreal.
@kryph4 жыл бұрын
Can I tell you my opinion on it? I have worked in unity and unreal. Unity is a little bit easier to start with, but as you advance it gets to be the same level of difficulty as unreal. C++ and c# are not that different. What kind of game are you making? Unreal is great at making games look graphically amazing without much effort. Unity is best for mobile games. Unreal is not great at 2D, but It’s amazing for 3D. Unreal has blueprints which are an alternative to c++.
@SouravUE4 жыл бұрын
@@kryph Thanks for your insight. Interested in 3d games mostly small rpg like, some ar/vr and later may be something big and awesome. And how much time does c++ takes to learn?
@kryph4 жыл бұрын
Sourav that depends. If you already know a language like c#, you could pick it up in about 1-2 months. Without prior knowledge of a language, takes about 2-3 months to learn the basics. Unreal also has blueprints, so you could start with that.
@SouravUE4 жыл бұрын
@@kryph Thanks a lot for ur time. 🙂
@demidrek-heyward3 жыл бұрын
thanks Reuben!
@jasoncrosby85232 жыл бұрын
Coming from a mobile developer background this looks very similar to Android Compose and iOS Swift UI.
@RockWarCry2 жыл бұрын
It looks a lot like Flutter`s and Swift UI`s way of composing UIs
@halfbakedproductions78876 ай бұрын
HUD Class is legacy and deprecated in UE5.
@NicoleSummer82 жыл бұрын
Awesome 🎉
@StefanJann5 ай бұрын
Thank you
@reubs4 жыл бұрын
1st
@HussainAhmad-kh3eo4 жыл бұрын
Hehehehe
@paulhax4 жыл бұрын
Looks like good content. A suggestion: triple or more the editor text size. I can't read the code on my laptop screen.
@wisper86283 жыл бұрын
very nice
@awoidf Жыл бұрын
7:20-7:24 yeah, that's also known as the stockholm-syndrome xD
@Muhammad_Abdullah_Sultan Жыл бұрын
Good
@VladyVeselinov4 жыл бұрын
You can really tell Epic doesn't care about UI, every UI system they have is so clunky...
@reubs4 жыл бұрын
Try using cryengine! It uses flash lol
@VladyVeselinov4 жыл бұрын
@@reubs oh my
@ivayloi7364 жыл бұрын
Almost all UI frameworks are just terrible. Dear ImGui became very popular because there is really nothing else remotely sane. There are bindings for UE4 btw...
@VladyVeselinov4 жыл бұрын
Y'all I wanna say I didn't mean this in a super negative way, it's totally cool for them to have other priorities
@ivayloi7364 жыл бұрын
I see now why they had to come up with UMG in order to expose something... more sane to BP... I get what they were trying to achieve, but breaking the language with macros and non standard style of codding, never ends well...
@РижаМавпа-ш8и3 жыл бұрын
No, you're wrong, this is actually how normal code is wrote. If you're a designer you use prewritten stuff, but if you need more flexibility and actually making something new you will be doing this.
@andrew68554 жыл бұрын
I don't really think there is a good reason to use slate over UMG. You mentioned two reasons why you would do so: Performance and access to hidden features. As for performance, as time goes on Epic games will optimise the back-end of UMG more and more so that the performance difference won't be big enough to justify giving up ease of design. As for the hidden features, I was completely unaware of any hidden features or features only accessible through slate. Unfortunately I didn't see you mention any of these "hidden features" in the video since it seems to be catered to absolute beginners. Thanks for the great free tutorials though! It's people like you that strengthen the game dev community! :)
@reubs4 жыл бұрын
Thanks! An example would be the color picker widget, which isn't available through a widget blueprint. You can write very basic editor extensions with Blueprint, but most more involved extensions will require some C++.
@Teturarsyra3 жыл бұрын
For simple UIs and beginners I agree, for complex ones clarity will be on the C++ side not to mention speed will always be slower no matter how much Epic tries. In addition If you use the source version of UE and need for instance to extend the editor and mod things, then c++ slate knowledge is mandatory to understand and modify existing code base.
@devintrusdell57333 жыл бұрын
GOD loves y'all and have a Blessed day ✝️⛪🙏🙏🏻🙏🏼🙏🏾🙏🏽🙏🏿👼🏿👼🏾👼🏽👼🏼👼🏻👼😇🥰❤
@goken-san92243 жыл бұрын
My character and the camera isn't moving after adding the slate code. What can I do to fix this?
@quazitarik2 жыл бұрын
how do I load image from local drive instead of changing color to black