Páginas

sábado, 24 de enero de 2015

QIM User Manual

QIM User Manual v1.2.1
by
Lara Brothers
(Roman Lara & Humberto Lara)


Fri, 27 Mar 2015
Available in Unity Asset Store.

QIM is the new way in which the different Unity inputs and controllers for your project are defined. You will notice it is very similar to the Unity Input Manager. This is in order for you to adapt easily to QIM.

After trying it, you will have no need for any other.

QIM allows you to keep each input organized in a controller, change the order and delete any input you choose (something the Unity Input Manager cannot do); and if you do not remember the names of the buttons of a gamepad or keyboard or a mouse, QIM provides maps where you can establish them with just one click.


Main toolbar

You will find the main toolbar on the top of the window and it is where the different controls for your project are defined.


The first button “New”, on the left side of the window, will display a menu in which you can choose between 3 options for your controller: Keyboard and Mouse, Generic Joystick and Joystick.


Keyboard and Mouse option: Prepares a controller ready to be loaded with keyboard and mouse button inputs. This option can only be created once. The representing icon is:


Generic Joystick option: Prepares a controller ready to be loaded with generic joystick inputs. This controller works for single-player games with a single joystick, meaning that no matter how many joysticks are connected to the computer, each one will respond for all. This option can only be created once. The representing icon is:


Joystick option: Prepares a controller ready to be loaded with specific joystick inputs. This controller works for multi-player games, meaning that, unlike the generic joystick option, each controller will respond for itself and not for the rest of them. This option can be created up to 11 times (Unity supported amount). The representing icon is:


Moving on, the following button is “+”, which creates the inputs according to the selected controller; meaning that if you choose “joystick 1” and press the “+” button, the new input will be added to that controller.

The controllers

The controllers are items that allow you to keep your inputs organized. They can be selected by using the left click button on the mouse to display the inputs that each one has. The right click button of the mouse also displays a menu where you can do the following:


Copy: Copies all the inputs of that controller.

Paste: Pastes all the previously copied inputs to the controller you right-clicked on. It only works if there is a controller copied in the QIM clipboard.

Fold inputs: Folds all entries to hide their contents.

Deploy inputs: Displays all entries to view their contents.

Remove: Removes the controller.

The inputs

The inputs are items that store the button values, keys or axis organized by name.


When an input is created, it will look as in the above image. It means the following: 

Triangle: displays or hides the input values.

No Name: indicates the input has no name. It is recommended to write something and not leave it with the “No Name” value.


Pincel icon: opens a window in which you can change the input name.


This window allows you to change the input name by writing in the text field. To apply the change, press the “Done” button or “Return” on your keyboard.

The gear icon displays a menu in which you can do the following:


Copy: Copies the input values.

Paste: Pastes all the previously copied inputs. It only works if there is a previously copied input in the QIM clipboard.

Move Up: Moves the input up one position, if it is not the first on the list.

Move Down: Moves the input down one position, if it is not the last on the list.

Finally, the cross icon deletes the input.

Input values

These fields are very similar to the Unity Input Manager. Therefore, it knows mostly everything. Otherwise, here are their meanings: http://docs.unity3d.com/Manual/class-InputManager.html.

However, QIM adds extra functions that help make things easier. 


These extra functions are buttons that are located next to: Negative Button, Positive Button, Alt Negative Button, Alt Positive Button and Axis: Map and Del.

Map: Opens the map window where you can select the field value.

Del (Delete): Removes field value.

The Gravity, Dead and Sensitivity fields also have extra functions.

This selection field´s purpose is to fill the previous field with default or common values.

The map window

Basically, all maps work in the same way. Therefore, we will give you the example of an Xbox 360 controller.


Before choosing a button or axis, we will explain the toolbar options. The “Type” button, on the left, displays a menu with 3 options: Keyboard, Mouse and Joystick.


Keyboard: Changes the current map for the English keyboard map.

Mouse: Changes the current map for the mouse map.

Joystick: Changes the current map for the joystick map.

