Y offset for press space messages

Announcements, support questions, and discussion for the Dialogue System.
Dragonception
Posts: 30
Joined: Sat Jan 19, 2019 2:14 pm

Y offset for press space messages

Post by Dragonception »

I've chosen Upper Center for the "press space" message that appears on On Use, but it's now displayed right on top of another UI element (not related to Dialogue). We need an extra offset (X and Y I guess). Is that possible?
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Y offset for press space messages

Post by Tony Li »

Sure! If the "press space" UI for the Selector/ProximitySelector component isn't visible at design time, then the Dialogue Manager's Instantiate Prefabs component probably instantiates it at runtime.

Inspect your Dialogue Manager's Instantiate Prefabs component. The first element in the Prefabs list is probably "Basic Standard UI Selector Elements". Add this to the scene as a child of the Dialogue Manager's Canvas.

Then activate its child named Main Selector Panel so you can see it. Customize its appearance to your liking. Finally, save it as a new prefab, and assign that prefab to Instantiate Prefabs instead of Basic Standard UI Selector Elements, and delete it from the scene. Or, if you prefer to leave it in the scene, just delete the element from Instantiate Prefabs.
Dragonception
Posts: 30
Joined: Sat Jan 19, 2019 2:14 pm

Re: Y offset for press space messages

Post by Dragonception »

When I drag the Basic Standard UI Selector Element to the Scene, I see very little: just a vertical white thin line. There's nothing I can customize, and it doesn't seem related to the Press Space message at all.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Y offset for press space messages

Post by Tony Li »

Are you adding it directly as a child of the Dialogue Manager's Canvas? Try dragging it onto the Canvas in the Hierarchy window. Don't release the mouse button until the mouse cursor has highlighted the Canvas. If you add a UI prefab to a scene outside of a Canvas, it will mess up its Rect Transform settings.

Then remember to activate the Main Selector Panel child GameObject so you can see it.
Dragonception
Posts: 30
Joined: Sat Jan 19, 2019 2:14 pm

Re: Y offset for press space messages

Post by Dragonception »

I tried that too, but then I only see transforms and no borders or whatsoever. Nothing visible I can edit.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Y offset for press space messages

Post by Tony Li »

Maybe something funny is going on with your canvas. Try creating a new, plain, Screen Space - Overlay Canvas by selecting menu item GameObject > UI > Canvas. Then drag the Basic Standard UI Selector Elements prefab onto that Canvas in the Hierarchy.

If that doesn't work, maybe the prefab itself got messed up. Try importing a fresh copy of that prefab from the Asset Store.
Dragonception
Posts: 30
Joined: Sat Jan 19, 2019 2:14 pm

Re: Y offset for press space messages

Post by Dragonception »

None of this works. Reimporting the asset, dragging it to a new canvas gives the same result: all I see is arrows for dragging transforms, but nowhere do I see a square, border or something that tells me where the actual text is going to be displayed.
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Y offset for press space messages

Post by Tony Li »

Here's an example of what it should look like:

Image

I used these steps:

1. Created a new, empty scene.
2. Added the Dialogue Manager prefab.
3. Added the Basic Standard UI Selector Elements prefab to the Dialogue Manager's Canvas.
4. Activated the Main Selector Panel child GameObject.

Can you try this in a new, empty project?
Dragonception
Posts: 30
Joined: Sat Jan 19, 2019 2:14 pm

Re: Y offset for press space messages

Post by Dragonception »

This is what I see.

Image
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Y offset for press space messages

Post by Tony Li »

That actually looks right so far. The blue circles indicate the bounds, which cover the whole screen. Have you activated the Main Selector Panel GameObject yet?
Post Reply