Skip to content

Commit

Permalink
Event page: Add syntax section, remove table (#10431)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elchi3 authored Nov 10, 2021
1 parent f7b3115 commit 0d78979
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions files/en-us/web/api/xrlightprobe/reflectionchange_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,21 @@ browser-compat: api.XRLightProbe.reflectionchange_event
---
{{APIRef("WebXR Device API")}}

The WebXR **`reflectionchange`** event is passed to an {{domxref("XRLightProbe")}} each time the estimated reflection cube map changes. This happens in response to use movements through different lighting conditions or to direct changes to lighting itself.

<table class="properties">
<tbody>
<tr>
<th>Cancelable</th>
<td>No</td>
</tr>
<tr>
<th>Interface</th>
<td>{{domxref("Event")}}</td>
</tr>
<tr>
<th>Event handler property</th>
<td><code>onreflectionchange</code></td>
</tr>
</tbody>
</table>
The WebXR **`reflectionchange`** event fires each time the estimated reflection cube map changes. This happens in response to use movements through different lighting conditions or to direct changes to lighting itself. This event is not cancelable.

## Syntax

Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.

```js
addEventListener('reflectionchange', () => { });

onreflectionchange = event => { });
```

## Event type

{{domxref("Event")}}.

## Examples

Expand All @@ -56,8 +52,6 @@ lightProbe.addEventListener('reflectionchange', () => {
The `reflectionchange` event is also available using the `onreflectionchange` event handler property.

```js
const glBinding = new XRWebGLBinding(xrSession, gl);

lightProbe.onreflectionchange = event => {
glCubeMap = glBinding.getReflectionCubeMap(lightProbe);
});
Expand Down

0 comments on commit 0d78979

Please sign in to comment.