---
title: Gate
slug: gate
description: Learn about the diverse variables, methods, and events associated with gates in VPX through this comprehensive document. Discover essential details on gate properties, such as name, position, size, rotation, timer settings, material, elasticity, friction,
createdAt: 2019-11-29T05:19:55.000Z
---

## Variables

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

| Call                 | Detail                                                                                                                                                                                    | Example |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| Name(string)         |                                                                                                                                                                                           |         |
| X(float)             |                                                                                                                                                                                           |         |
| Y(float)             |                                                                                                                                                                                           |         |
| Length(float)        |                                                                                                                                                                                           |         |
| Height(float)        |                                                                                                                                                                                           |         |
| Rotation(float)      |                                                                                                                                                                                           |         |
| 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)                 |         |
| Open(bool)           |                                                                                                                                                                                           |         |
| Material(string)     |                                                                                                                                                                                           |         |
| Elasticity(float)    |                                                                                                                                                                                           |         |
| Surface(string)      |                                                                                                                                                                                           |         |
| UserValue(any)       | can store any user defined value for re-use later-on                                                                                                                                      |         |
| CloseAngle(float)    |                                                                                                                                                                                           |         |
| OpenAngle(float)     |                                                                                                                                                                                           |         |
| Collidable(bool)     |                                                                                                                                                                                           |         |
| Friction(float)      | 0..1                                                                                                                                                                                      |         |
| Damping(float)       |  How quickly the gate's momentum dissipates.  High values with low gravity factor will seem like they don't move freely.    High values with high gravity factor will move very rapidly.  |         |
| Visible(bool)        |                                                                                                                                                                                           |         |
| ShowBracket(bool)    |                                                                                                                                                                                           |         |
| CurrentAngle(float)  | only readable, it returns the current open angle                                                                                                                                          |         |
| GravityFactor(float) | How "heavy" the gate is.   Usually between 1..3.   Use this in combination with adjusting the damping value to get appropriate swinging action.                                           |         |

## Methods

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

| Call                                    | Detail   | Example |
| --------------------------------------- | -------- | ------- |
| Move(int dir, float speed, float angle) | dir(0/1) |         |

## Events

| Event   | Detail | Example |
| ------- | ------ | ------- |
| \_Init  |        |         |
| \_Timer |        |         |
| \_Hit   |        |         |
| \_EOS   |        |         |
| \_BOS   |        |         |

```javascript
        dispinterface IGateEvents
        {
        properties:
        methods:
                [id(DISPID_GameEvents_Init)]  void Init();
                [id(DISPID_TimerEvents_Timer)]  void Timer();
                [id(DISPID_HitEvents_Hit)]  void Hit();
                [id(DISPID_LimitEvents_EOS)]  void LimitEOS( [in] float parm);
                [id(DISPID_LimitEvents_BOS)]  void LimitBOS( [in] float parm);
        }
```

