Slate Custom Coordinates

Hi,

I would like to know if there is a way to input custom coordinates on a slate widget like a button say X->253 Y->567
I have been exposing slate to blueprints but the options for alignment as i understand them are limited.

I have used the WidgetReflector in Editor and when i hover over the slate UI buttons on screen it reports back a position. So far i have been unable to get where this is possibly defined or set if someone out there know this please tell me.

(Here hoping Rama will come to the rescue :P)

The position is not stored on the widget. It is computed on demand based on the layout rules specified. Different layout panels have different layout rules. SCanvas used to have a rule that was pretty close to what you are asking. The new panel we are developing for UMG has a panel similar to that, but even more useful because it allows every edge to be controlled as a combination of constant coordinate and fraction of parent.

So, if you are looking for a way to set an explicit coordinate for any widget, you’re going to have a really hard time without tweaking the very core of the way Slate arranges things on the screen.

By the way, we are currently working on exposing Slate to blueprints. The project is called UMG, and we’re well into it at this point.

Thank you for answer.
Thats a bit limiting, but i guess for a simplistic UI we need, its enough(I just wanted to develop a base for more complex GUIs :P)
I know about UMG i have seen its great progress in another forum post.
But from what i have read its still pretty unstable. Is there a scope on its alpha stages been officially released and enabled in editor by default anytime soon?

Could you explain what you find limiting about this?

Well given the alignment choices i am allowed to explore are basically the combination of top,bottom,centre,right,left anything other than these is either impossible or overly complicated to achieve.I am not allowed to micromanage any widget this way, say for example i want my buttons 10 pixels up and 4 pixels right from the centre, as i gather thats not something i can do unless i change the very logic behind slate.

Nah. You are totally allowed to do that. You’re allowed to micromanage them in two ways:

  1. Adjust padding using existing panels that allow it. (EDIT: this is most of them)
  2. Write a custom layout panel.

Writing a custom layout panel takes just a bit of time (especially the first time you do it), but it isn’t particularly hard. And that panel can have pass-through logic that just asks for X,Y,Width,Height and applies them to the widget. We actually have a panel like that (SCanvas) and it isn’t particularly useful in practice. And, as I mentioned, we are adding a better version of that panel in UMG.

BTW, we don’t use Pixels in Slate. Everything is specified in Slate Units (SU). This allows us to run Slate at different pixel-per-slate-unit ratios, which is required for supporting high DPI monitors.

It would be nice if somewhere in the docs you defined a slate unit.

You’re right! I am not sure I can immediately write a formal doc about this, but I figured this would help in the mean time: https://answers.unrealengine.com/questions/190770/what-are-slate-units.html