Gkinterface: Difference between revisions
Greshnatok (talk | contribs) |
Pizzasgood (talk | contribs) |
||
(26 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
Interface related functions. | Interface related functions. | ||
== Functions == | == Mouse related Functions == | ||
Those of these which come in Get/Set pairs are combined into a single entry below. | |||
=== GetMouseLookMode/SetMouseLookMode === | |||
These relate to the mouselook mode. "True" with these refers to mouselook being on, false to mouselook being disabled. | |||
<source lang="lua"> | |||
gkinterface.SetMouseLookMode(true) -- enables mouselook mode | |||
gkinterface.GetMouseLookMode() -- would return "true" now | |||
gkinterface.SetMouseLookMode(false) -- disables mouselook mode | |||
gkinterface.GetMouseLookMode() -- would return "false" now | |||
</source> | |||
=== GetMouseOptions/SetMouseOptions === | |||
I'm not sure what this does. The Get option returns the following data structure (on my machine) | |||
<source lang="lua"> | |||
{ | |||
1 = { | |||
"name" = "X Axis", | |||
"value" = 1 | |||
}, | |||
2 = { | |||
"name" = "Y Axis", | |||
"value" = 1 | |||
} | |||
} | |||
</source> | |||
=== GetMousePosition === | |||
'''Definition''': gkinterface.GetMousePosition() -> float percent_x, float percent_y | |||
'''Description''' | |||
Returns two floats which designate how far across the screen the mouse pointer is in percent, as seen from the top left. E.g., if the mouse pointer is dead centre of the screen, this would return "0.5, 0.5" while if it were at the top left, this would return 0,0. | |||
=== GetMouseSensitivity/SetMouseSensitivity === | |||
Get or set the mouse sensitivity. This can be set to values from 1-20 via the Controls menu, but really can go quite a bit higher. Negative values invert mouse movement (for both axis, so this is not a way to get "invert mouse" behaviour). | |||
=== SetMouseCursor === | |||
to do | |||
=== SetMouseCursorIndexImage === | |||
'''Definition:'''<br> | |||
<br> | |||
'''Description:'''<br> | |||
<br> | |||
'''Arguments:'''<br> | |||
<br> | |||
'''Returns:'''<br> | |||
nothing<br> | |||
<br> | |||
'''Example:'''<br> | |||
<source lang="lua"> | |||
gkinterface.SetMouseCursorIndexImage(0, 'images/station/int_mouse_pointer.png', 0, 0) | |||
gkinterface.SetMouseCursorIndexImage(1, 'images/station/int_mouse_pointer_no.png', 0.25, 0.25) | |||
gkinterface.SetMouseCursorIndexImage(2, 'images/station/int_mouse_pointer_copy.png', 0, 0) | |||
gkinterface.SetMouseCursorIndexImage(3, 'images/station/int_mouse_pointer.png', 0, 0) | |||
gkinterface.SetMouseCursorIndexImage(4, 'images/station/int_mouse_pointer.png', 0, 0) | |||
</source> | |||
<br> | |||
<br> | |||
=== SetMouseHotspot === | |||
to do | |||
== Uncategorized Functions == | |||
=== AddDirectionalLight === | === AddDirectionalLight === | ||
=== AddFXEffect === | |||
=== BindCommand === | === BindCommand === | ||
'''Definition''':<br> | |||
BindCommand(keycode, command) -> ?<br> | |||
<br> | |||
'''Description'''<br> | |||
Binds a command to a key.<br> | |||
<br> | |||
'''Arguments:'''<br> | |||
''keycode'' - the keycode returned by GetInputCodeByName()<br> | |||
''command'' - the command to be bound<br> | |||
<br> | |||
'''Returns:'''<br> | |||
<br> | |||
'''Example:'''<br> | |||
<source lang="lua"> | |||
gkinterface.BindCommand(gkinterface.GetInputCodeByName("LeftArrow"), "+TurnLeft") | |||
</source> | |||
<br><br> | |||
=== BindJoystickCommand === | === BindJoystickCommand === | ||
=== CaptureMouse === | === CaptureMouse === | ||
=== ChangeTouchRegionSize === | |||
=== ChangeTrackpadRegionSize === | |||
=== CreateTouchRegion === | |||
'''Definition:'''<br> | |||
CreateTouchRegion(?, ?, string ''command'', boolean, boolean, boolean, boolean, boolean, boolean, number ''x'', number ''y'', number ''x2'', number ''y2'') -> number ''regionid''<br> | |||
<br> | |||
'''Description:'''<br> | |||
Creates a rectangular region on a touch enabled device that will respond to touch presses. | |||
<br> | |||
'''Arguments:'''<br> | |||
1: unknown <br> | |||
2: unknown <br> | |||
3: ''command'' - this is a string value which matches an in-game command <br> | |||
4: unknown <br> | |||
5: unknown <br> | |||
6: unknown <br> | |||
7: unknown <br> | |||
8: unknown <br> | |||
9: unknown <br> | |||
10: ''x'' - the x-coordinate for the upper-left corner <br> | |||
11: ''y'' - the y-coordinate for the upper-left corner <br> | |||
12: ''x2'' - the x-coordinate for the lower-right corner <br> | |||
13: ''y2'' - the y-coordinate for the lower-right corner <br> | |||
<br> | |||
'''Returns:'''<br> | |||
''regionid'' - an auto-incrementing number identifying the newly created region<br> | |||
<br> | |||
'''Example:'''<br> | |||
<source lang="lua">gkinterface.CreateTouchRegion(nil, nil, "+turbo", false, false, false, false, false, false, 0, 792, 71, 855)</source> | |||
<br><br> | |||
=== CreateTouchpadRegion === | |||
=== DestroyTouchRegion === | |||
'''Definition:'''<br> | |||
DestroyTouchRegion(number ''regionid'') -> nil<br> | |||
<br> | |||
'''Description:'''<br> | |||
Destroys a touch region. | |||
<br> | |||
'''Arguments:'''<br> | |||
''regionid'' - the region id returned by CreateTouchRegion() <br> | |||
<br> | |||
'''Returns:'''<br> | |||
<br> | |||
'''Example:'''<br> | |||
<source lang="lua">gkinterface.DestroyTouchRegion(1)</source> | |||
<br><br> | |||
=== DestroyTouchpadRegion === | |||
=== Draw3DScene === | === Draw3DScene === | ||
'''Definition:'''<br> | |||
Draw3DScene(boolean ''draw'')<br> | |||
<br> | |||
'''Description:'''<br> | |||
<br> | |||
'''Arguments:'''<br> | |||
''draw'' - if true then draw 3D scene.<br> | |||
<br> | |||
'''Returns:'''<br> | |||
nothing<br> | |||
<br> | |||
'''Example:'''<br> | |||
<source lang="lua">gkinterface.Draw3DScene(false)</source> | |||
<br><br> | |||
=== EnableTouchMode === | |||
=== EvictTextures === | === EvictTextures === | ||
=== GetAccelerometerOptions === | |||
=== GetAccelerometerSensitivity === | |||
=== GetAudioDrivers === | === GetAudioDrivers === | ||
=== GetAudioOptions === | === GetAudioOptions === | ||
=== GetBindsForCommand === | === GetBindsForCommand === | ||
=== GetCommandForKeyboardBind === | === GetCommandForKeyboardBind === | ||
'''Definition:'''<br> | |||
GetCommandForKeyboardBind(number ''keycode'') -> string ''command_down'', ''command_up''<br> | |||
'''Description:'''<br> | |||
Returns the commands bound to the keycode.<br> | |||
<br> | |||
'''Arguments:'''<br> | |||
''keycode'' - keycode of key.<br> | |||
<br> | |||
'''Returns:'''<br> | |||
''command_down'' - command bound to key down or nil<br> | |||
''command_up'' - command bound to key release or nil (optional)<br> | |||
<br> | |||
'''Example:'''<br> | |||
<source lang="lua"> | |||
if gkinterface.GetCommandForKeyboardBind(65513) then print("key has a bind") end | |||
print( gkinterface.GetCommandForKeyboardBind(116) ) -- returned say_channel | |||
</source> | |||
<br> | |||
<br> | |||
=== GetCurrentAudioDriverName === | === GetCurrentAudioDriverName === | ||
=== GetCurrentVideoDriverName === | === GetCurrentVideoDriverName === | ||
=== GetFXEffect === | |||
=== GetFXStringList === | |||
=== GetGameOptions === | === GetGameOptions === | ||
=== GetGraphicsOptions === | === GetGraphicsOptions === | ||
=== GetInputCodeByName === | === GetInputCodeByName === | ||
=== GetNameForInputCode === | === GetNameForInputCode === | ||
=== GetVideoDrivers === | === GetVideoDrivers === | ||
=== GetVideoOptions === | === GetVideoOptions === | ||
=== GetXResolution === | === GetXResolution === | ||
'''Definition:''' | |||
gkinterface.GetXResolution -> int width | |||
'''Description''' | |||
Returns the width of the current game resolution | |||
'''Arguments''' | |||
None | |||
''' Returns''' | |||
An int containing the current game screen width (e.g. 800) | |||
=== GetYResolution === | === GetYResolution === | ||
'''Definition:''' | |||
gkinterface.GetYResolution -> int width | |||
'''Description''' | |||
Returns the height of the current game resolution | |||
'''Arguments''' | |||
None | |||
''' Returns''' | |||
An int containing the current game screen height (e.g. 600) | |||
=== GKBeginFrame === | |||
=== GKClearFrame === | |||
=== GKEndFrame === | |||
=== GKFlipFrame === | |||
=== GKLoadCommands === | === GKLoadCommands === | ||
=== GKPoll === | === GKPoll === | ||
=== GKProcessCommand === | === GKProcessCommand === | ||
* [http://www.vendetta-online.com/manual/app_commands.html list of the Vendetta commands]<br> | |||
* [http://www.vo-wiki.com/wiki/Command_List detailed explanation of the commands] | |||
=== GKRenderFrame === | === GKRenderFrame === | ||
=== GKUpdateFrame === | === GKUpdateFrame === | ||
=== HideMouse === | === HideMouse === | ||
=== IsAltKeyDown === | === IsAltKeyDown === | ||
'''Definition:''' | '''Definition:''' | ||
Line 48: | Line 245: | ||
=== IsCtrlKeyDown === | === IsCtrlKeyDown === | ||
'''Definition:''' | |||
gkinterface.IsCtrlKeyDown() -> bool pressed | |||
'''Description''' | |||
Test if the Ctrl key is currently pressed. | |||
'''Arguments''' | |||
None | |||
''' Returns''' | |||
True if the either of the ctrl keys is currently pressed, false otherwise. | |||
=== IsShiftKeyDown === | === IsShiftKeyDown === | ||
'''Definition:''' | |||
gkinterface.IsShiftKeyDown() -> bool pressed | |||
'''Description''' | |||
Test if the shift key is currently pressed. | |||
'''Arguments''' | |||
None | |||
''' Returns''' | |||
True if the either of the shift keys is currently pressed, false otherwise. | |||
=== IsTouchModeEnabled === | |||
'''Definition:''' | |||
gkinterface.IsTouchModeEnabled() -> bool | |||
'''Description''' | |||
Test if the shift key is currently pressed. | |||
'''Arguments''' | |||
None | |||
''' Returns''' | |||
True if touch mode is enabled, false otherwise. | |||
=== LoadDefaults === | === LoadDefaults === | ||
=== QueryAudio === | === QueryAudio === | ||
=== QueryVideo === | === QueryVideo === | ||
=== Set3DViewport === | |||
=== SetAccelerometerOptions === | |||
=== SetAccelerometerSensitivity === | |||
=== SetAudioDriver === | === SetAudioDriver === | ||
=== SetAudioOptions === | === SetAudioOptions === | ||
=== SetCamera === | === SetCamera === | ||
=== SetFOV === | === SetFOV === | ||
'''Definition:''' | |||
gkinterface.SetFOV(int angle) -> nil | |||
'''Description''' | |||
Sets the Field of View angle in degrees (from 1 to 179). Note that this value is reset each time the player warps to another sector. It's not saved when the game is exited either. If you want to save this, you need to use Game.SetCVar | |||
'''Arguments''' | |||
int angle -> the new angle for the field of view. | |||
''' Returns''' | |||
nil | |||
=== SetGameOptions === | === SetGameOptions === | ||
=== SetGraphicsOptions === | === SetGraphicsOptions === | ||
=== SetVideoDriver === | === SetVideoDriver === | ||
=== SetVideoOptions === | === SetVideoOptions === | ||
Line 69: | Line 311: | ||
=== ShowMouse === | === ShowMouse === | ||
=== UnbindCommand === | === UnbindCommand === | ||
[[Category:Tables]] |
Latest revision as of 05:43, 26 January 2014
Interface related functions.
Those of these which come in Get/Set pairs are combined into a single entry below.
GetMouseLookMode/SetMouseLookMode
These relate to the mouselook mode. "True" with these refers to mouselook being on, false to mouselook being disabled. <source lang="lua"> gkinterface.SetMouseLookMode(true) -- enables mouselook mode gkinterface.GetMouseLookMode() -- would return "true" now gkinterface.SetMouseLookMode(false) -- disables mouselook mode gkinterface.GetMouseLookMode() -- would return "false" now </source>
GetMouseOptions/SetMouseOptions
I'm not sure what this does. The Get option returns the following data structure (on my machine) <source lang="lua"> {
1 = { "name" = "X Axis", "value" = 1 }, 2 = { "name" = "Y Axis", "value" = 1 }
} </source>
GetMousePosition
Definition: gkinterface.GetMousePosition() -> float percent_x, float percent_y
Description Returns two floats which designate how far across the screen the mouse pointer is in percent, as seen from the top left. E.g., if the mouse pointer is dead centre of the screen, this would return "0.5, 0.5" while if it were at the top left, this would return 0,0.
GetMouseSensitivity/SetMouseSensitivity
Get or set the mouse sensitivity. This can be set to values from 1-20 via the Controls menu, but really can go quite a bit higher. Negative values invert mouse movement (for both axis, so this is not a way to get "invert mouse" behaviour).
SetMouseCursor
to do
SetMouseCursorIndexImage
Definition:
Description:
Arguments:
Returns:
nothing
Example:
<source lang="lua">
gkinterface.SetMouseCursorIndexImage(0, 'images/station/int_mouse_pointer.png', 0, 0)
gkinterface.SetMouseCursorIndexImage(1, 'images/station/int_mouse_pointer_no.png', 0.25, 0.25)
gkinterface.SetMouseCursorIndexImage(2, 'images/station/int_mouse_pointer_copy.png', 0, 0)
gkinterface.SetMouseCursorIndexImage(3, 'images/station/int_mouse_pointer.png', 0, 0)
gkinterface.SetMouseCursorIndexImage(4, 'images/station/int_mouse_pointer.png', 0, 0)
</source>
SetMouseHotspot
to do
Uncategorized Functions
AddDirectionalLight
AddFXEffect
BindCommand
Definition:
BindCommand(keycode, command) -> ?
Description
Binds a command to a key.
Arguments:
keycode - the keycode returned by GetInputCodeByName()
command - the command to be bound
Returns:
Example:
<source lang="lua">
gkinterface.BindCommand(gkinterface.GetInputCodeByName("LeftArrow"), "+TurnLeft")
</source>
BindJoystickCommand
CaptureMouse
ChangeTouchRegionSize
ChangeTrackpadRegionSize
CreateTouchRegion
Definition:
CreateTouchRegion(?, ?, string command, boolean, boolean, boolean, boolean, boolean, boolean, number x, number y, number x2, number y2) -> number regionid
Description:
Creates a rectangular region on a touch enabled device that will respond to touch presses.
Arguments:
1: unknown
2: unknown
3: command - this is a string value which matches an in-game command
4: unknown
5: unknown
6: unknown
7: unknown
8: unknown
9: unknown
10: x - the x-coordinate for the upper-left corner
11: y - the y-coordinate for the upper-left corner
12: x2 - the x-coordinate for the lower-right corner
13: y2 - the y-coordinate for the lower-right corner
Returns:
regionid - an auto-incrementing number identifying the newly created region
Example:
<source lang="lua">gkinterface.CreateTouchRegion(nil, nil, "+turbo", false, false, false, false, false, false, 0, 792, 71, 855)</source>
CreateTouchpadRegion
DestroyTouchRegion
Definition:
DestroyTouchRegion(number regionid) -> nil
Description:
Destroys a touch region.
Arguments:
regionid - the region id returned by CreateTouchRegion()
Returns:
Example:
<source lang="lua">gkinterface.DestroyTouchRegion(1)</source>
DestroyTouchpadRegion
Draw3DScene
Definition:
Draw3DScene(boolean draw)
Description:
Arguments:
draw - if true then draw 3D scene.
Returns:
nothing
Example:
<source lang="lua">gkinterface.Draw3DScene(false)</source>
EnableTouchMode
EvictTextures
GetAccelerometerOptions
GetAccelerometerSensitivity
GetAudioDrivers
GetAudioOptions
GetBindsForCommand
GetCommandForKeyboardBind
Definition:
GetCommandForKeyboardBind(number keycode) -> string command_down, command_up
Description:
Returns the commands bound to the keycode.
Arguments:
keycode - keycode of key.
Returns:
command_down - command bound to key down or nil
command_up - command bound to key release or nil (optional)
Example:
<source lang="lua">
if gkinterface.GetCommandForKeyboardBind(65513) then print("key has a bind") end
print( gkinterface.GetCommandForKeyboardBind(116) ) -- returned say_channel
</source>
GetCurrentAudioDriverName
GetCurrentVideoDriverName
GetFXEffect
GetFXStringList
GetGameOptions
GetGraphicsOptions
GetInputCodeByName
GetNameForInputCode
GetVideoDrivers
GetVideoOptions
GetXResolution
Definition: gkinterface.GetXResolution -> int width
Description Returns the width of the current game resolution
Arguments None
Returns An int containing the current game screen width (e.g. 800)
GetYResolution
Definition: gkinterface.GetYResolution -> int width
Description Returns the height of the current game resolution
Arguments None
Returns An int containing the current game screen height (e.g. 600)
GKBeginFrame
GKClearFrame
GKEndFrame
GKFlipFrame
GKLoadCommands
GKPoll
GKProcessCommand
* list of the Vendetta commands
* detailed explanation of the commands
GKRenderFrame
GKUpdateFrame
HideMouse
IsAltKeyDown
Definition: gkinterface.IsAltKeyDown() -> bool pressed
Description Test if the Alt key is currently pressed.
Arguments None
Returns True if the either of the alt keys is currently pressed, false otherwise.
IsCtrlKeyDown
Definition: gkinterface.IsCtrlKeyDown() -> bool pressed
Description Test if the Ctrl key is currently pressed.
Arguments None
Returns True if the either of the ctrl keys is currently pressed, false otherwise.
IsShiftKeyDown
Definition: gkinterface.IsShiftKeyDown() -> bool pressed
Description Test if the shift key is currently pressed.
Arguments None
Returns True if the either of the shift keys is currently pressed, false otherwise.
IsTouchModeEnabled
Definition: gkinterface.IsTouchModeEnabled() -> bool
Description Test if the shift key is currently pressed.
Arguments None
Returns True if touch mode is enabled, false otherwise.
LoadDefaults
QueryAudio
QueryVideo
Set3DViewport
SetAccelerometerOptions
SetAccelerometerSensitivity
SetAudioDriver
SetAudioOptions
SetCamera
SetFOV
Definition: gkinterface.SetFOV(int angle) -> nil
Description Sets the Field of View angle in degrees (from 1 to 179). Note that this value is reset each time the player warps to another sector. It's not saved when the game is exited either. If you want to save this, you need to use Game.SetCVar
Arguments int angle -> the new angle for the field of view.
Returns nil