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"

Fundamental Problems of Slate Writing with c++ Language,Please help

I see the following code in the official document:

I don't quite understand.

 SNew(SScrollBox)
 +SScrollBox::Slot() .Padding(10,5)
 [
     SNew(SHorizontalBox)
     +SHorizontalBox::Slot() .HAlign(HAlign_Left)
     [
         ...
     ]
     +SHorizontalBox::Slot() .HAlign(HAlign_Center)
     [
         ...
     ]
     +SHorizontalBox::Slot() .HAlign(HAlign_Right)
     [
         ...
     ]
 ]

What does the above [] mean? Please give me some help.

Product Version: Not Selected
Tags:
more ▼

asked May 15 '19 at 04:40 PM in C++ Programming

avatar image

哇哈哈咩
11 2 2 4

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

2 answers: sort voted first

Square brackets are sugar syntax for slot content. You place new elements into them like in your example line #4. You could construct new element in place or preconstruct it somewhere else and later just inset it. You can think square brackets as "slots" where you insert stuff. If you need more functional Slate examples I would encourage you to browse Helium Rain Github repository as it is great learning example how to use Slate in game. If you are making editor tools then just fork Unreal from Github and look into it's codebase. Nearly all Slate classes use prefix **S**SomeWidget...

more ▼

answered May 15 '19 at 07:26 PM

avatar image

Vertex Soup
288 4 22 16

avatar image 哇哈哈咩 5 days ago

Thank you very much. I'll try to finish something.

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

There are multiple examples of slate widgets in Engine\Source\Runtime\AppFramework\Private\Framework\Testing folder. inside SWidgetGallery.cpp file and others.

See there for examples of usage. If you dare.

cheers Podge

more ▼

answered May 15 '19 at 09:40 PM

avatar image

Podgyhodgy
226 3 7 13

avatar image 哇哈哈咩 5 days ago

Thank you very much. I'll try it.

(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