wiki.sine.space | sinespace

Difference between revisions of "Modular Vendors"

From wiki.sine.space
Jump to: navigation, search
Line 51: Line 51:
  
 
Right click in your heirarchy again and choose UI>RawImage. Drag the RawImage until it is between the Item Description and Gold Label. The RawImage Script will hold the image of the item which is for sale.
 
Right click in your heirarchy again and choose UI>RawImage. Drag the RawImage until it is between the Item Description and Gold Label. The RawImage Script will hold the image of the item which is for sale.
 +
 +
 +
==Positioning the text==
 +
 +
You will need to lay out the text on the panel to make sure it is readable and also has space for the rawimage. You can move the boxes around with the normal move tool, but to scale the text box, you will need to use the rect transform tool.
 +
 +
To resize the text, you will need to change the size in the Text script.
 +
 +
 +
[[File:Textsize.jpg]]
 +
 +
Make sure Best Fit is ticked, and set the min to 9, and max to 96. That is the optimal size for the text as it will be readable.
 +
 +
Here is a screenshot of the best layout:
 +
 +
 +
[[File:Vendorlayout.jpg]]

Revision as of 13:34, 22 August 2017

EDITING IN PROGRESS

We have added some new vendors to our features, and these vendors are called modular vendors. Modular vendors are vendors which can be placed in your region, and act like a clickable shop. Other users can click on the object the modular vendor script is attached to, and browse through the items you have on sale. You can have an individual modular vendor, which will only display and sell one item, or you can use a catalogue modular vendor, which will allow you to display and sell items from a specific collection, range or line.


Adding the modular vendor to your region

To add the modular vendor to your region, you need to add it into the region scene where you want the vendor to be.

For the vendor script to work, you need to attach it to an object in the scene. Make a new 3D object, such as a cube, by right clicking in the hierarchy, and choose 3D Object>Cube. Place the cube where you want it to be in your region.


Setting up for the modular vendor

Right click in your hierarchy, go to UI>Canvas. This canvas will be used in conjunction with a panel for displaying the information about your item/items.

Drag the canvas in the hierarchy into your cube. Under the Inspector window, make sure the Canvas script Render Mode is set to World Space.

In the hierarchy, right click, go to UI>Panel. The panel should automatically be under the cube in the hierarchy. Next, you need to resize the canvas so it fits the cube. To resize it, you can use the Scale tool in the top toolbar. Scale it down until it looks something like this:


Canvassize.jpg


After the resizing, you can customize the color of the panel. You can do this by clicking on the Panel in the hierarchy, and going to the Image Script under the Inspector Window.


Panel-color.jpg


Now you need to add a few Text scripts and a RawImage script into your heirarchy. Right click in the heirarchy, and choose UI>Text. This will automatically be placed as a child object of the cube. Duplicate this text script by right clicking on it, and duplicate until you have six Text scripts. Rename your Text scripts in the heirarchy by clicking on the Text script, and go to the Object Name box at the top of the Inspector Window.


Object-name.jpg

Rename your texts like this:

  • Item Name
  • Item Description
  • Gold Label
  • Gold Price
  • Silver Label
  • Silver Price

You will also need to add these titles to the actual text script as well by changing the text in the Text Script in the Inspector Window. When you name the Gold Label and Silver Label in the Text Script, name them as Gold Price and Silver Price, as the actual digits of the price need to go under the texts you named as Gold Price and Silver Price in the hierarchy. There will be a screenshot of this later on.


Textscript.jpg


Right click in your heirarchy again and choose UI>RawImage. Drag the RawImage until it is between the Item Description and Gold Label. The RawImage Script will hold the image of the item which is for sale.


Positioning the text

You will need to lay out the text on the panel to make sure it is readable and also has space for the rawimage. You can move the boxes around with the normal move tool, but to scale the text box, you will need to use the rect transform tool.

To resize the text, you will need to change the size in the Text script.


Textsize.jpg

Make sure Best Fit is ticked, and set the min to 9, and max to 96. That is the optimal size for the text as it will be readable.

Here is a screenshot of the best layout:


Vendorlayout.jpg