Update API.md

This commit is contained in:
Tomas 2020-04-22 11:02:32 +02:00 committed by GitHub
parent 5a7f51d29f
commit e22ea1b6d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
API.md
View File

@ -185,13 +185,14 @@ is a `<select>` dropdown.
| --- | --- | --- |
| object | <code>Object</code> | The object to be manipulated |
| property | <code>String</code> | The name of the property to be manipulated |
| values | <code>Array</code> | Array of possible options' values |
| values | <code>Array|Object</code> | Array or Dictionary of possible options' values |
**Example**
```js
// Add a dropdown controller.
var person = {name: 'Sam'};
gui.add(person, 'name', ['Sam', 'Alex', 'Riley']);
gui.add(person, 'name', ['Sam', 'Alex', 'Ray']);
gui.add(person, 'name', {'Sam': 'Sammy', 'Alex': 'Alexis', 'Ray': 'Riley']);
```
<a name="GUI+addColor"></a>