x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Create SWindow as UMG widget

Hi all!

I've already found some info about SWindow widget itself here: https://answers.unrealengine.com/questions/262902/two-windows-in-a-program.html
and here:
https://answers.unrealengine.com/questions/387916/how-to-show-the-swindow-when-i-clicked-the-button.html
and also about creating your custom UMG widget through C++ (Rama's tutorial): https://wiki.unrealengine.com/UMG,_Custom_Components_And_Render_Code,_Usable_In_UMG_Designer

But still i can't get myself in any point from where I can start, so my question is:
can I make a custom SWindow widget exposed to UMG editor where i'm able to place inside window any content I want?
If so, where should I start? What engine class i need to inherit or is it possible to follow Rama's tutorial with some modifications in order to implement window widget instead of rectange with custom render code?

The purpose of all of this is pretty simple: i want to get draggable window that is separated from main window and containts some UMG widgets with scripted logic (no C++ needed for window content creation).

Im using Unreal to make my bachelor's degree work (small CAD software dedicated to specific theme) and currently trying to imrpove some of the UI aspects of it (currently, draggable UMG windows that are visible inside main viewport only are not very comfortable to work with).

Thank you.

Product Version: UE 4.9
Tags:
more ▼

asked May 24 '16 at 11:55 AM in C++ Programming

avatar image

Revenvik
75 6 11 13

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You probably wont able to do that as UMG editor was not designed to edit SWindow, you would need to design support for it whole thing youtself. But why dont you jusy make function that creates SWindow and place widget generated from UMG class. You can easily grab Slate widget from UMG widget with this class: https://docs.unrealengine.com/latest/INT/API/Runtime/UMG/Components/UWidget/TakeWidget/index.html You store UClass of some UMG widget, you create object from it and store it some where using NewObject function and then you use TakeWidget to grab slate widgey from it and add it to SWindow widget you created in C++.

more ▼

answered May 24 '16 at 02:07 PM

avatar image

Shadowriver
36.6k 930 169 1111

avatar image Revenvik May 24 '16 at 05:50 PM

Awesome, thank you! That's what I wanted to hear. Definitely will try this.

avatar image alonezhby Sep 16 '18 at 06:29 AM

Hi, Shadowriver! I created a SWindow and set a umg as it's content, if I CLOSE the SWindow though CLICK the close button before stop the game. I'll get a error:

SObjectWidget for > 'MySlateWindow_C > /Engine/Transient.UnrealEdEngine_0:GameInstance_0.MySlateWindow_C_0' > destroyed while collecting garbage. > This can lead to multiple GCs being > required to cleanup the object. > Possible causes might be, 1) > ReleaseSlateResources not being > implemented for the owner of this > pointer. 2) You may just be holding > onto some slate pointers on an actor > that don't get reset until the actor > is Garbage Collected. You should > avoid doing this, and instead reset > those references when the actor is > Destroyed.

Do you know how to solved this?

Thanks

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question