---
title: Light
slug: light
description: Learn about the variables, methods, and events associated with lights in VPX, including settings for name, position, shape, brightness, and color. Discover the duration method for transitioning between states and the initialization and timer events. Enhan
docTags: 
createdAt: 2019-11-29T05:20:25.000Z
---

## Variables

*Variables are items in vpx you can set, adjust or call.*

| Call                        | Detail                                                                                                                                                                    | Example |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| Name(string)                |                                                                                                                                                                           |         |
| X(float)                    |                                                                                                                                                                           |         |
| Y(float)                    |                                                                                                                                                                           |         |
| Shape(Shape)                | 0=Circle, 1=Custom                                                                                                                                                        |         |
| Falloff(float)              |                                                                                                                                                                           |         |
| FalloffPower(float)         |                                                                                                                                                                           |         |
| State(LightState)           | 0=Off, 1=On, 2=Blinking                                                                                                                                                   |         |
| Color(OLE\_COLOR)           | 'normal' color                                                                                                                                                            |         |
| ColorFull(OLE\_COLOR)       | full brightness color                                                                                                                                                     |         |
| Intensity(float)            | sets the lights brightness/emission                                                                                                                                       |         |
| IntensityScale(float)       | sets the lights brightness/emission scale, so that one can fade in/out all affected lights with the same scaling factor                                                   |         |
| TransmissionScale(float)    | sets the light scale for transmission, f.e. through playfield plastics or transparent ramps that are placed above the bulb light                                          |         |
| TimerEnabled(bool)          |                                                                                                                                                                           |         |
| TimerInterval(int)          | set interval for triggering the timer (1 equals 1000 timer calls per second, 1000 equals 1 timer call per second, -1 makes it dependent on the FPS that a user can reach) |         |
| BlinkPattern(string)        | off/on pattern for the light to use while the interval is going: 1 is ON, 0 is OFF, for example 111000111000101010101                                                     |         |
| BlinkInterval(int)          |                                                                                                                                                                           |         |
| Surface(string)             |                                                                                                                                                                           |         |
| UserValue(any)              | can store any user defined value for re-use later-on                                                                                                                      |         |
| Image(string)               |                                                                                                                                                                           |         |
| ImageMode(bool)             | if true, passthrough Image (as if it would be fully emissive), otherwise light image with global lighting using the attached Surface material                             |         |
| DepthBias(float)            |                                                                                                                                                                           |         |
| FadeSpeedUp(float)          | speed to fade into on state                                                                                                                                               |         |
| FadeSpeedDown(float)        | speed to fade into off state                                                                                                                                              |         |
| Bulb(bool)                  |                                                                                                                                                                           |         |
| ShowBulbMesh(bool)          |                                                                                                                                                                           |         |
| StaticBulbMesh(bool)        |                                                                                                                                                                           |         |
| ShowReflectionOnBall(bool)  | in bulb mode, en/disable the reflection of the bulb on balls                                                                                                              |         |
| ScaleBulbMesh(float)        |                                                                                                                                                                           |         |
| BulbModulateVsAdd(float)    | blends between modulating and additive when bulb is enabled (0..1)                                                                                                        |         |
| BulbHaloHeight(float)       | sets the halo height of a bulb light                                                                                                                                      |         |
| Visible(bool)               |                                                                                                                                                                           |         |

## Methods

*Methods are procedures or actions that you can fire in VPX.*

| Call                                                      | Detail                                                                                                                                                     | Example                                                                               |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| Duration(int startState, int durationTime, int endState)  | starts a light in startState and leaves it into that state for the amount of milliseconds defined by durationTime until the light switches to the endState | light1.Duration 2, 1000, 1 (light starts to blink for 1000ms and then switches to ON) |
|                                                           |                                                                                                                                                            |                                                                                       |

## Events

| Event   | Detail | Example |
| ------- | ------ | ------- |
| \_Init  |        |         |
| \_Timer |        |         |
|         |        |         |

```javascript
        dispinterface ILightEvents
        {
        properties:
        methods:
                [id(DISPID_GameEvents_Init)]  void Init();
                [id(DISPID_TimerEvents_Timer)]  void Timer();
        }
```

