From 10dd7ab70f9a07940eec1abdc7da365fc11a1695 Mon Sep 17 00:00:00 2001 From: Markus Hofer Date: Tue, 24 Aug 2021 16:30:09 +1200 Subject: [PATCH] Added information about app.elements.byName this change relates to enkluplayer pull request 523 https://github.com/enklu/enkluplayer/pull/523 --- docs/API/App.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/API/App.md b/docs/API/App.md index 0dd26f64..cdd234be 100644 --- a/docs/API/App.md +++ b/docs/API/App.md @@ -25,12 +25,15 @@ var root = app.scenes.root('myScene'); The elements object can be used to query all scenes for an element, create elements, or destroy them. -Retrieves element: +Retrieves an element by its id: ```js button = app.elements.byId('specific-id'); ``` -
+Retrieves an element by name: +```js +button = app.elements.byName('Button'); +``` Creates element as a child of another: ```js @@ -38,15 +41,11 @@ var a = app.elements.create(root, 'Button'); var b = app.elements.create(a, 'Button', 'specific-id'); ``` -
- Creates elements from a vine, as a child of a: ```js var c = app.elements.createFromVine(a, ''); ``` -
- Destroys an element: ```js app.elements.destroy(button);