OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var api = (function() { | 5 var api = (function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Enumeration of scene update commands. | 9 * Enumeration of scene update commands. |
10 * @enum {number} | 10 * @enum {number} |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 this.xAnchoring = x; | 156 this.xAnchoring = x; |
157 this.yAnchoring = y; | 157 this.yAnchoring = y; |
158 } | 158 } |
159 | 159 |
160 /** | 160 /** |
161 * Visibility controls whether the element is rendered. | 161 * Visibility controls whether the element is rendered. |
162 */ | 162 */ |
163 setVisible(visible) { | 163 setVisible(visible) { |
164 this.visible = !!visible; | 164 this.visible = !!visible; |
165 } | 165 } |
| 166 |
| 167 /** |
| 168 * Hit-testable implies that the reticle will hit the element, if visible. |
| 169 */ |
| 170 setHitTestable(testable) { |
| 171 this.hitTestable = !!testable; |
| 172 } |
| 173 |
| 174 /** |
| 175 * Causes an element to be rendered relative to the field of view, rather |
| 176 * than the scene. Elements locked in this way should not have a parent. |
| 177 */ |
| 178 setLockToFieldOfView(locked) { |
| 179 this.lockToFov = !!locked; |
| 180 } |
166 }; | 181 }; |
167 | 182 |
168 /** | 183 /** |
169 * Represents a new UI element. This object builds on UiElementUpdate, | 184 * Represents a new UI element. This object builds on UiElementUpdate, |
170 * forcing the underlying texture coordinates to be specified. | 185 * forcing the underlying texture coordinates to be specified. |
171 */ | 186 */ |
172 class UiElement extends UiElementUpdate { | 187 class UiElement extends UiElementUpdate { |
173 /** | 188 /** |
174 * Constructor of UiElement. | 189 * Constructor of UiElement. |
175 * pixelX and pixelY values indicate the left upper corner; pixelWidth and | 190 * pixelX and pixelY values indicate the left upper corner; pixelWidth and |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 Action: Action, | 296 Action: Action, |
282 Mode: Mode, | 297 Mode: Mode, |
283 getContentElementId: getContentElementId, | 298 getContentElementId: getContentElementId, |
284 UiElement: UiElement, | 299 UiElement: UiElement, |
285 UiElementUpdate: UiElementUpdate, | 300 UiElementUpdate: UiElementUpdate, |
286 Animation: Animation, | 301 Animation: Animation, |
287 doAction: doAction, | 302 doAction: doAction, |
288 domLoaded: domLoaded, | 303 domLoaded: domLoaded, |
289 }; | 304 }; |
290 })(); | 305 })(); |
OLD | NEW |