Difference between revisions of "Common Organization of Controls Kit Fields"
(Created page with "Control object have a variety of fields that you can directly access. == Basics == Control objects' structure is defined as following: * defaultOption * defaultLayout * current ...") |
m (→Details) |
||
Line 22: | Line 22: | ||
{{param|table|previous|Table that contains all readings for maps at previous frame.}} | {{param|table|previous|Table that contains all readings for maps at previous frame.}} | ||
{{param|table|joysticks|Table that contains all used joysticks.}} | {{param|table|joysticks|Table that contains all used joysticks.}} | ||
− | + | {{param|string|name|Joystick name.}} | |
− | + | {{param|number|number|Joystick number.}} | |
{{param|table|etc|Table that contains miscellaneous data.}} | {{param|table|etc|Table that contains miscellaneous data.}} | ||
− | + | {{param|string|id|Object ID.}} | |
− | + | {{param|table|mouse|Table that contains mouse-related settings.}} | |
− | + | {{param|number|x|X-coordinate of mouse offset. Default is 0.}} | |
− | + | {{param|number|y|Y-coordinate of mouse offset. Default is 0.}} | |
− | + | {{param|number|fx|Horizontal scaling factor. Default is 1.}} | |
− | + | {{param|number|fy|Vertical scaling factor. Default is 1.}} | |
Accessing object.current.* is a suggested way of getting current state of the input. | Accessing object.current.* is a suggested way of getting current state of the input. | ||
Line 39: | Line 39: | ||
All mouse settings can be done vla functions (cock.setMouseOffset and cock.setMouseFactor) or directly throguh object.etc.mouse.* fields. | All mouse settings can be done vla functions (cock.setMouseOffset and cock.setMouseFactor) or directly throguh object.etc.mouse.* fields. | ||
+ | |||
== See also == | == See also == | ||
*[[Common Organization of Controls Kit Manual]] | *[[Common Organization of Controls Kit Manual]] |
Latest revision as of 17:52, 2 September 2013
Control object have a variety of fields that you can directly access.
Basics
Control objects' structure is defined as following:
- defaultOption
- defaultLayout
- current
- previous
- joysticks
- name
- number
- etc
- id
- mouse
- x
- y
- fx
- fy
Details
string defaultOption
- Option to use in functions that require it by default. Default value is "default".
string defaultLayout
- Layout to use in cock.setDefault by default. Default value is "default".
table current
- Table that contains all readings for maps at current frame.
table previous
- Table that contains all readings for maps at previous frame.
table joysticks
- Table that contains all used joysticks.
string name
- Joystick name.
number number
- Joystick number.
table etc
- Table that contains miscellaneous data.
string id
- Object ID.
table mouse
- Table that contains mouse-related settings.
number x
- X-coordinate of mouse offset. Default is 0.
number y
- Y-coordinate of mouse offset. Default is 0.
number fx
- Horizontal scaling factor. Default is 1.
number fy
- Vertical scaling factor. Default is 1.
Accessing object.current.* is a suggested way of getting current state of the input.
You can access real joystick names and number by accessing object.joysticks[ # ].name and object.joysticks[ # ].number respectively.
An ID can be read from object.etc.id field.
All mouse settings can be done vla functions (cock.setMouseOffset and cock.setMouseFactor) or directly throguh object.etc.mouse.* fields.