aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/gamepad_api/index.html
blob: ea16ef2b623cdc7659637d5fdd8bce18d395321a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
title: Gamepad API
slug: Web/API/Gamepad_API
tags:
  - API
  - Experimental
  - Gamepad API
  - juegos
translation_of: Web/API/Gamepad_API
---
<div>{{DefaultAPISidebar("Gamepad API")}}</div>

<p><strong>Gamepad API</strong> es la manera de los desarrolladores de acceder y responder a las señales de los gamepads y otros controles para juegos de una manera simple y consistente. Éste contiene tres interfaces, dos eventos y una función especializada, para responder a los gamepads siendo conectados y desconectados, y acceder a otra información sobre los mismos gamepads, y que botones y otros controles están siendo presionados.</p>

<h2 id="Interfaces">Interfaces</h2>

<dl>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/API/Gamepad" title="The Gamepad interface of the Gamepad API defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id."><code>Gamepad</code></a></dt>
 <dd>Representa un gamepad/control conectado a la computadora.</dd>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/API/GamepadButton" title="The GamepadButton interface defines an individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device."><code>GamepadButton</code></a></dt>
 <dd>Representa un botón en uno de los gamepads conectados.</dd>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/API/GamepadEvent" title="The GamepadEvent interface of the Gamepad API contains references to gamepads connected to the system, which is what the gamepad events Window.gamepadconnected and Window.gamepaddisconnected are fired in response to."><code>GamepadEvent</code></a></dt>
 <dd>El evento objeto representa eventos que son enviados a los gamepads.</dd>
</dl>

<h3 id="Extensiones_experimentales_de_los_gamepads">Extensiones experimentales de los gamepads</h3>

<dl>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/API/GamepadHapticActuator" title="The GamepadHapticActuator interface of the Gamepad API represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware."><code>GamepadHapticActuator</code></a></dt>
 <dd>Representa el hardware en el control designado para proveer retroalimentación háptica al usuario (si está disponible), más comunmente hardware de vibración.</dd>
 <dt><a href="https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose" title="The GamepadPose interface of the Gamepad API represents the pose of a WebVR controller at a given timestamp (which includes orientation, position, velocity, and acceleration information.)"><code>GamepadPose</code></a></dt>
 <dd>Representa la posición de un control (ej. posición y orientación el espacio 3D) en el caso de un controllador <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebVR_API">WebVR</a>. Éste no es usado por el nuevo estándar <a href="/en-US/docs/Web/API/WebXR_Device_API">WebXR</a>.</dd>
</dl>

<p>Ver también las <a href="https://developer.mozilla.org/en-US/docs/Web/API/Gamepad#Experimental_extensions_to_Gamepad">extensiones para la interfaz del navegador</a>, para caracteristicas que le permitan acceder a la información mencionada.</p>

<h3 id="Extensiones_y_otras_interfaces">Extensiones y otras interfaces</h3>

<h4 id="Navigator">Navigator</h4>

<dl>
 <dt>{{domxref("Navigator.getGamepads()")}}</dt>
 <dd>Una extensión a el objeto {{domxref("Navigator")}} que devuelve un arreglo de objetos {{domxref("Gamepad")}}, uno para cada gamepad conectado.</dd>
</dl>

<h4 id="Eventos_del_Window">Eventos del Window</h4>

<dl>
 <dt>{{domxref("Window.ongamepadconnected")}}</dt>
 <dd>Representa un manejador de evento que se ejecutará cuando un gamepad es conectado (cuando se dispara el evento {{event('gamepadconnected')}}).</dd>
 <dt>{{domxref("Window.ongamepaddisconnected")}}</dt>
 <dd>Representa un manejador de evento que se ejecutará cuando un gamepad es desconectado (cuando se dispara el evento {{event('gamepaddisconnected')}}).</dd>
</dl>

<h2 id="Guías_y_tutoriales">Guías y tutoriales</h2>

<ul>
 <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API">Usando la gamepad API</a></li>
 <li><a href="/en-US/docs/Games/Techniques/Controls_Gamepad_API">Implementación de controles usando la gamepad API</a></li>
</ul>

<h2 id="Especificaciones">Especificaciones</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Especificación</th>
   <th scope="col">Estatus</th>
   <th scope="col">Comentario</th>
  </tr>
  <tr>
   <td>{{SpecName("GamepadExtensions")}}</td>
   <td>{{Spec2("GamepadExtensions")}}</td>
   <td>Defines the {{anch("Experimental Gamepad extensions")}}.</td>
  </tr>
  <tr>
   <td>{{SpecName("Gamepad", "", "The Gamepad API specification")}}</td>
   <td>{{Spec2("Gamepad")}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidad_del_navegador">Compatibilidad del navegador</h2>

<div class="hidden">La tabla de compatibilidad es generada de datos estructurados. Si desea contribuir a los datos, por favor, echa un vistazo <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> y envienos una pull request.</div>

<p>{{Compat("api.Gamepad")}}</p>

<h2 id="Ver_también">Ver también</h2>

<ul>
 <li><a class="external text" href="https://hacks.mozilla.org/2013/12/the-gamepad-api/" rel="nofollow">La gamepad API</a> por Ted Mielczarek y Robert Nyman</li>
 <li><a href="http://luser.github.io/gamepadtest/">Página de demostración simple de la API</a> (<a href="https://github.com/luser/gamepadtest">código fuente</a>)</li>
</ul>