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"

What are Slate Units?

Why does Slate use Slate Units for padding and sizes? What are Slate Units? Are they pixels?

Product Version: Not Selected
Tags:
more ▼

asked Mar 12 '15 at 07:15 PM in Using UE4

avatar image

Fiskislóð STAFF
441 17 11 132

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

1 answer: sort voted first

Slate Units are a way for us to make UI that is independent of pixels ( more precisely: independent of the pixel density of your monitor). A brief motivation is needed: building a UI where you specify everything in pixels just wouldn't work across multiple platforms these days. The size of a pixel and number of pixels packed into a a single square centimeter of a display varies dramatically. Check out this site for some info: http://dpi.lv/.

So, a single Slate Unit does not have a size per-se. By default it was convenient to set it to 1 Slate Unit is 1 pixel. However, if you bring up the widget reflector you can use the App Scale to play with how big you want a single Slate Unit to be. This applies to the entire application (e.g. the whole editor, game, etc.)

Another trick is that we can scale Slate Units dynamically for different parts of the widget hierarchy. This is where things get interesting and somewhat complicated. One example of this is the SNodePanel (it powers Blueprints, Material Editor, and other graph-based UIs.). The SNodePanel scales the SlateUnit to pixel ratio for its own content to make its contents appear bigger or smaller when you zoom in/out.

Finally, we attempt to provide an automated heuristic for scaling your game based on the size of the monitor. Because we do not have reliable information about the pixel density of various platforms we cannot always do the right thing. At the moment we provide a simple setting: a curve function found in Edit->Project Settings->User Interface. You can use that to define how your in-game UIs will scale. For example, a flat line with y == 1 means you always want each Slate Unit to be 1 pixel. If you want your game to be 1:1 at 720p and linearly scale as your window size increases, you can express that by putting a point down a x=720, y=1 and another point at x=1440,y=2. This isn't perfect, but it seems to be handling the most common cases for now.

more ▼

answered Mar 12 '15 at 07:27 PM

avatar image

Fiskislóð STAFF
441 17 11 132

(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