How to add image in dialogue
Re: How to add image in dialogue
Can you please post 2 screenshots: your dialogue UI's hierarchy, and the inspector view of your UnityUIDialogueUI.
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: How to add image in dialogue
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: How to add image in dialogue
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: How to add image in dialogue
Thanks for the screenshots. Okay, you're using UnityDialogueUI (legacy Unity GUI). These steps should do it:
1. Inspect the "Dialogue Window" GameObject.
2. Then select menu item GameObject > Create Other > Dialogue System > Unity GUI > Image. This will create a GUIImage that's a child of the Dialogue Window.
3. Assign your render texture to Image > Texture so you can see its contents. You may also need to fiddle with Image > Pixel Rect.
4. Adjust the Scaled Rect parameters to get the size and position you want. I recommend settings like the ones below. For this example, let's say the image is 128x128 pixels.
1. Inspect the "Dialogue Window" GameObject.
2. Then select menu item GameObject > Create Other > Dialogue System > Unity GUI > Image. This will create a GUIImage that's a child of the Dialogue Window.
3. Assign your render texture to Image > Texture so you can see its contents. You may also need to fiddle with Image > Pixel Rect.
4. Adjust the Scaled Rect parameters to get the size and position you want. I recommend settings like the ones below. For this example, let's say the image is 128x128 pixels.
- Origin: BottomRight
- Alignment: BottomRight
- X: -188, Pixel
- Y: -256, Pixel
- Width: 128, Pixel
- Height: 128, Pixel
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: How to add image in dialogue
I'm trying this but I'm not sure what this is supposed to do. I have a camera with a 3D object. It looks like the GUIimage only shows 2d texture image.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: How to add image in dialogue
Right-click in the Project view and select Create > Render Texture.
Then assign the render texture asset to your camera's Texture Target field and to the GUI Image's Image > Texture field.
Then assign the render texture asset to your camera's Texture Target field and to the GUI Image's Image > Texture field.
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: How to add image in dialogue
Well, I couldn't get it to work, but in the mean time I figured out that I really didn't want it showing over the top and it looked better off to the side. I'm not sure it's set up correctly, but it looks like it sorta works. When I scale the screen, the image stays in one place horizontally, but if I move the screen vertical it moves.
Is there a way to lock the position?
Is there a way to lock the position?
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: How to add image in dialogue
I'll put together an example scene today that uses a RenderTexture. I'll position it on the dialogue UI, but you'll be able to reposition it wherever you want.
- supadupa64
- Posts: 200
- Joined: Sun Mar 06, 2016 9:40 pm
- Contact:
Re: How to add image in dialogue
Alright good, because I just built a game to test it out and the little window was nowhere to be found.
Game I'm working on:
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Website: http://www.RuctionGames.com
Steam: http://store.steampowered.com/app/49682 ... en_Tablet/
Re: How to add image in dialogue
Here's an example: UnityDialogueUIRenderTexture_2016-05-02.unitypackage
It required a little script because I had forgotten that GUIImage accepts a Texture2D, and a RenderTexture is a Texture (not a Texture2D). The example scene is just the Feature Demo, except it uses the Necromancer GUI and shows a render texture of the computer terminal. It doesn't show or hide the render texture, but you can do that on your own using SetActive().
It required a little script because I had forgotten that GUIImage accepts a Texture2D, and a RenderTexture is a Texture (not a Texture2D). The example scene is just the Feature Demo, except it uses the Necromancer GUI and shows a render texture of the computer terminal. It doesn't show or hide the render texture, but you can do that on your own using SetActive().