ActionState
¶clear
()¶Clears all added inputs.
requireRelease
()¶Requires this action to have all inputs released before it can be triggered again.
elapsed
¶inputs
¶ActionState
isDisabled
¶ActionState
from checking inputisPressed
¶isPressedThisFrame
¶justPressed
¶justPressedThisFrame
¶justReleased
¶justReleasedThisFrame
¶DataStream
¶__init__
(arg2)¶Parameters: | arg2 (int) – |
---|
append
(data)¶Adds data to the end of the buffer
Parameters: | data (DataStream ) – DataStream to add on to current buffer |
---|
append
(data, size)Adds size amount of data to the end of current buffer
Parameters: |
|
---|
begin
()¶Reads a partition header and pushes it onto the stack
clear
()¶Removes all data from the buffer
compress
()¶Compresses the data in the buffer
converge
()¶Exits a partition scope and moves to the outer partition
decompress
()¶Decompresses the data in the buffer
diverge
()¶Creates a partition in the datastream that is prefixed with a size header
end
()¶Used to signal the stream that the current position should be at the end of a partition
partitionLength
()¶Returns length of the top of the partition stack
Return type: | int |
---|
readBool
()¶Ret a boolean from the buffer and returns it
Return type: | bool |
---|
readDict
()¶Reads a Python dictionary from the buffer and returns it
Return type: | dict |
---|
readDouble
()¶Read an double from the buffer and returns it
Return type: | float |
---|
readFloat
()¶Read an float from the buffer and returns it
Return type: | float |
---|
readInt16
()¶Read an integer from the buffer and returns it
Return type: | int |
---|
readInt32
()¶Read an integer from the buffer and returns it
Return type: | int |
---|
readInt8
()¶Read an integer from the buffer and returns it
Return type: | int |
---|
readNullTermString
()¶Reads a null terminated string from the buffer and returns it
Return type: | str |
---|
readObject
()¶Reads a Python obejct from the buffer and returns it
Return type: | object |
---|
readPixelVector
()¶Read a PixelVector
from the buffer and returns it
Return type: | PixelVector |
---|
readString
()¶Read a string from the buffer and returns it
Return type: | str |
---|
readTileVector
()¶Read a TileVector
from the buffer and returns it
Return type: | TileVector |
---|
readUint16
()¶Read an integer from the buffer and returns it
Return type: | int |
---|
readUint32
()¶Read an integer from the buffer and returns it
Return type: | int |
---|
readUint64
()¶Read an integer from the buffer and returns it
Return type: | long |
---|
readUint8
()¶Read an integer from the buffer and returns it
Return type: | int |
---|
readWString
()¶Read an wide character string from the buffer and returns it
Return type: | unicode |
---|
resize
(arg2)¶Resizes the buffer to the specified size
Parameters: | arg2 (int) – |
---|
size
()¶Returns the size of the data in the buffer
Return type: | int |
---|
skip
()¶Skips over the remainder of the current partition
writeBool
(data)¶Appends data to the end of the current buffer data
Parameters: | data (bool) – Boolean to write to buffer |
---|
writeColor
(data)¶Appends data to the end of the current buffer data
Parameters: | data (Color ) – Color to write to buffer |
---|
writeDict
(data)¶Appends data to the end of the current buffer data
Parameters: | data (dict) – Python dictionary to write to buffer |
---|
writeDouble
(data)¶Appends data to the end of the current buffer data
Parameters: | data (float) – Double to write to buffer |
---|
writeFloat
(data)¶Appends data to the end of the current buffer data
Parameters: | data (float) – Float to write to buffer |
---|
writeInt16
(data)¶Appends data to the end of the current buffer data
Parameters: | data (int) – Int16 to write to buffer |
---|
writeInt32
(data)¶Appends data to the end of the current buffer data
Parameters: | data (int) – Int32 to write to buffer |
---|
writeInt8
(data)¶Appends data to the end of the current buffer data
Parameters: | data (int) – Int8 to write to buffer |
---|
writeNullTermString
(data)¶Appends a null terminated string to the end of the current buffer.
Parameters: | data (str) – String to write to buffer |
---|
writeObject
(data)¶Appends data to the end of the current buffer data
Parameters: | data (object) – Python Object to write to buffer |
---|
writePixelRect
(data)¶Appends data to the end of the current buffer data
Parameters: | data (PixelRect ) – PixelRect to write to buffer |
---|
writePixelVector
(data)¶Appends data to the end of the current buffer data
Parameters: | data (PixelVector ) – PixelVector to write to buffer |
---|
writeRect
(data)¶Appends data to the end of the current buffer data
Parameters: | data (Rect ) – Rect to write to buffer |
---|
writeString
(data)¶Appends data to the end of the current buffer data
Parameters: | data (str) – String to write to buffer |
---|
writeTileRect
(data)¶Appends data to the end of the current buffer data
Parameters: | data (TileRect ) – TileRect to write to buffer |
---|
writeTileVector
(data)¶Appends data to the end of the current buffer data
Parameters: | data (TileVector ) – TileVector to write to buffer |
---|
writeUint16
(data)¶Appends data to the end of the current buffer data
Parameters: | data (int) – Uint16 to write to buffer |
---|
writeUint32
(data)¶Appends data to the end of the current buffer data
Parameters: | data (int) – Uint32 to write to buffer |
---|
writeUint64
(data)¶Appends data to the end of the current buffer data
Parameters: | data (long) – Uint64 to write to buffer |
---|
writeUint8
(data)¶Appends data to the end of the current buffer data
Parameters: | data (int) – Uint8 to write to buffer |
---|
writeVector
(data)¶Appends data to the end of the current buffer data
Parameters: | data (Vector ) – Vector to write to buffer |
---|
writeVector3
(data)¶Appends data to the end of the current buffer data
Parameters: | data (Vector3 ) – Vector3 to write to buffer |
---|
writeWString
(data)¶Appends data to the end of the current buffer data
Parameters: | data (unicode) – Wide String to write to buffer |
---|
File
¶backupCloudFiles
(arg1, arg2)¶Parameters: |
|
---|
exists
(filePath[, isCloudSave=True])¶Parameters: |
|
---|---|
Return type: | bool |
getCharacters
(configDirectory)¶Parameters: | configDirectory (object) – |
---|---|
Return type: | StringList |
getValidPath
(filePath)¶Formats a string to remove invalid characters from a string ([?\/:*<>|”])
Parameters: | filePath (str) – Path to the file |
---|---|
Returns: | A formated string |
Return type: | str |
getWorlds
(configDirectory)¶Parameters: | configDirectory (object) – |
---|---|
Return type: | StringList |
load
(filePath, data[, isCloudSave=True])¶Appends the file data to the DataStream
Parameters: |
|
---|---|
Returns: | Returns the file version number |
Return type: | int |
open
(filePath)¶Opens file at the path and reads into a buffer
Parameters: | filePath (object) – Path to target file |
---|---|
Returns: | If the file is valid it is returned |
Return type: | File |
remove
(filePath[, isCloudSave=True])¶Parameters: |
|
---|
removeDirectory
(directoryPath[, isCloudSave=True])¶Parameters: |
|
---|
save
(filePath, data[, isCloudSave=True])¶Writes contents of data to the file at path
Parameters: |
|
---|
saveSimple
(filePath, data[, isCloudSave=True])¶Writes contents of data to the file at path
Parameters: |
|
---|
usingSteamCloud
()¶Return type: | bool |
---|
FileManager
¶asyncRead
(filePath, onComplete, isCreaFile[, useCompression=True[, isCloudSave=True]])¶Reads from a file using a new thread
Parameters: |
|
---|
asyncWrite
(filePath, onComplete, stream[, useCompression=True[, isCloudSave=True]])¶Writes to a file using a new thread
Parameters: |
|
---|
FileOnCompleteHandler
¶__call__
(arg2, arg3)¶Parameters: |
|
---|
create
([func=None])¶Parameters: | func (object) – |
---|---|
Return type: | FileOnCompleteHandler |
JoyInput
¶__init__
(joyId, joyButton)¶Parameters: |
|
---|
__init__
(joyId, joyAxis, axisDelta)Parameters: |
|
---|
axis
¶delta
¶position
¶useAxis
¶useButton
¶MouseInput
¶__eq__
(arg2)¶Parameters: | arg2 (MouseInput ) – |
---|---|
Return type: | bool |
__init__
(button)¶Parameters: | button (Button) – |
---|
GameInputList
¶__contains__
(arg2)¶Parameters: | arg2 (object) – |
---|---|
Return type: | bool |
__delitem__
(arg2)¶Parameters: | arg2 (object) – |
---|
__getitem__
(arg2)¶Parameters: | arg2 (object) – |
---|---|
Return type: | object |
__iter__
()¶Return type: | object |
---|
__len__
()¶Return type: | int |
---|
__setitem__
(arg2, arg3)¶Parameters: |
|
---|
append
(arg2)¶Parameters: | arg2 (object) – |
---|
extend
(arg2)¶Parameters: | arg2 (object) – |
---|
Input
¶createAction
()¶Returns a new ActionState
Return type: | ActionState |
---|
removeAction
(actionState)¶Removes target ActionState
from this Input
Parameters: | actionState (ActionState ) – The ActionState to be removed |
---|
update
(frameTime)¶Updates all ActionStates that this has created
Parameters: | frameTime (int) – elapsed time for the frame |
---|
actions
¶Joystick
¶getAxisPosition
(joystick, axis)¶Get the current position of a joystick axis
Parameters: |
|
---|---|
Returns: | Current position of the axis, in range [-100, 100] |
Return type: | float |
getButtonCount
(joystick)¶Return the number of buttons supported by a joystick.
Parameters: | joystick (int) – Index of the joystick |
---|---|
Returns: | Number of buttons supported by the joystick, or 0 if joystick is not connected |
Return type: | int |
getIdentification
(joystick)¶Get the joystick information
Parameters: | joystick (int) – Index of the joystick |
---|---|
Returns: | Structure containing joystick information. |
Return type: | JoystickIdentification |
hasAxis
(joystick, axis)¶Check if a joystick supports a given axis.
Parameters: |
|
---|---|
Returns: | True if the joystick supports the axis, false otherwise |
Return type: | bool |
isButtonPressed
(joystick, button)¶Check if a joystick button is pressed.
Parameters: |
|
---|---|
Returns: | True if the button is pressed, false otherwise |
Return type: | bool |
isConnected
(joystick)¶Check if a joystick is connected.
Parameters: | joystick (int) – Index of joystick to check |
---|---|
Returns: | True if the joystick is connected, false otherwise |
Return type: | bool |
update
()¶Update the states of all joysticks.
Axis = <class 'siege.io.Axis'>
AxisCount = 8
ButtonCount = 32
Count = 8
PovX = siege.io.Axis.PovX
PovY = siege.io.Axis.PovY
R = siege.io.Axis.R
U = siege.io.Axis.U
V = siege.io.Axis.V
X = siege.io.Axis.X
Y = siege.io.Axis.Y
Z = siege.io.Axis.Z
Keyboard
¶isKeyPressed
(key)¶Check if a key is pressed
Parameters: | key (Key) – The key to check |
---|---|
Returns: | True if key pressed, false otherwise |
Return type: | bool |
A = siege.io.Key.A
Add = siege.io.Key.Add
B = siege.io.Key.B
BackSlash = siege.io.Key.BackSlash
BackSpace = siege.io.Key.BackSpace
C = siege.io.Key.C
Comma = siege.io.Key.Comma
D = siege.io.Key.D
Dash = siege.io.Key.Dash
Delete = siege.io.Key.Delete
Divide = siege.io.Key.Divide
Down = siege.io.Key.Down
E = siege.io.Key.E
End = siege.io.Key.End
Equal = siege.io.Key.Equal
Escape = siege.io.Key.Escape
F = siege.io.Key.F
F1 = siege.io.Key.F1
F10 = siege.io.Key.F10
F11 = siege.io.Key.F11
F12 = siege.io.Key.F12
F13 = siege.io.Key.F13
F14 = siege.io.Key.F14
F15 = siege.io.Key.F15
F2 = siege.io.Key.F2
F3 = siege.io.Key.F3
F4 = siege.io.Key.F4
F5 = siege.io.Key.F5
F6 = siege.io.Key.F6
F7 = siege.io.Key.F7
F8 = siege.io.Key.F8
F9 = siege.io.Key.F9
G = siege.io.Key.G
H = siege.io.Key.H
Home = siege.io.Key.Home
I = siege.io.Key.I
Insert = siege.io.Key.Insert
J = siege.io.Key.J
K = siege.io.Key.K
Key = <class 'siege.io.Key'>
KeyCount = siege.io.Key.KeyCount
L = siege.io.Key.L
LAlt = siege.io.Key.LAlt
LBracket = siege.io.Key.LBracket
LControl = siege.io.Key.LControl
LShift = siege.io.Key.LShift
LSystem = siege.io.Key.LSystem
Left = siege.io.Key.Left
M = siege.io.Key.M
Menu = siege.io.Key.Menu
Multiply = siege.io.Key.Multiply
N = siege.io.Key.N
Num0 = siege.io.Key.Num0
Num1 = siege.io.Key.Num1
Num2 = siege.io.Key.Num2
Num3 = siege.io.Key.Num3
Num4 = siege.io.Key.Num4
Num5 = siege.io.Key.Num5
Num6 = siege.io.Key.Num6
Num7 = siege.io.Key.Num7
Num8 = siege.io.Key.Num8
Num9 = siege.io.Key.Num9
Numpad0 = siege.io.Key.Numpad0
Numpad1 = siege.io.Key.Numpad1
Numpad2 = siege.io.Key.Numpad2
Numpad3 = siege.io.Key.Numpad3
Numpad4 = siege.io.Key.Numpad4
Numpad5 = siege.io.Key.Numpad5
Numpad6 = siege.io.Key.Numpad6
Numpad7 = siege.io.Key.Numpad7
Numpad8 = siege.io.Key.Numpad8
Numpad9 = siege.io.Key.Numpad9
O = siege.io.Key.O
P = siege.io.Key.P
PageDown = siege.io.Key.PageDown
PageUp = siege.io.Key.PageUp
Pause = siege.io.Key.Pause
Period = siege.io.Key.Period
Q = siege.io.Key.Q
Quote = siege.io.Key.Quote
R = siege.io.Key.R
RAlt = siege.io.Key.RAlt
RBracket = siege.io.Key.RBracket
RControl = siege.io.Key.RControl
RShift = siege.io.Key.RShift
RSystem = siege.io.Key.RSystem
Return = siege.io.Key.Return
Right = siege.io.Key.Right
S = siege.io.Key.S
SemiColon = siege.io.Key.SemiColon
Slash = siege.io.Key.Slash
Space = siege.io.Key.Space
Subtract = siege.io.Key.Subtract
T = siege.io.Key.T
Tab = siege.io.Key.Tab
Tilde = siege.io.Key.Tilde
U = siege.io.Key.U
Up = siege.io.Key.Up
V = siege.io.Key.V
W = siege.io.Key.W
X = siege.io.Key.X
Y = siege.io.Key.Y
Z = siege.io.Key.Z
Mouse
¶getPosition
()¶Returns the current position of the mouse in desktop coordinates
Return type: | sfTileVector |
---|
getPosition
(relativeTo)Get the current position of the mouse in window coordinate
Parameters: | relativeTo (object) – Reference window |
---|---|
Returns: | Current position of the mouse |
Return type: | sfTileVector |
isButtonPressed
(button)¶Check if a mouse button is pressed
Parameters: | button (Button) – Button to check |
---|---|
Returns: | True if the button if pressed, false otherwise |
Return type: | bool |
setPosition
(position)¶Set the current position of the mouse in desktop coordinates.
Parameters: | position (sfTileVector ) – New position of the mouse |
---|
setPosition
(position, relativeTo)This function sets the current position of the mouse cursor, relative to the given window.
Parameters: |
|
---|
Button = <class 'siege.io.Button'>
ButtonCount = siege.io.Button.ButtonCount
Left = siege.io.Button.Left
Middle = siege.io.Button.Middle
Right = siege.io.Button.Right
XButton1 = siege.io.Button.XButton1
XButton2 = siege.io.Button.XButton2