The following button “Gamepad” is only on the joystick map. This button displays a menu in which you can change the gamepad type. You can choose between: Xbox 360, PS3 and Generic. In the place of the keyboard map, there`s the size button, which displays a menu in which you can change the map`s dimensions: Small, Middle and Great. There`s no button like this for the mouse map. 

Moving on, the following item is the space where the image reads “Generic Joystick : Fire 1 : Positive Button”, the purpose of this text is to remind you which type of controller (Generic Joystick), which input (Fire 1) and to which field (Positive Button) the value will be added to after choosing a button, key or axis on the map.

Finally, there is the “Slow Hotspots” button (which will probably be deleted in the future) displays the map interactive areas. E.g., it displays bluish boxes which show the events on the map. It is possible that they will appear in the correct place due to the type of screen or a processing conflict.

Next is the explanation on now to choose a value for your input field.

To assign a value, all you need to do is left-click in any of the map`s interactive areas. For example, if you left-click on the red button that corresponds to the “B” button on the Xbox 360 gamepad, the “joystick button 1” will be assigned to the Positive Button field. Some interactive areas can have more than one value. Take for example the ones with 2 values, like the “equals” key that delivers the “equals” value with a left-click and delivers the “plus” value with a right-click. There`s also some with 3 values or more, like the Left Analog Joystick and the Right Analog Joystick or the Print key, where the most common value is established with a left-click and the other 2 are established with a menu that is displayed with a right-click.


In the above image, a right-click displayed a menu over the left analog joystick with the “Left Analog X” and “Left Analog Y” options (if you right-click, it would deliver the “joystick button 8” value). However, if you erroneously select between a value for a button or for an axis, QIM will remind you what type of value you need to assign:


and vice versa, if you assign a button in an axis field:


Options / Templates

The options are on the second toolbox, under the main window.


This button displays a menu where you can choose a template and open the About Quim window.

The Templates option has a sub-menu where you can choose a template created by us or by yourself. To do this you will be required to create a controller, as previously explained, and then choose the Templates-> Save option, then a window will appear in which you will write the name that the screen will be saved with, QIM will save it in a file inside the Assets/Quim/Templates folder in the Unity project view (you must refresh to view it). This way you will see it added to the menu list.


To delete a template, just erase it from the Templates folder, the same way as you erase any file from the Unity Editor.

How to save your work and apply the inputs to the Unity Input Manager.

You can save your work by clicking on the File -> Save Scene menu of the Unity editor, this will create a file outside the Asset folder called QuickInputManager.xml, in a folder called QIM; afterwards, QIM will replace the InputManager.asset Unity file.

Important Note: To save the data in QuickInputManager.xml and apply it in InputManager.asset, you will need to be working in a previously saved scene of your project, since the File -> Save Scene As… menu is not detected: therefore, always  save with the File -> Save Scene menu, having a previously saved scene.

How to use the Unity inputs

You can access the same way you do so with Unity:


One thing should be clear: In each of the names on the Specifid Joystick inputs, QIM assigns an extra string with a space (like “J1” or “J2”), followed by the text you wrote: “J1 Turning” for Joystick 1, “J2 Turning” for Joystick 2, etc. as seen in the below image:


This means that in order to access a controller input, the code must look like Input.GetAxis (“J1 Turning”) with a space between the “J1” and “Turning” like “J1[space]Turning”. This is not the same for the Keyboard and Mouse controllers or Generic Joystick controller, in these cases it is normal, as Input.GetAxis(“Turning”).

QIM also supports Unity and Unity Pro, and is compatible with Unity 5:


Have fun!

Available in Unity Asset Store.

viernes, 25 de abril de 2014

Directory Finder Widget

v2.1          Available in Unity Asset Store.

Directory Finder Widget is a widget created to NGUI and Unity UI. This is a file explorer which searches folders and files.

You can use to find certain files such as text, xml, audio, video, etc., and save the file path to load the same next time.

For NGUI: Next-Gen UI

How to use?

Exist one prefab to use, the DirectoryFinderWidget_NGUI prefab. This prefab is the widget that you will use.

Using the prefab

The prefabs are a shortcut to use the widget a very fast way, or to find out how the widget is done and make your own widget with an appearance different and/or with other disposition.

DirectoryFinderWidget

The DirectoryFinderWidget_NGUI prefab is the window or dialog that you will use in the scene. Has as component the following script.


The NGUIDirectoryFinderController script is a controller of the widget, in this version are not the necessary component properties, now set by script, don’t worry it's very simple. Left me explain you.

You have access to properties end events by ListenerFinder class. Between the properties you can set a initial location using the initialPath property:

ListenerFinder.initialPath = Application.dataPath;

Also if it wants looking for the files, you can set the findFiles property:

ListenerFinder.findFiles = true;

To show the path on the interface, you can set showPath property:

ListenerFinder.showPath = true;

Between the events you have at your disposal the following methods listeners:

// The listener of the back button event.
public void OnBack (string previousPath, string pathToLookFor) {
   // previousPath : the previous path prior to the event.
   // pathToLookFor : the new path after to the event.
}

// The listener of the open button event.
public void OnOpen (string previousPath, string pathToLookFor) {
   // previousPath : the previous path prior to the event.
   // pathToLookFor : the new path after to the event.
}

// The listener of the choose button event.
public void OnChoose (string name, string path) {
   // name : the selected item name.
   // path : the selected item path.
}

// The listener of the drive selection.
public void OnSelectedItemDrive (string name, string path) {
   // name : the selected drive item name.
   // path : the selected drive item path.
}

// The listener of the item (file or folder) selection.
public void OnSelectionItem (string name, string path) {
   // name : the selected item name.
   // path : the selected item path.
}

However, to that this methods work it's necessary assign them in the following properties to execute them, you can locate them in the Start method:

public void Start () {
   // The listeners of the buttons
   ListenerFinder.OnBack = new ListenerFinder.ListenerBackButton(OnBack);
   ListenerFinder.OnOpen = new ListenerFinder.ListenerOpenButton(OnOpen);
   ListenerFinder.OnChoose = new ListenerFinder.ListenerChooseButton(OnChoose);

   // The listeners of the item selection
   ListenerFinder.OnSelectionItemDrive = new ListenerFinder.ListenerSelectedItemDrive(OnSelectedItemDrive);
   ListenerFinder.OnSelectedItem = new ListenerFinder.ListenerSelectedItem(OnSelectedItem);
}

How to change the appearance?

If you know to use NGUI, you probably know how to do. But, is important know the structure of the elements that can be changed and avoiding an unwanted mess.

The Hierarchy

All the elements be found inside the Window[Panel] game object, thus it is easer for usability, and to change the appearance and the elements disposition, without break the hierarchy. In the first place we go to see the labels that you can change.

Labels

  • Title[Label]: Inside the Header game object is the Title[Label] label, this corresponds to the name or title of the window or dialog that currently is "Directory Finder Widget for NGUI". You can change the text of the label.
  • Info[Label]: This is the information message detailing the cause of dialogue for the player. You can change the text of the label.
  • Label inside Drives UI: This label is located inside the Drives[Panel]/Drives UI/Label hierarchy, it specifies the name of the Drives[Popup List] which shows the drives found in the player's machine. You only can change the label that is inside Drives UI, and not the Label that is inside Drives[Popup List].
  • BackButton, OpenButton and ChooseButton: Last, you can change the text of the label elements inside each this buttons.
Note: It is not advisable change the text of the labels ItemSelected[Label] and Path[Label] that is inside Footer. Neither the ItemName[Label] label that is inside ItemF0.

Now we go to see what can we to change for using other atlas.

Sprites

  • Background[Sprite]: You can change the color and the sprite with your own NGUI's atlas. This sprite corresponds to dialog background and delimits the widget dimensions. If you need change the widget size, you do it about this game object, because all elements are anchored to him.
  • Border[Sprite]: To this appearance is the widget frame and you can change it, and too you can remove it, if your UI style is different.
  • Shadow[Sprite]: You can change the appearance or remove it.
  • Header: This sprite corresponds to the base of the widget title. You can change the appearance.
  • Footer: This sprite corresponds to the path data, that if you not need it, you can hide it, only hide it.
  • BackButton, OpenButton, ChooseButton and Drives[Popup List]: You can change the colors and the appearance of this interface.
  • Background and Foreground inside Scroll Bar[Panel]: You can change the appearance with your own NGUI's atlas.
  • ItemF0 inside Scroll View[Panel]: You can change the colors.
  • Checkmark and Hover inside ItemF0: You can change the colors and the appearance.
  • FileIcon[Sprite] and FolderIcon[Sprite] inside ItemF0: You can change the colors and the appearance with other icons.
  • All labels: You can change the font and the colors, what allow NGUI.

For Unity UI 4.6 or higher

How to use?

Exist one prefab to use, the DirectoryFinderWidget_Unity prefab. This prefab is the widget that you will use.

Using the prefab

The prefabs are a shortcut to use the widget a very fast way, or to find out how the widget is done and make your own widget with an appearance different and/or with other disposition.

DirectoryFinderWidget

The DirectoryFinderWidget_Unity prefab is the window or dialog that you will use in the scene. Has as component the following script.


The DFWDirectoryFinderController script is a controller of the widget, in this version are not the necessary component properties, now set by script, don’t worry it's very simple. Left me explain you.

You have access to properties end events by ListenerFinder class. Between the properties you can set a initial location using the initialPath property:

ListenerFinder.initialPath = Application.dataPath;

Also if it wants looking for the files, you can set the findFiles property:

ListenerFinder.findFiles = true;

To show the path on the interface, you can set showPath property:

ListenerFinder.showPath = true;

Between the events you have at your disposal the following methods listeners:

// The listener of the back button event.
public void OnBack (string previousPath, string pathToLookFor) {
   // previousPath : the previous path prior to the event.
   // pathToLookFor : the new path after to the event.
}

// The listener of the open button event.
public void OnOpen (string previousPath, string pathToLookFor) {
   // previousPath : the previous path prior to the event.
   // pathToLookFor : the new path after to the event.
}

// The listener of the choose button event.
public void OnChoose (string name, string path) {
   // name : the selected item name.
   // path : the selected item path.
}

// The listener of the drive selection.
public void OnSelectedItemDrive (string name, string path) {
   // name : the selected drive item name.
   // path : the selected drive item path.
}

// The listener of the item (file or folder) selection.
public void OnSelectionItem (string name, string path) {
   // name : the selected item name.
   // path : the selected item path.
}

However, to that this methods work it's necessary assign them in the following properties to execute them, you can locate them in the Start method:

public void Start () {
   // The listeners of the buttons
   ListenerFinder.OnBack = new ListenerFinder.ListenerBackButton(OnBack);
   ListenerFinder.OnOpen = new ListenerFinder.ListenerOpenButton(OnOpen);
   ListenerFinder.OnChoose = new ListenerFinder.ListenerChooseButton(OnChoose);

   // The listeners of the item selection
   ListenerFinder.OnSelectionItemDrive = new ListenerFinder.ListenerSelectedItemDrive(OnSelectedItemDrive);
   ListenerFinder.OnSelectedItem = new ListenerFinder.ListenerSelectedItem(OnSelectedItem);
}

How to change the appearance?

If you know to use Unity UI, you probably know how to do. But, is important know the structure of the elements that can be changed and avoiding an unwanted mess. 

The Hierarchy

All the elements be found inside the DirectoryFinderWidget_Unity game object, thus it is easier for usability, and to change the appearance and the elements disposition, without break the hierarchy. In the first place we go to see the labels that you can change.

Labels

  • Title: Inside the Header game object is the Title text, this corresponds to the name or title of the window or dialog that currently is “Directory Finder Widget for Unity UI 4.6”. You can change the text of the label.
  • Info: This is the information message detailing the cause of dialogue for the player. You can change the text of the label.
  • DriveLabel: This label specifies the name of the DrivesSelectionList which shows the drives found in the player’s machine. You only can change this DriveLabel text, and none Text object that is inside DrivesSelectionList.
  • BackButton, OpenButton and ChooseButton: For last, you can change the text of the elements inside each this buttons.
Note: It is not advisable change the text of the objects ItemSelected and Path (this is inside Footer). Neither the ItemName text that is inside Container/ItemF0, as also the Text that is inside DriveSelectionList/ScrollRect/Item0.

Now we go to see what can we to change for using other sprites.

Sprites

  • DirectoryFinderWidget_Unity: You can change the appearance with your own sprites of your project. This sprite corresponds to the dialog background and delimits the widget dimensions. If you need change the widget size, you do it about this game object, because all elements are anchored to him.
  • Border: To this appearance is the widget frame and you can change it, and too you can remove it, if your UI style is different.
  • Shadow: You can change the appearance or remove it.
  • Header: This sprite corresponds to the base of the widget title. You can change the appearance.
  • Footer: This sprite corresponds to the path data, that if you not need it, you can hide it, ¡only hide it!
  • BackButton, OpenButton, ChooseButton and DrivesSelectionList/Button: You can change the appearance of this interfaces.
  • All Scrollbars inside Container/Scrollbar and DriveSelectionList/ScrollRect/Scrollbar: You can change the appearance of the interface.
  • Container: You can change the appearance with your own sprites
  • ItemF0 inside Container and Item0 inside DriveSelectionList/ScrollRect: You can change the appearance.
  • Checkmark inside ItemF0: You can change the appearance.
  • FileIcon and FolderIcon inside ItemF0: You can change the appearance with other icons.
  • ScrollRect inside DriveSelectionList: You can change the appearance.
  • All labels: You can change the font, the colors, until add a effect.
Note Important: Please do not modify any of the events assigned to all the elements that use them.

Thank you for read the manual. Have fun!

Available in Unity Asset Store.