Y offset for press space messages
-
- Posts: 30
- Joined: Sat Jan 19, 2019 2:14 pm
Y offset for press space messages
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?
Re: Y offset for press space messages
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.
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.
-
- Posts: 30
- Joined: Sat Jan 19, 2019 2:14 pm
Re: Y offset for press space messages
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.
Re: Y offset for press space messages
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.
Then remember to activate the Main Selector Panel child GameObject so you can see it.
-
- Posts: 30
- Joined: Sat Jan 19, 2019 2:14 pm
Re: Y offset for press space messages
I tried that too, but then I only see transforms and no borders or whatsoever. Nothing visible I can edit.
Re: Y offset for press space messages
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.
If that doesn't work, maybe the prefab itself got messed up. Try importing a fresh copy of that prefab from the Asset Store.
-
- Posts: 30
- Joined: Sat Jan 19, 2019 2:14 pm
Re: Y offset for press space messages
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.
Re: Y offset for press space messages
Here's an example of what it should look like:
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?
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?
-
- Posts: 30
- Joined: Sat Jan 19, 2019 2:14 pm
Re: Y offset for press space messages
This is what I see.
Re: Y offset for press space messages
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?