siege.util

AssetCache

class AssetCache
clean()

Clean up all redirections.

redirect(path)
Parameters:path (object) –
Returns:Returns the redirected path, if set. Otherwise returns the unchanged argument.
Return type:str
redirection(from, to)

Set up a path redirection.

Parameters:
  • from (object) –
  • to (object) –
static getFullPath(relative, contentPath)

Returns full path to asset.

Parameters:
  • relative (object) –
  • contentPath (object) –
Returns:

param relative:if already prefixed with mods/, else returns full path.

Return type:

str

ChunkRect

class ChunkRect
__eq__(arg2)
Parameters:arg2 (ChunkRect) –
Return type:object
__init__(x, y, width, height)
Parameters:
  • x (int) –
  • y (int) –
  • width (int) –
  • height (int) –
__init__(position, size)
Parameters:
__init__(position, size)
Parameters:
__init__(rect)
Parameters:rect (sfIntRect) –
__init__(rect)
Parameters:rect (PixelRect) –
__init__(rect)
Parameters:rect (SubtileRect) –
__init__(rect)
Parameters:rect (TileRect) –
__init__(rect)
Parameters:rect (SegmentRect) –
__init__(rect)
Parameters:rect (ChunkRect) –
__init__(rect)
Parameters:rect (RegionRect) –
__init__(rect)
Parameters:rect (Rect) –
__ne__(arg2)
Parameters:arg2 (ChunkRect) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
adjust(x, y, width, height)

Move by x,y then resize to width and height

Parameters:
  • x (int) – Value to be added x coordinate
  • y (int) – Change in y coordinate
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
asChunk()

Create a copy of this as a ChunkRect

Return type:ChunkRect
asPixel()

Create a copy of this as a PixelRect

Return type:PixelRect
asRect()

Create a copy of this as a Rect

Return type:Rect
asRegion()

Create a copy of this as a RegionRect

Return type:RegionRect
asSegment()

Create a copy of this as a SegmentRect

Return type:SegmentRect
asSubtile()

Create a copy of this as a SubtileRect

Return type:SubtileRect
asTile()

Create a copy of this as a TileRect

Return type:TileRect
contains(x, y[, loopWidth=0])

Return true if x,y are within this rectangle false otherwise

Parameters:
  • x (int) – x position to check
  • y (int) – y position to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if position is within this rectangle false otherwise

Parameters:
  • position (ChunkVector) – x,y coordinates to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if provided rectangle is completely within the bounds of this otherwise false

Parameters:
  • position (ChunkRect) –
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

intersects(rect[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise

Parameters:
  • rect (ChunkRect) – Rectangle to check against
  • loopWidth (int) – How far to check on the x axis from rect.x
Return type:

bool

intersects(rect, intersection[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise. Saves overlapping coordinates to parameter intersection

Parameters:
  • rect (ChunkRect) – Rectangle to check against
  • intersection (ChunkRect) – overlapping coordinates are stored here
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
move(position)

Adds position to x,y coordinates

Parameters:position (ChunkVector) – Value to be added to x,y coordinates
resize(width, height)

Expands width and height

Parameters:
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
toSfml()

Create a copy of this as a sfRect

Return type:sfIntRect
static fromCenter(center, size)

Create a new Rectangle from the center point.

Parameters:
Return type:

ChunkRect

bottom
y + height
bottomLeft
(Vector) Bottom Left x,y coordinates.
bottomRight
(Vector) Bottom Right x,y coordinates.
center
(Vector) Center coordinates of Rectangle.
height
Size from y to bottom.
left
x coordinate
position
(Vector) Top Left x,y coordinates.
right
x + width
size
width * height
top
y coordinate
topLeft
(Vector) Top Left x,y coordinates.
topRight
(Vector) Top Right x,y coordinates.
width
Size from x to right.
x
x coordinate
y
y coordinate

ChunkVector

class ChunkVector
__add__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
__cmp__(vector)

Compares this to another vector

Parameters:vector (ChunkVector) – The vector to compare against
Returns:0 if vectors are the same, -1 if arg is greater, 1 if arg is less than
Return type:int
__div__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
__div__(arg2)
Parameters:arg2 (float) –
Return type:ChunkVector
__eq__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
__iadd__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
__idiv__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
__imul__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
__init__(x, y)
Parameters:
  • x (int) –
  • y (int) –
__init__(x, y, loopWidth)
Parameters:
  • x (int) –
  • y (int) –
  • loopWidth (int) –
__init__(position)
Parameters:position (sfTileVector) –
__init__(position, loopWidth)
Parameters:
__init__(position)
Parameters:position (ChunkVector) –
__init__(position)
Parameters:position (PixelVector) –
__init__(position)
Parameters:position (SubtileVector) –
__init__(position)
Parameters:position (TileVector) –
__init__(position)
Parameters:position (SegmentVector) –
__init__(position)
Parameters:position (ChunkVector) –
__init__(position)
Parameters:position (RegionVector) –
__init__(position)
Parameters:position (Vector) –
__isub__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (float) –
Return type:ChunkVector
__ne__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
__sub__(arg2)
Parameters:arg2 (ChunkVector) –
Return type:object
asChunk()

Create a copy of this as a ChunkVector

Return type:ChunkVector
asPixel()

Create a copy of this as a PixelVector

Return type:PixelVector
asRegion()

Create a copy of this as a RegionVector

Return type:RegionVector
asSegment()

Create a copy of this as a SegmentVector

Return type:SegmentVector
asSubtile()

Create a copy of this as a SubtileVector

Return type:SubtileVector
asTile()

Create a copy of this as a TileVector

Return type:TileVector
asVector()

Create a copy of this as a vector

Return type:Vector
getAngle([asDegrees=True])

Return the angle or direction of this vector

Parameters:asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:float
getAngle(position[, loopWidth=0[, asDegrees=True]])

Return the angle or direction of position

Parameters:
  • position (ChunkVector) – The vector to convert
  • loopWidth (int) – X coordinate for wrap around
  • asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:

float

getDirection(position[, loopWidth=0])

Returns a unit vector in the direction of position

Parameters:
  • position (ChunkVector) – The Vector to calculate direction from
  • loopWidth (int) – X coordinate for wrap around
Return type:

PixelVector

getDirectionX(x[, loopWidth=0])

Returns direction towards x

Parameters:
  • x (int) – X coordinate for direction calculation
  • loopWidth (int) – X coordinate for wrap around
Return type:

int

getDirectionY(y[, loopWidth=0])

Returns direction towards y

Parameters:
  • y (int) – Y coordinate for direction calculation
  • loopWidth (int) – Currently has no effect
Return type:

int

getDistance(position[, loopWidth=0])

Returns the distance from position

Parameters:
  • position (ChunkVector) – The Vector to calculate distance from
  • loopWidth (int) – X coordinate for wrap around
Return type:

float

isDefault()

Returns true if x==0 and y==0, false otherwise

Return type:bool
loop(loopWidth)

Adds loopWidth to x if x < 0. Subtracts loopWidth from x if x >= loopWidth

Parameters:loopWidth (int) – Amount to adjust x coordinate
move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
shouldLoop(loopWidth)

Returns True if x < 0 or x >= loopWidth

Parameters:loopWidth (int) – X coordinate for wrap around
Return type:bool
toSfml()

Create a copy of this as a sfTileVector

Return type:sfTileVector
height
y coordinate
width
x coordinate
x
x coordinate
y
y coordinate

Clock

class Clock
getElapsedTime()
Return type:Time
restart()
Return type:Time

ColorList

class ColorList
__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:
  • arg2 (object) –
  • arg3 (object) –
append(arg2)
Parameters:arg2 (object) –
extend(arg2)
Parameters:arg2 (object) –

EventArg

class EventArg
__init__(value)
Parameters:value (object) –
final
start

FloatList

class FloatList
__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:
  • arg2 (object) –
  • arg3 (object) –
append(arg2)
Parameters:arg2 (object) –
extend(arg2)
Parameters:arg2 (object) –

GameEvent

class GameEvent
clear()

Removes all listeners

invoke()

Calls all listener functions

invoke(arg)

Calls all listener functions using 1 argument

Parameters:arg (object) – The argument for the listeners
invoke(arg1, arg2)

Calls all listener functions using 2 argument

Parameters:
  • arg1 (object) – The first argument for the listeners
  • arg2 (object) – The second argument for the listeners
invoke(arg1, arg2, arg3)

Calls all listener functions using 3 argument

Parameters:
  • arg1 (object) – The first argument for the listeners
  • arg2 (object) – The second argument for the listeners
  • arg3 (object) – The third argument for the listeners
invoke(arg1, arg2, arg3, arg4)

Calls all listener functions using 4 argument

Parameters:
  • arg1 (object) – The first argument for the listeners
  • arg2 (object) – The second argument for the listeners
  • arg3 (object) – The third argument for the listeners
  • arg4 (object) – The fourth argument for the listeners
invoke(arg1, arg2, arg3, arg4, arg5)

Calls all listener functions using 5 argument

Parameters:
  • arg1 (object) – The first argument for the listeners
  • arg2 (object) – The second argument for the listeners
  • arg3 (object) – The third argument for the listeners
  • arg4 (object) – The fourth argument for the listeners
  • arg5 (object) – The fifth argument for the listeners
invoke(arg1, arg2, arg3, arg4, arg5, arg6)

Calls all listener functions using 6 argument

Parameters:
  • arg1 (object) – The first argument for the listeners
  • arg2 (object) – The second argument for the listeners
  • arg3 (object) – The third argument for the listeners
  • arg4 (object) – The fourth argument for the listeners
  • arg5 (object) – The fifth argument for the listeners
  • arg6 (object) – The sixth argument for the listeners
invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7)

Calls all listener functions using 7 argument

Parameters:
  • arg1 (object) – The first argument for the listeners
  • arg2 (object) – The second argument for the listeners
  • arg3 (object) – The third argument for the listeners
  • arg4 (object) – The fourth argument for the listeners
  • arg5 (object) – The fifth argument for the listeners
  • arg6 (object) – The sixth argument for the listeners
  • arg7 (object) – The seventh argument for the listeners
invoke(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)

Calls all listener functions using 8 argument

Parameters:
  • arg1 (object) – The first argument for the listeners
  • arg2 (object) – The second argument for the listeners
  • arg3 (object) – The third argument for the listeners
  • arg4 (object) – The fourth argument for the listeners
  • arg5 (object) – The fifth argument for the listeners
  • arg6 (object) – The sixth argument for the listeners
  • arg7 (object) – The seventh argument for the listeners
  • arg8 (object) – The eighth argument for the listeners
invokeExpand(args, kargs)

Calls all listener functions using arguments

Parameters:
  • args (list) – List of arguments
  • kargs (dict) – Dictionary of arguments
listen(listener)

Adds a listener function to this event

Parameters:listener (object) – The function to add
remove(listener)

Removes the listener from the GameEvent

Parameters:listener (object) – The function to remove
Returns:True if successfully removed, false otherwise
Return type:bool

ObjectMap

class ObjectMap
__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:
  • arg2 (object) –
  • arg3 (object) –

PixelRect

class PixelRect
__eq__(arg2)
Parameters:arg2 (PixelRect) –
Return type:object
__init__(x, y, width, height)
Parameters:
  • x (int) –
  • y (int) –
  • width (int) –
  • height (int) –
__init__(position, size)
Parameters:
__init__(position, size)
Parameters:
__init__(rect)
Parameters:rect (sfIntRect) –
__init__(rect)
Parameters:rect (PixelRect) –
__init__(rect)
Parameters:rect (SubtileRect) –
__init__(rect)
Parameters:rect (TileRect) –
__init__(rect)
Parameters:rect (SegmentRect) –
__init__(rect)
Parameters:rect (ChunkRect) –
__init__(rect)
Parameters:rect (RegionRect) –
__init__(rect)
Parameters:rect (Rect) –
__ne__(arg2)
Parameters:arg2 (PixelRect) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
adjust(x, y, width, height)

Move by x,y then resize to width and height

Parameters:
  • x (int) – Value to be added x coordinate
  • y (int) – Change in y coordinate
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
asChunk()

Create a copy of this as a ChunkRect

Return type:ChunkRect
asPixel()

Create a copy of this as a PixelRect

Return type:PixelRect
asRect()

Create a copy of this as a Rect

Return type:Rect
asRegion()

Create a copy of this as a RegionRect

Return type:RegionRect
asSegment()

Create a copy of this as a SegmentRect

Return type:SegmentRect
asSubtile()

Create a copy of this as a SubtileRect

Return type:SubtileRect
asTile()

Create a copy of this as a TileRect

Return type:TileRect
contains(x, y[, loopWidth=0])

Return true if x,y are within this rectangle false otherwise

Parameters:
  • x (int) – x position to check
  • y (int) – y position to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if position is within this rectangle false otherwise

Parameters:
  • position (PixelVector) – x,y coordinates to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if provided rectangle is completely within the bounds of this otherwise false

Parameters:
  • position (PixelRect) –
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

intersects(rect[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise

Parameters:
  • rect (PixelRect) – Rectangle to check against
  • loopWidth (int) – How far to check on the x axis from rect.x
Return type:

bool

intersects(rect, intersection[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise. Saves overlapping coordinates to parameter intersection

Parameters:
  • rect (PixelRect) – Rectangle to check against
  • intersection (PixelRect) – overlapping coordinates are stored here
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
move(position)

Adds position to x,y coordinates

Parameters:position (PixelVector) – Value to be added to x,y coordinates
resize(width, height)

Expands width and height

Parameters:
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
toSfml()

Create a copy of this as a sfRect

Return type:sfIntRect
static fromCenter(center, size)

Create a new Rectangle from the center point.

Parameters:
Return type:

PixelRect

bottom
y + height
bottomLeft
(Vector) Bottom Left x,y coordinates.
bottomRight
(Vector) Bottom Right x,y coordinates.
center
(Vector) Center coordinates of Rectangle.
height
Size from y to bottom.
left
x coordinate
position
(Vector) Top Left x,y coordinates.
right
x + width
size
width * height
top
y coordinate
topLeft
(Vector) Top Left x,y coordinates.
topRight
(Vector) Top Right x,y coordinates.
width
Size from x to right.
x
x coordinate
y
y coordinate

PixelVector

class PixelVector
__add__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
__cmp__(vector)

Compares this to another vector

Parameters:vector (PixelVector) – The vector to compare against
Returns:0 if vectors are the same, -1 if arg is greater, 1 if arg is less than
Return type:int
__div__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
__div__(arg2)
Parameters:arg2 (float) –
Return type:PixelVector
__eq__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
__iadd__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
__idiv__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
__imul__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
__init__(x, y)
Parameters:
  • x (int) –
  • y (int) –
__init__(x, y, loopWidth)
Parameters:
  • x (int) –
  • y (int) –
  • loopWidth (int) –
__init__(position)
Parameters:position (sfTileVector) –
__init__(position, loopWidth)
Parameters:
__init__(position)
Parameters:position (PixelVector) –
__init__(position)
Parameters:position (PixelVector) –
__init__(position)
Parameters:position (SubtileVector) –
__init__(position)
Parameters:position (TileVector) –
__init__(position)
Parameters:position (SegmentVector) –
__init__(position)
Parameters:position (ChunkVector) –
__init__(position)
Parameters:position (RegionVector) –
__init__(position)
Parameters:position (Vector) –
__isub__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (float) –
Return type:PixelVector
__ne__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
__sub__(arg2)
Parameters:arg2 (PixelVector) –
Return type:object
asChunk()

Create a copy of this as a ChunkVector

Return type:ChunkVector
asPixel()

Create a copy of this as a PixelVector

Return type:PixelVector
asRegion()

Create a copy of this as a RegionVector

Return type:RegionVector
asSegment()

Create a copy of this as a SegmentVector

Return type:SegmentVector
asSubtile()

Create a copy of this as a SubtileVector

Return type:SubtileVector
asTile()

Create a copy of this as a TileVector

Return type:TileVector
asVector()

Create a copy of this as a vector

Return type:Vector
getAngle([asDegrees=True])

Return the angle or direction of this vector

Parameters:asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:float
getAngle(position[, loopWidth=0[, asDegrees=True]])

Return the angle or direction of position

Parameters:
  • position (PixelVector) – The vector to convert
  • loopWidth (int) – X coordinate for wrap around
  • asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:

float

getDirection(position[, loopWidth=0])

Returns a unit vector in the direction of position

Parameters:
  • position (PixelVector) – The Vector to calculate direction from
  • loopWidth (int) – X coordinate for wrap around
Return type:

PixelVector

getDirectionX(x[, loopWidth=0])

Returns direction towards x

Parameters:
  • x (int) – X coordinate for direction calculation
  • loopWidth (int) – X coordinate for wrap around
Return type:

int

getDirectionY(y[, loopWidth=0])

Returns direction towards y

Parameters:
  • y (int) – Y coordinate for direction calculation
  • loopWidth (int) – Currently has no effect
Return type:

int

getDistance(position[, loopWidth=0])

Returns the distance from position

Parameters:
  • position (PixelVector) – The Vector to calculate distance from
  • loopWidth (int) – X coordinate for wrap around
Return type:

float

isDefault()

Returns true if x==0 and y==0, false otherwise

Return type:bool
loop(loopWidth)

Adds loopWidth to x if x < 0. Subtracts loopWidth from x if x >= loopWidth

Parameters:loopWidth (int) – Amount to adjust x coordinate
move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
shouldLoop(loopWidth)

Returns True if x < 0 or x >= loopWidth

Parameters:loopWidth (int) – X coordinate for wrap around
Return type:bool
toSfml()

Create a copy of this as a sfTileVector

Return type:sfTileVector
height
y coordinate
width
x coordinate
x
x coordinate
y
y coordinate

Property

class Property
__init__(arg2)
Parameters:arg2 (object) –
get()

Returns data

Return type:object
read(stream)

Read this Property from a stream and invokes its onChange event.

Parameters:stream (DataStream) – DataStream to read from.
read(stream, args)

Read this property from a stream and invokes its onChange event.

Parameters:
  • stream (DataStream) – DataStream to read from.
  • args (list) – Additional arguments to pass to onChange event.
set(arg2)

Changes data to parameter

Parameters:arg2 (object) –
set(arg2, arg3)

Changes data to parameter

Parameters:
  • arg2 (object) –
  • arg3 (list) –
write(arg2)

Write this Property to a DataStream.

Parameters:arg2 (DataStream) –
onChange

PropertyBool

class PropertyBool
__init__(arg2)
Parameters:arg2 (bool) –
get()

Returns data

Return type:bool
read(stream)

Read this Property from a stream and invokes its onChange event.

Parameters:stream (DataStream) – DataStream to read from.
read(stream, args)

Read this property from a stream and invokes its onChange event.

Parameters:
  • stream (DataStream) – DataStream to read from.
  • args (list) – Additional arguments to pass to onChange event.
set(arg2)

Changes data to parameter

Parameters:arg2 (bool) –
set(arg2, arg3)

Changes data to parameter

Parameters:
  • arg2 (bool) –
  • arg3 (list) –
write(arg2)

Write this Property to a DataStream.

Parameters:arg2 (DataStream) –
onChange

PropertyInt

class PropertyInt
__init__(arg2)
Parameters:arg2 (int) –
get()

Returns data

Return type:int
read(stream)

Read this Property from a stream and invokes its onChange event.

Parameters:stream (DataStream) – DataStream to read from.
read(stream, args)

Read this property from a stream and invokes its onChange event.

Parameters:
  • stream (DataStream) – DataStream to read from.
  • args (list) – Additional arguments to pass to onChange event.
set(arg2)

Changes data to parameter

Parameters:arg2 (int) –
set(arg2, arg3)

Changes data to parameter

Parameters:
  • arg2 (int) –
  • arg3 (list) –
write(arg2)

Write this Property to a DataStream.

Parameters:arg2 (DataStream) –
onChange

PropertyStr

class PropertyStr
__init__(arg2)
Parameters:arg2 (str) –
get()

Returns data

Return type:str
read(stream)

Read this Property from a stream and invokes its onChange event.

Parameters:stream (DataStream) – DataStream to read from.
read(stream, args)

Read this property from a stream and invokes its onChange event.

Parameters:
  • stream (DataStream) – DataStream to read from.
  • args (list) – Additional arguments to pass to onChange event.
set(arg2)

Changes data to parameter

Parameters:arg2 (str) –
set(arg2, arg3)

Changes data to parameter

Parameters:
  • arg2 (str) –
  • arg3 (list) –
write(arg2)

Write this Property to a DataStream.

Parameters:arg2 (DataStream) –
onChange

PropertyUint

class PropertyUint
__init__(arg2)
Parameters:arg2 (int) –
get()

Returns data

Return type:int
read(stream)

Read this Property from a stream and invokes its onChange event.

Parameters:stream (DataStream) – DataStream to read from.
read(stream, args)

Read this property from a stream and invokes its onChange event.

Parameters:
  • stream (DataStream) – DataStream to read from.
  • args (list) – Additional arguments to pass to onChange event.
set(arg2)

Changes data to parameter

Parameters:arg2 (int) –
set(arg2, arg3)

Changes data to parameter

Parameters:
  • arg2 (int) –
  • arg3 (list) –
write(arg2)

Write this Property to a DataStream.

Parameters:arg2 (DataStream) –
onChange

PropertyUint8

class PropertyUint8
__init__(arg2)
Parameters:arg2 (int) –
get()

Returns data

Return type:int
read(stream)

Read this Property from a stream and invokes its onChange event.

Parameters:stream (DataStream) – DataStream to read from.
read(stream, args)

Read this property from a stream and invokes its onChange event.

Parameters:
  • stream (DataStream) – DataStream to read from.
  • args (list) – Additional arguments to pass to onChange event.
set(arg2)

Changes data to parameter

Parameters:arg2 (int) –
set(arg2, arg3)

Changes data to parameter

Parameters:
  • arg2 (int) –
  • arg3 (list) –
write(arg2)

Write this Property to a DataStream.

Parameters:arg2 (DataStream) –
onChange

Random

class Random
static get(min, max)

Return random float within min and max

Parameters:
  • min (float) – minimum value in range
  • max (float) – maximum value in range
Return type:

float

static get([max=2147483647])

Returns an integer from 0 to max

Parameters:max (int) – maximum value for range
Return type:int
static get(min, max)

Return random integer within min and max

Parameters:
  • min (int) – minimum value in range
  • max (int) – maximum value in range
Return type:

int

static get(list)

Returns a random element from passed in list

Parameters:list (list) – an element will be chosed at random from this
Return type:object
static getBool()

Returns true or false randomly

Return type:bool
static getFloat()

Returns a random float from 0.0 to 1.0

Return type:float
static read(stream)

read current seed from stream

Parameters:stream (DataStream) – where to read from
static seed(seed)

Sets the seed for generating numbers

Parameters:seed (int) – set seed to this value
static write(stream)

Write current seed to stream

Parameters:stream (DataStream) – where to write to

Range

class Range
__init__(arg2)
Parameters:arg2 (object) –
__init__(arg2, arg3)
Parameters:
  • arg2 (object) –
  • arg3 (object) –
__str__()
Return type:str
clamp(arg2)

Returns the value clamped within the range.

Parameters:arg2 (object) –
Return type:object
contains(arg2)

Returns true if value is within range, false otherwise

Parameters:arg2 (object) –
Return type:bool
get(arg2)

Returns a value from within range based on percentage passed in

Parameters:arg2 (float) –
Return type:object
getRandom()

Returns a random value within range

Return type:object
end
Returns maximum value in range
max
Returns maximum value in range
min
Returns minimum value in range
start
Returns minimum value in range

RangeColor

class RangeColor
__init__(arg2)
Parameters:arg2 (Color) –
__init__(arg2, arg3)
Parameters:
__str__()
Return type:str
clamp(arg2)

Returns the value clamped within the range.

Parameters:arg2 (Color) –
Return type:Color
contains(arg2)

Returns true if value is within range, false otherwise

Parameters:arg2 (Color) –
Return type:bool
get(arg2)

Returns a value from within range based on percentage passed in

Parameters:arg2 (float) –
Return type:Color
getRandom()

Returns a random value within range

Return type:Color
end
Returns maximum value in range
max
Returns maximum value in range
min
Returns minimum value in range
start
Returns minimum value in range

RangeFloat

class RangeFloat
__init__(arg2)
Parameters:arg2 (float) –
__init__(arg2, arg3)
Parameters:
  • arg2 (float) –
  • arg3 (float) –
__str__()
Return type:str
clamp(arg2)

Returns the value clamped within the range.

Parameters:arg2 (float) –
Return type:float
contains(arg2)

Returns true if value is within range, false otherwise

Parameters:arg2 (float) –
Return type:bool
get(arg2)

Returns a value from within range based on percentage passed in

Parameters:arg2 (float) –
Return type:float
getRandom()

Returns a random value within range

Return type:float
end
Returns maximum value in range
max
Returns maximum value in range
min
Returns minimum value in range
start
Returns minimum value in range

RangeInt

class RangeInt
__init__(arg2)
Parameters:arg2 (int) –
__init__(arg2, arg3)
Parameters:
  • arg2 (int) –
  • arg3 (int) –
__str__()
Return type:str
clamp(arg2)

Returns the value clamped within the range.

Parameters:arg2 (int) –
Return type:int
contains(arg2)

Returns true if value is within range, false otherwise

Parameters:arg2 (int) –
Return type:bool
get(arg2)

Returns a value from within range based on percentage passed in

Parameters:arg2 (float) –
Return type:int
getRandom()

Returns a random value within range

Return type:int
end
Returns maximum value in range
max
Returns maximum value in range
min
Returns minimum value in range
start
Returns minimum value in range

RangeTileVector

class RangeTileVector
__init__(arg2)
Parameters:arg2 (TileVector) –
__init__(arg2, arg3)
Parameters:
__str__()
Return type:str
clamp(arg2)

Returns the value clamped within the range.

Parameters:arg2 (TileVector) –
Return type:TileVector
contains(arg2)

Returns true if value is within range, false otherwise

Parameters:arg2 (TileVector) –
Return type:bool
get(arg2)

Returns a value from within range based on percentage passed in

Parameters:arg2 (float) –
Return type:TileVector
getRandom()

Returns a random value within range

Return type:TileVector
end
Returns maximum value in range
max
Returns maximum value in range
min
Returns minimum value in range
start
Returns minimum value in range

RangeUint

class RangeUint
__init__(arg2)
Parameters:arg2 (int) –
__init__(arg2, arg3)
Parameters:
  • arg2 (int) –
  • arg3 (int) –
__str__()
Return type:str
clamp(arg2)

Returns the value clamped within the range.

Parameters:arg2 (int) –
Return type:int
contains(arg2)

Returns true if value is within range, false otherwise

Parameters:arg2 (int) –
Return type:bool
get(arg2)

Returns a value from within range based on percentage passed in

Parameters:arg2 (float) –
Return type:int
getRandom()

Returns a random value within range

Return type:int
end
Returns maximum value in range
max
Returns maximum value in range
min
Returns minimum value in range
start
Returns minimum value in range

RangeUint8

class RangeUint8
__init__(arg2)
Parameters:arg2 (int) –
__init__(arg2, arg3)
Parameters:
  • arg2 (int) –
  • arg3 (int) –
__str__()
Return type:str
clamp(arg2)

Returns the value clamped within the range.

Parameters:arg2 (int) –
Return type:int
contains(arg2)

Returns true if value is within range, false otherwise

Parameters:arg2 (int) –
Return type:bool
get(arg2)

Returns a value from within range based on percentage passed in

Parameters:arg2 (float) –
Return type:int
getRandom()

Returns a random value within range

Return type:int
end
Returns maximum value in range
max
Returns maximum value in range
min
Returns minimum value in range
start
Returns minimum value in range

RangeVector

class RangeVector
__init__(arg2)
Parameters:arg2 (Vector) –
__init__(arg2, arg3)
Parameters:
__str__()
Return type:str
clamp(arg2)

Returns the value clamped within the range.

Parameters:arg2 (Vector) –
Return type:Vector
contains(arg2)

Returns true if value is within range, false otherwise

Parameters:arg2 (Vector) –
Return type:bool
get(arg2)

Returns a value from within range based on percentage passed in

Parameters:arg2 (float) –
Return type:Vector
getRandom()

Returns a random value within range

Return type:Vector
end
Returns maximum value in range
max
Returns maximum value in range
min
Returns minimum value in range
start
Returns minimum value in range

Rect

class Rect
__eq__(arg2)
Parameters:arg2 (Rect) –
Return type:object
__init__(x, y, width, height)
Parameters:
  • x (float) –
  • y (float) –
  • width (float) –
  • height (float) –
__init__(position, size)
Parameters:
  • position (Vector) –
  • size (float) –
__init__(position, size)
Parameters:
__init__(rect)
Parameters:rect (sfRect) –
__init__(rect)
Parameters:rect (PixelRect) –
__init__(rect)
Parameters:rect (SubtileRect) –
__init__(rect)
Parameters:rect (TileRect) –
__init__(rect)
Parameters:rect (SegmentRect) –
__init__(rect)
Parameters:rect (ChunkRect) –
__init__(rect)
Parameters:rect (RegionRect) –
__init__(rect)
Parameters:rect (Rect) –
__ne__(arg2)
Parameters:arg2 (Rect) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
adjust(x, y, width, height)

Move by x,y then resize to width and height

Parameters:
  • x (float) – Value to be added x coordinate
  • y (float) – Change in y coordinate
  • width (float) – Value to be added to width
  • height (float) – Value to be added to height
asChunk()

Create a copy of this as a ChunkRect

Return type:ChunkRect
asPixel()

Create a copy of this as a PixelRect

Return type:PixelRect
asRect()

Create a copy of this as a Rect

Return type:Rect
asRegion()

Create a copy of this as a RegionRect

Return type:RegionRect
asSegment()

Create a copy of this as a SegmentRect

Return type:SegmentRect
asSubtile()

Create a copy of this as a SubtileRect

Return type:SubtileRect
asTile()

Create a copy of this as a TileRect

Return type:TileRect
contains(x, y[, loopWidth=0])

Return true if x,y are within this rectangle false otherwise

Parameters:
  • x (float) – x position to check
  • y (float) – y position to check
  • loopWidth (float) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if position is within this rectangle false otherwise

Parameters:
  • position (Vector) – x,y coordinates to check
  • loopWidth (float) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if provided rectangle is completely within the bounds of this otherwise false

Parameters:
  • position (Rect) –
  • loopWidth (float) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

intersects(rect[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise

Parameters:
  • rect (Rect) – Rectangle to check against
  • loopWidth (float) – How far to check on the x axis from rect.x
Return type:

bool

intersects(rect, intersection[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise. Saves overlapping coordinates to parameter intersection

Parameters:
  • rect (Rect) – Rectangle to check against
  • intersection (Rect) – overlapping coordinates are stored here
  • loopWidth (float) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (float) – Change in x coordinate
  • y (float) – Change in y coordinate
move(position)

Adds position to x,y coordinates

Parameters:position (Vector) – Value to be added to x,y coordinates
resize(width, height)

Expands width and height

Parameters:
  • width (float) – Value to be added to width
  • height (float) – Value to be added to height
toSfml()

Create a copy of this as a sfRect

Return type:sfRect
static fromCenter(center, size)

Create a new Rectangle from the center point.

Parameters:
Return type:

Rect

bottom
y + height
bottomLeft
(Vector) Bottom Left x,y coordinates.
bottomRight
(Vector) Bottom Right x,y coordinates.
center
(Vector) Center coordinates of Rectangle.
height
Size from y to bottom.
left
x coordinate
position
(Vector) Top Left x,y coordinates.
right
x + width
size
width * height
top
y coordinate
topLeft
(Vector) Top Left x,y coordinates.
topRight
(Vector) Top Right x,y coordinates.
width
Size from x to right.
x
x coordinate
y
y coordinate

RegionRect

class RegionRect
__eq__(arg2)
Parameters:arg2 (RegionRect) –
Return type:object
__init__(x, y, width, height)
Parameters:
  • x (int) –
  • y (int) –
  • width (int) –
  • height (int) –
__init__(position, size)
Parameters:
__init__(position, size)
Parameters:
__init__(rect)
Parameters:rect (sfIntRect) –
__init__(rect)
Parameters:rect (PixelRect) –
__init__(rect)
Parameters:rect (SubtileRect) –
__init__(rect)
Parameters:rect (TileRect) –
__init__(rect)
Parameters:rect (SegmentRect) –
__init__(rect)
Parameters:rect (ChunkRect) –
__init__(rect)
Parameters:rect (RegionRect) –
__init__(rect)
Parameters:rect (Rect) –
__ne__(arg2)
Parameters:arg2 (RegionRect) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
adjust(x, y, width, height)

Move by x,y then resize to width and height

Parameters:
  • x (int) – Value to be added x coordinate
  • y (int) – Change in y coordinate
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
asChunk()

Create a copy of this as a ChunkRect

Return type:ChunkRect
asPixel()

Create a copy of this as a PixelRect

Return type:PixelRect
asRect()

Create a copy of this as a Rect

Return type:Rect
asRegion()

Create a copy of this as a RegionRect

Return type:RegionRect
asSegment()

Create a copy of this as a SegmentRect

Return type:SegmentRect
asSubtile()

Create a copy of this as a SubtileRect

Return type:SubtileRect
asTile()

Create a copy of this as a TileRect

Return type:TileRect
contains(x, y[, loopWidth=0])

Return true if x,y are within this rectangle false otherwise

Parameters:
  • x (int) – x position to check
  • y (int) – y position to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if position is within this rectangle false otherwise

Parameters:
  • position (RegionVector) – x,y coordinates to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if provided rectangle is completely within the bounds of this otherwise false

Parameters:
  • position (RegionRect) –
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

intersects(rect[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise

Parameters:
  • rect (RegionRect) – Rectangle to check against
  • loopWidth (int) – How far to check on the x axis from rect.x
Return type:

bool

intersects(rect, intersection[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise. Saves overlapping coordinates to parameter intersection

Parameters:
  • rect (RegionRect) – Rectangle to check against
  • intersection (RegionRect) – overlapping coordinates are stored here
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
move(position)

Adds position to x,y coordinates

Parameters:position (RegionVector) – Value to be added to x,y coordinates
resize(width, height)

Expands width and height

Parameters:
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
toSfml()

Create a copy of this as a sfRect

Return type:sfIntRect
static fromCenter(center, size)

Create a new Rectangle from the center point.

Parameters:
Return type:

RegionRect

bottom
y + height
bottomLeft
(Vector) Bottom Left x,y coordinates.
bottomRight
(Vector) Bottom Right x,y coordinates.
center
(Vector) Center coordinates of Rectangle.
height
Size from y to bottom.
left
x coordinate
position
(Vector) Top Left x,y coordinates.
right
x + width
size
width * height
top
y coordinate
topLeft
(Vector) Top Left x,y coordinates.
topRight
(Vector) Top Right x,y coordinates.
width
Size from x to right.
x
x coordinate
y
y coordinate

RegionVector

class RegionVector
__add__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
__cmp__(vector)

Compares this to another vector

Parameters:vector (RegionVector) – The vector to compare against
Returns:0 if vectors are the same, -1 if arg is greater, 1 if arg is less than
Return type:int
__div__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
__div__(arg2)
Parameters:arg2 (float) –
Return type:RegionVector
__eq__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
__iadd__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
__idiv__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
__imul__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
__init__(x, y)
Parameters:
  • x (int) –
  • y (int) –
__init__(x, y, loopWidth)
Parameters:
  • x (int) –
  • y (int) –
  • loopWidth (int) –
__init__(position)
Parameters:position (sfTileVector) –
__init__(position, loopWidth)
Parameters:
__init__(position)
Parameters:position (RegionVector) –
__init__(position)
Parameters:position (PixelVector) –
__init__(position)
Parameters:position (SubtileVector) –
__init__(position)
Parameters:position (TileVector) –
__init__(position)
Parameters:position (SegmentVector) –
__init__(position)
Parameters:position (ChunkVector) –
__init__(position)
Parameters:position (RegionVector) –
__init__(position)
Parameters:position (Vector) –
__isub__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (float) –
Return type:RegionVector
__ne__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
__sub__(arg2)
Parameters:arg2 (RegionVector) –
Return type:object
asChunk()

Create a copy of this as a ChunkVector

Return type:ChunkVector
asPixel()

Create a copy of this as a PixelVector

Return type:PixelVector
asRegion()

Create a copy of this as a RegionVector

Return type:RegionVector
asSegment()

Create a copy of this as a SegmentVector

Return type:SegmentVector
asSubtile()

Create a copy of this as a SubtileVector

Return type:SubtileVector
asTile()

Create a copy of this as a TileVector

Return type:TileVector
asVector()

Create a copy of this as a vector

Return type:Vector
getAngle([asDegrees=True])

Return the angle or direction of this vector

Parameters:asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:float
getAngle(position[, loopWidth=0[, asDegrees=True]])

Return the angle or direction of position

Parameters:
  • position (RegionVector) – The vector to convert
  • loopWidth (int) – X coordinate for wrap around
  • asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:

float

getDirection(position[, loopWidth=0])

Returns a unit vector in the direction of position

Parameters:
  • position (RegionVector) – The Vector to calculate direction from
  • loopWidth (int) – X coordinate for wrap around
Return type:

PixelVector

getDirectionX(x[, loopWidth=0])

Returns direction towards x

Parameters:
  • x (int) – X coordinate for direction calculation
  • loopWidth (int) – X coordinate for wrap around
Return type:

int

getDirectionY(y[, loopWidth=0])

Returns direction towards y

Parameters:
  • y (int) – Y coordinate for direction calculation
  • loopWidth (int) – Currently has no effect
Return type:

int

getDistance(position[, loopWidth=0])

Returns the distance from position

Parameters:
  • position (RegionVector) – The Vector to calculate distance from
  • loopWidth (int) – X coordinate for wrap around
Return type:

float

isDefault()

Returns true if x==0 and y==0, false otherwise

Return type:bool
loop(loopWidth)

Adds loopWidth to x if x < 0. Subtracts loopWidth from x if x >= loopWidth

Parameters:loopWidth (int) – Amount to adjust x coordinate
move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
shouldLoop(loopWidth)

Returns True if x < 0 or x >= loopWidth

Parameters:loopWidth (int) – X coordinate for wrap around
Return type:bool
toSfml()

Create a copy of this as a sfTileVector

Return type:sfTileVector
height
y coordinate
width
x coordinate
x
x coordinate
y
y coordinate

SegmentRect

class SegmentRect
__eq__(arg2)
Parameters:arg2 (SegmentRect) –
Return type:object
__init__(x, y, width, height)
Parameters:
  • x (int) –
  • y (int) –
  • width (int) –
  • height (int) –
__init__(position, size)
Parameters:
__init__(position, size)
Parameters:
__init__(rect)
Parameters:rect (sfIntRect) –
__init__(rect)
Parameters:rect (PixelRect) –
__init__(rect)
Parameters:rect (SubtileRect) –
__init__(rect)
Parameters:rect (TileRect) –
__init__(rect)
Parameters:rect (SegmentRect) –
__init__(rect)
Parameters:rect (ChunkRect) –
__init__(rect)
Parameters:rect (RegionRect) –
__init__(rect)
Parameters:rect (Rect) –
__ne__(arg2)
Parameters:arg2 (SegmentRect) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
adjust(x, y, width, height)

Move by x,y then resize to width and height

Parameters:
  • x (int) – Value to be added x coordinate
  • y (int) – Change in y coordinate
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
asChunk()

Create a copy of this as a ChunkRect

Return type:ChunkRect
asPixel()

Create a copy of this as a PixelRect

Return type:PixelRect
asRect()

Create a copy of this as a Rect

Return type:Rect
asRegion()

Create a copy of this as a RegionRect

Return type:RegionRect
asSegment()

Create a copy of this as a SegmentRect

Return type:SegmentRect
asSubtile()

Create a copy of this as a SubtileRect

Return type:SubtileRect
asTile()

Create a copy of this as a TileRect

Return type:TileRect
contains(x, y[, loopWidth=0])

Return true if x,y are within this rectangle false otherwise

Parameters:
  • x (int) – x position to check
  • y (int) – y position to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if position is within this rectangle false otherwise

Parameters:
  • position (SegmentVector) – x,y coordinates to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if provided rectangle is completely within the bounds of this otherwise false

Parameters:
  • position (SegmentRect) –
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

intersects(rect[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise

Parameters:
  • rect (SegmentRect) – Rectangle to check against
  • loopWidth (int) – How far to check on the x axis from rect.x
Return type:

bool

intersects(rect, intersection[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise. Saves overlapping coordinates to parameter intersection

Parameters:
  • rect (SegmentRect) – Rectangle to check against
  • intersection (SegmentRect) – overlapping coordinates are stored here
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
move(position)

Adds position to x,y coordinates

Parameters:position (SegmentVector) – Value to be added to x,y coordinates
resize(width, height)

Expands width and height

Parameters:
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
toSfml()

Create a copy of this as a sfRect

Return type:sfIntRect
static fromCenter(center, size)

Create a new Rectangle from the center point.

Parameters:
Return type:

SegmentRect

bottom
y + height
bottomLeft
(Vector) Bottom Left x,y coordinates.
bottomRight
(Vector) Bottom Right x,y coordinates.
center
(Vector) Center coordinates of Rectangle.
height
Size from y to bottom.
left
x coordinate
position
(Vector) Top Left x,y coordinates.
right
x + width
size
width * height
top
y coordinate
topLeft
(Vector) Top Left x,y coordinates.
topRight
(Vector) Top Right x,y coordinates.
width
Size from x to right.
x
x coordinate
y
y coordinate

SegmentVector

class SegmentVector
__add__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
__cmp__(vector)

Compares this to another vector

Parameters:vector (SegmentVector) – The vector to compare against
Returns:0 if vectors are the same, -1 if arg is greater, 1 if arg is less than
Return type:int
__div__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
__div__(arg2)
Parameters:arg2 (float) –
Return type:SegmentVector
__eq__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
__iadd__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
__idiv__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
__imul__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
__init__(x, y)
Parameters:
  • x (int) –
  • y (int) –
__init__(x, y, loopWidth)
Parameters:
  • x (int) –
  • y (int) –
  • loopWidth (int) –
__init__(position)
Parameters:position (sfTileVector) –
__init__(position, loopWidth)
Parameters:
__init__(position)
Parameters:position (SegmentVector) –
__init__(position)
Parameters:position (PixelVector) –
__init__(position)
Parameters:position (SubtileVector) –
__init__(position)
Parameters:position (TileVector) –
__init__(position)
Parameters:position (SegmentVector) –
__init__(position)
Parameters:position (ChunkVector) –
__init__(position)
Parameters:position (RegionVector) –
__init__(position)
Parameters:position (Vector) –
__isub__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (float) –
Return type:SegmentVector
__ne__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
__sub__(arg2)
Parameters:arg2 (SegmentVector) –
Return type:object
asChunk()

Create a copy of this as a ChunkVector

Return type:ChunkVector
asPixel()

Create a copy of this as a PixelVector

Return type:PixelVector
asRegion()

Create a copy of this as a RegionVector

Return type:RegionVector
asSegment()

Create a copy of this as a SegmentVector

Return type:SegmentVector
asSubtile()

Create a copy of this as a SubtileVector

Return type:SubtileVector
asTile()

Create a copy of this as a TileVector

Return type:TileVector
asVector()

Create a copy of this as a vector

Return type:Vector
getAngle([asDegrees=True])

Return the angle or direction of this vector

Parameters:asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:float
getAngle(position[, loopWidth=0[, asDegrees=True]])

Return the angle or direction of position

Parameters:
  • position (SegmentVector) – The vector to convert
  • loopWidth (int) – X coordinate for wrap around
  • asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:

float

getDirection(position[, loopWidth=0])

Returns a unit vector in the direction of position

Parameters:
  • position (SegmentVector) – The Vector to calculate direction from
  • loopWidth (int) – X coordinate for wrap around
Return type:

PixelVector

getDirectionX(x[, loopWidth=0])

Returns direction towards x

Parameters:
  • x (int) – X coordinate for direction calculation
  • loopWidth (int) – X coordinate for wrap around
Return type:

int

getDirectionY(y[, loopWidth=0])

Returns direction towards y

Parameters:
  • y (int) – Y coordinate for direction calculation
  • loopWidth (int) – Currently has no effect
Return type:

int

getDistance(position[, loopWidth=0])

Returns the distance from position

Parameters:
  • position (SegmentVector) – The Vector to calculate distance from
  • loopWidth (int) – X coordinate for wrap around
Return type:

float

isDefault()

Returns true if x==0 and y==0, false otherwise

Return type:bool
loop(loopWidth)

Adds loopWidth to x if x < 0. Subtracts loopWidth from x if x >= loopWidth

Parameters:loopWidth (int) – Amount to adjust x coordinate
move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
shouldLoop(loopWidth)

Returns True if x < 0 or x >= loopWidth

Parameters:loopWidth (int) – X coordinate for wrap around
Return type:bool
toSfml()

Create a copy of this as a sfTileVector

Return type:sfTileVector
height
y coordinate
width
x coordinate
x
x coordinate
y
y coordinate

Sizes

class Sizes
CHUNK
CHUNK_TILE
PIXEL
REGION
REGION_CHUNK
REGION_SEGMENT
REGION_SUBTILE
REGION_TILE
SEGMENT
SEGMENT_SUBTILE
SEGMENT_TILE
SUBTILE
TILE
TILE_SUBTILE

SpatialHash

class SpatialHash
__init__(size, realmSize)
Parameters:
add(obj)

Adds object to spatial hash

Parameters:obj (object) – object to store
clear()

Removes all objects and sections from spatial hash

clearSections(sections)

Removes specified sections from spatial hash

Parameters:sections (SegmentList) – List of sections to be removed
get(sections)

Returns a set of objects that are within sections

Parameters:sections (SegmentList) – List of sections to search
Return type:object
getAll()

Returns all objects in this spatial hash

Return type:object
getNearby(area)

Returns a set of objects that are within area

Parameters:area (Rect) – The size of the area to search
Return type:object
getSection(point)

Returns a section that contains point

Parameters:point (Vector) – The x,y coordinates to search for
Return type:int
getSections(rect)

Returns a list of sections that contain rect

Parameters:rect (Rect) – Search for this area
Return type:SegmentList
has(obj)

Returns true if obj is present in this space, false otherwise

Parameters:obj (object) – The object to search for
Return type:bool
remove(obj)

Removes object from spatial hash

Parameters:obj (object) – this will be removed from spatial hash

StringList

class StringList
__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:
  • arg2 (object) –
  • arg3 (object) –
append(arg2)
Parameters:arg2 (object) –
extend(arg2)
Parameters:arg2 (object) –

StringMap

class StringMap
__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:
  • arg2 (object) –
  • arg3 (object) –

StringSet

class StringSet
__contains__(arg2)
Parameters:arg2 (object) –
Return type:bool
__contains__(arg2)
Parameters:arg2 (str) –
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:
  • arg2 (object) –
  • arg3 (object) –
add(arg2)
Parameters:arg2 (str) –
clear()
has(arg2)
Parameters:arg2 (str) –
Return type:bool
remove(arg2)
Parameters:arg2 (str) –

StringSetMap

class StringSetMap
__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:
  • arg2 (object) –
  • arg3 (object) –

SubtileRect

class SubtileRect
__eq__(arg2)
Parameters:arg2 (SubtileRect) –
Return type:object
__init__(x, y, width, height)
Parameters:
  • x (int) –
  • y (int) –
  • width (int) –
  • height (int) –
__init__(position, size)
Parameters:
__init__(position, size)
Parameters:
__init__(rect)
Parameters:rect (sfIntRect) –
__init__(rect)
Parameters:rect (PixelRect) –
__init__(rect)
Parameters:rect (SubtileRect) –
__init__(rect)
Parameters:rect (TileRect) –
__init__(rect)
Parameters:rect (SegmentRect) –
__init__(rect)
Parameters:rect (ChunkRect) –
__init__(rect)
Parameters:rect (RegionRect) –
__init__(rect)
Parameters:rect (Rect) –
__ne__(arg2)
Parameters:arg2 (SubtileRect) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
adjust(x, y, width, height)

Move by x,y then resize to width and height

Parameters:
  • x (int) – Value to be added x coordinate
  • y (int) – Change in y coordinate
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
asChunk()

Create a copy of this as a ChunkRect

Return type:ChunkRect
asPixel()

Create a copy of this as a PixelRect

Return type:PixelRect
asRect()

Create a copy of this as a Rect

Return type:Rect
asRegion()

Create a copy of this as a RegionRect

Return type:RegionRect
asSegment()

Create a copy of this as a SegmentRect

Return type:SegmentRect
asSubtile()

Create a copy of this as a SubtileRect

Return type:SubtileRect
asTile()

Create a copy of this as a TileRect

Return type:TileRect
contains(x, y[, loopWidth=0])

Return true if x,y are within this rectangle false otherwise

Parameters:
  • x (int) – x position to check
  • y (int) – y position to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if position is within this rectangle false otherwise

Parameters:
  • position (SubtileVector) – x,y coordinates to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if provided rectangle is completely within the bounds of this otherwise false

Parameters:
  • position (SubtileRect) –
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

intersects(rect[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise

Parameters:
  • rect (SubtileRect) – Rectangle to check against
  • loopWidth (int) – How far to check on the x axis from rect.x
Return type:

bool

intersects(rect, intersection[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise. Saves overlapping coordinates to parameter intersection

Parameters:
  • rect (SubtileRect) – Rectangle to check against
  • intersection (SubtileRect) – overlapping coordinates are stored here
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
move(position)

Adds position to x,y coordinates

Parameters:position (SubtileVector) – Value to be added to x,y coordinates
resize(width, height)

Expands width and height

Parameters:
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
toSfml()

Create a copy of this as a sfRect

Return type:sfIntRect
static fromCenter(center, size)

Create a new Rectangle from the center point.

Parameters:
Return type:

SubtileRect

bottom
y + height
bottomLeft
(Vector) Bottom Left x,y coordinates.
bottomRight
(Vector) Bottom Right x,y coordinates.
center
(Vector) Center coordinates of Rectangle.
height
Size from y to bottom.
left
x coordinate
position
(Vector) Top Left x,y coordinates.
right
x + width
size
width * height
top
y coordinate
topLeft
(Vector) Top Left x,y coordinates.
topRight
(Vector) Top Right x,y coordinates.
width
Size from x to right.
x
x coordinate
y
y coordinate

SubtileVector

class SubtileVector
__add__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
__cmp__(vector)

Compares this to another vector

Parameters:vector (SubtileVector) – The vector to compare against
Returns:0 if vectors are the same, -1 if arg is greater, 1 if arg is less than
Return type:int
__div__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
__div__(arg2)
Parameters:arg2 (float) –
Return type:SubtileVector
__eq__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
__iadd__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
__idiv__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
__imul__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
__init__(x, y)
Parameters:
  • x (int) –
  • y (int) –
__init__(x, y, loopWidth)
Parameters:
  • x (int) –
  • y (int) –
  • loopWidth (int) –
__init__(position)
Parameters:position (sfTileVector) –
__init__(position, loopWidth)
Parameters:
__init__(position)
Parameters:position (SubtileVector) –
__init__(position)
Parameters:position (PixelVector) –
__init__(position)
Parameters:position (SubtileVector) –
__init__(position)
Parameters:position (TileVector) –
__init__(position)
Parameters:position (SegmentVector) –
__init__(position)
Parameters:position (ChunkVector) –
__init__(position)
Parameters:position (RegionVector) –
__init__(position)
Parameters:position (Vector) –
__isub__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (float) –
Return type:SubtileVector
__ne__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
__sub__(arg2)
Parameters:arg2 (SubtileVector) –
Return type:object
asChunk()

Create a copy of this as a ChunkVector

Return type:ChunkVector
asPixel()

Create a copy of this as a PixelVector

Return type:PixelVector
asRegion()

Create a copy of this as a RegionVector

Return type:RegionVector
asSegment()

Create a copy of this as a SegmentVector

Return type:SegmentVector
asSubtile()

Create a copy of this as a SubtileVector

Return type:SubtileVector
asTile()

Create a copy of this as a TileVector

Return type:TileVector
asVector()

Create a copy of this as a vector

Return type:Vector
getAngle([asDegrees=True])

Return the angle or direction of this vector

Parameters:asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:float
getAngle(position[, loopWidth=0[, asDegrees=True]])

Return the angle or direction of position

Parameters:
  • position (SubtileVector) – The vector to convert
  • loopWidth (int) – X coordinate for wrap around
  • asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:

float

getDirection(position[, loopWidth=0])

Returns a unit vector in the direction of position

Parameters:
  • position (SubtileVector) – The Vector to calculate direction from
  • loopWidth (int) – X coordinate for wrap around
Return type:

PixelVector

getDirectionX(x[, loopWidth=0])

Returns direction towards x

Parameters:
  • x (int) – X coordinate for direction calculation
  • loopWidth (int) – X coordinate for wrap around
Return type:

int

getDirectionY(y[, loopWidth=0])

Returns direction towards y

Parameters:
  • y (int) – Y coordinate for direction calculation
  • loopWidth (int) – Currently has no effect
Return type:

int

getDistance(position[, loopWidth=0])

Returns the distance from position

Parameters:
  • position (SubtileVector) – The Vector to calculate distance from
  • loopWidth (int) – X coordinate for wrap around
Return type:

float

isDefault()

Returns true if x==0 and y==0, false otherwise

Return type:bool
loop(loopWidth)

Adds loopWidth to x if x < 0. Subtracts loopWidth from x if x >= loopWidth

Parameters:loopWidth (int) – Amount to adjust x coordinate
move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
shouldLoop(loopWidth)

Returns True if x < 0 or x >= loopWidth

Parameters:loopWidth (int) – X coordinate for wrap around
Return type:bool
toSfml()

Create a copy of this as a sfTileVector

Return type:sfTileVector
height
y coordinate
width
x coordinate
x
x coordinate
y
y coordinate

TileRect

class TileRect
__eq__(arg2)
Parameters:arg2 (TileRect) –
Return type:object
__init__(x, y, width, height)
Parameters:
  • x (int) –
  • y (int) –
  • width (int) –
  • height (int) –
__init__(position, size)
Parameters:
__init__(position, size)
Parameters:
__init__(rect)
Parameters:rect (sfIntRect) –
__init__(rect)
Parameters:rect (PixelRect) –
__init__(rect)
Parameters:rect (SubtileRect) –
__init__(rect)
Parameters:rect (TileRect) –
__init__(rect)
Parameters:rect (SegmentRect) –
__init__(rect)
Parameters:rect (ChunkRect) –
__init__(rect)
Parameters:rect (RegionRect) –
__init__(rect)
Parameters:rect (Rect) –
__ne__(arg2)
Parameters:arg2 (TileRect) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
adjust(x, y, width, height)

Move by x,y then resize to width and height

Parameters:
  • x (int) – Value to be added x coordinate
  • y (int) – Change in y coordinate
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
asChunk()

Create a copy of this as a ChunkRect

Return type:ChunkRect
asPixel()

Create a copy of this as a PixelRect

Return type:PixelRect
asRect()

Create a copy of this as a Rect

Return type:Rect
asRegion()

Create a copy of this as a RegionRect

Return type:RegionRect
asSegment()

Create a copy of this as a SegmentRect

Return type:SegmentRect
asSubtile()

Create a copy of this as a SubtileRect

Return type:SubtileRect
asTile()

Create a copy of this as a TileRect

Return type:TileRect
contains(x, y[, loopWidth=0])

Return true if x,y are within this rectangle false otherwise

Parameters:
  • x (int) – x position to check
  • y (int) – y position to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if position is within this rectangle false otherwise

Parameters:
  • position (TileVector) – x,y coordinates to check
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

contains(position[, loopWidth=0])

Return true if provided rectangle is completely within the bounds of this otherwise false

Parameters:
  • position (TileRect) –
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

intersects(rect[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise

Parameters:
  • rect (TileRect) – Rectangle to check against
  • loopWidth (int) – How far to check on the x axis from rect.x
Return type:

bool

intersects(rect, intersection[, loopWidth=0])

Returns true if rect is overlapping this rectangle, false otherwise. Saves overlapping coordinates to parameter intersection

Parameters:
  • rect (TileRect) – Rectangle to check against
  • intersection (TileRect) – overlapping coordinates are stored here
  • loopWidth (int) – The loopWidth of the realm. Use realm.size.loopWidth for Rect and realm.size.loopTileWidth for Tile:class:Rect.
Return type:

bool

move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
move(position)

Adds position to x,y coordinates

Parameters:position (TileVector) – Value to be added to x,y coordinates
resize(width, height)

Expands width and height

Parameters:
  • width (int) – Value to be added to width
  • height (int) – Value to be added to height
toSfml()

Create a copy of this as a sfRect

Return type:sfIntRect
static fromCenter(center, size)

Create a new Rectangle from the center point.

Parameters:
Return type:

TileRect

bottom
y + height
bottomLeft
(Vector) Bottom Left x,y coordinates.
bottomRight
(Vector) Bottom Right x,y coordinates.
center
(Vector) Center coordinates of Rectangle.
height
Size from y to bottom.
left
x coordinate
position
(Vector) Top Left x,y coordinates.
right
x + width
size
width * height
top
y coordinate
topLeft
(Vector) Top Left x,y coordinates.
topRight
(Vector) Top Right x,y coordinates.
width
Size from x to right.
x
x coordinate
y
y coordinate

TileVector

class TileVector
__add__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
__cmp__(vector)

Compares this to another vector

Parameters:vector (TileVector) – The vector to compare against
Returns:0 if vectors are the same, -1 if arg is greater, 1 if arg is less than
Return type:int
__div__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
__div__(arg2)
Parameters:arg2 (float) –
Return type:TileVector
__eq__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
__iadd__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
__idiv__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
__imul__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
__init__(x, y)
Parameters:
  • x (int) –
  • y (int) –
__init__(x, y, loopWidth)
Parameters:
  • x (int) –
  • y (int) –
  • loopWidth (int) –
__init__(position)
Parameters:position (sfTileVector) –
__init__(position, loopWidth)
Parameters:
__init__(position)
Parameters:position (TileVector) –
__init__(position)
Parameters:position (PixelVector) –
__init__(position)
Parameters:position (SubtileVector) –
__init__(position)
Parameters:position (TileVector) –
__init__(position)
Parameters:position (SegmentVector) –
__init__(position)
Parameters:position (ChunkVector) –
__init__(position)
Parameters:position (RegionVector) –
__init__(position)
Parameters:position (Vector) –
__isub__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (float) –
Return type:TileVector
__ne__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
__sub__(arg2)
Parameters:arg2 (TileVector) –
Return type:object
asChunk()

Create a copy of this as a ChunkVector

Return type:ChunkVector
asPixel()

Create a copy of this as a PixelVector

Return type:PixelVector
asRegion()

Create a copy of this as a RegionVector

Return type:RegionVector
asSegment()

Create a copy of this as a SegmentVector

Return type:SegmentVector
asSubtile()

Create a copy of this as a SubtileVector

Return type:SubtileVector
asTile()

Create a copy of this as a TileVector

Return type:TileVector
asVector()

Create a copy of this as a vector

Return type:Vector
getAngle([asDegrees=True])

Return the angle or direction of this vector

Parameters:asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:float
getAngle(position[, loopWidth=0[, asDegrees=True]])

Return the angle or direction of position

Parameters:
  • position (TileVector) – The vector to convert
  • loopWidth (int) – X coordinate for wrap around
  • asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:

float

getDirection(position[, loopWidth=0])

Returns a unit vector in the direction of position

Parameters:
  • position (TileVector) – The Vector to calculate direction from
  • loopWidth (int) – X coordinate for wrap around
Return type:

PixelVector

getDirectionX(x[, loopWidth=0])

Returns direction towards x

Parameters:
  • x (int) – X coordinate for direction calculation
  • loopWidth (int) – X coordinate for wrap around
Return type:

int

getDirectionY(y[, loopWidth=0])

Returns direction towards y

Parameters:
  • y (int) – Y coordinate for direction calculation
  • loopWidth (int) – Currently has no effect
Return type:

int

getDistance(position[, loopWidth=0])

Returns the distance from position

Parameters:
  • position (TileVector) – The Vector to calculate distance from
  • loopWidth (int) – X coordinate for wrap around
Return type:

float

isDefault()

Returns true if x==0 and y==0, false otherwise

Return type:bool
loop(loopWidth)

Adds loopWidth to x if x < 0. Subtracts loopWidth from x if x >= loopWidth

Parameters:loopWidth (int) – Amount to adjust x coordinate
move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (int) – Change in x coordinate
  • y (int) – Change in y coordinate
shouldLoop(loopWidth)

Returns True if x < 0 or x >= loopWidth

Parameters:loopWidth (int) – X coordinate for wrap around
Return type:bool
toSfml()

Create a copy of this as a sfTileVector

Return type:sfTileVector
height
y coordinate
width
x coordinate
x
x coordinate
y
y coordinate

TileVectorList

class TileVectorList
__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:
  • arg2 (object) –
  • arg3 (object) –
append(arg2)
Parameters:arg2 (object) –
extend(arg2)
Parameters:arg2 (object) –

TileVectorSet

class TileVectorSet
__contains__(arg2)
Parameters:arg2 (object) –
Return type:bool
__contains__(arg2)
Parameters:arg2 (TileVector) –
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:
  • arg2 (object) –
  • arg3 (object) –
add(arg2)
Parameters:arg2 (TileVector) –
clear()
has(arg2)
Parameters:arg2 (TileVector) –
Return type:bool
remove(arg2)
Parameters:arg2 (TileVector) –

Time

class Time
asMicroseconds()
Return type:long
asMilliseconds()
Return type:int
asSeconds()
Return type:float

Timer

class Timer
__iadd__(time)
Parameters:time (int) –
Return type:Timer
__init__(time)
Parameters:time (int) –
__isub__(time)
Parameters:time (int) –
Return type:Timer
expired()

Returns true if timer has no remaining time left, false otherwise

Return type:bool
percentage()

Return percentage of remaining time

Return type:float
remaining()

Returns the remaining time before timer expries

Return type:int
reset([time=0])

Resets timer to a new amount

Parameters:time (int) – Time in milliseconds until timer expires
restart()
stop()

Stops the timer.

Return type:int
total()

Return original total from last reset

Return type:int
update(frameTime)

Subtracts frameTime from remaining time

Parameters:frameTime (int) – The amount of milliseconds to subtract from remaining time

Uint32List

class Uint32List
__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:
  • arg2 (object) –
  • arg3 (object) –
append(arg2)
Parameters:arg2 (object) –
extend(arg2)
Parameters:arg2 (object) –

Uint32Set

class Uint32Set
__contains__(arg2)
Parameters:arg2 (object) –
Return type:bool
__contains__(arg2)
Parameters:arg2 (int) –
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:
  • arg2 (object) –
  • arg3 (object) –
add(arg2)
Parameters:arg2 (int) –
clear()
has(arg2)
Parameters:arg2 (int) –
Return type:bool
remove(arg2)
Parameters:arg2 (int) –

Uint8List

class Uint8List
__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:
  • arg2 (object) –
  • arg3 (object) –
append(arg2)
Parameters:arg2 (object) –
extend(arg2)
Parameters:arg2 (object) –

Vector

class Vector
__add__(arg2)
Parameters:arg2 (Vector) –
Return type:object
__cmp__(vector)

Compares this to another vector

Parameters:vector (Vector) – The vector to compare against
Returns:0 if vectors are the same, -1 if arg is greater, 1 if arg is less than
Return type:int
__div__(arg2)
Parameters:arg2 (Vector) –
Return type:object
__div__(arg2)
Parameters:arg2 (float) –
Return type:Vector
__eq__(arg2)
Parameters:arg2 (Vector) –
Return type:object
__iadd__(arg2)
Parameters:arg2 (Vector) –
Return type:object
__idiv__(arg2)
Parameters:arg2 (Vector) –
Return type:object
__imul__(arg2)
Parameters:arg2 (Vector) –
Return type:object
__init__(x, y)
Parameters:
  • x (float) –
  • y (float) –
__init__(x, y, loopWidth)
Parameters:
  • x (float) –
  • y (float) –
  • loopWidth (float) –
__init__(position)
Parameters:position (sfVector) –
__init__(position, loopWidth)
Parameters:
  • position (sfVector) –
  • loopWidth (float) –
__init__(position)
Parameters:position (Vector) –
__init__(position)
Parameters:position (PixelVector) –
__init__(position)
Parameters:position (SubtileVector) –
__init__(position)
Parameters:position (TileVector) –
__init__(position)
Parameters:position (SegmentVector) –
__init__(position)
Parameters:position (ChunkVector) –
__init__(position)
Parameters:position (RegionVector) –
__init__(position)
Parameters:position (Vector) –
__isub__(arg2)
Parameters:arg2 (Vector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (Vector) –
Return type:object
__mul__(arg2)
Parameters:arg2 (float) –
Return type:Vector
__ne__(arg2)
Parameters:arg2 (Vector) –
Return type:object
__repr__()

A printable representation of this object.

Return type:str
__sub__(arg2)
Parameters:arg2 (Vector) –
Return type:object
asChunk()

Create a copy of this as a ChunkVector

Return type:ChunkVector
asPixel()

Create a copy of this as a PixelVector

Return type:PixelVector
asRegion()

Create a copy of this as a RegionVector

Return type:RegionVector
asSegment()

Create a copy of this as a SegmentVector

Return type:SegmentVector
asSubtile()

Create a copy of this as a SubtileVector

Return type:SubtileVector
asTile()

Create a copy of this as a TileVector

Return type:TileVector
asVector()

Create a copy of this as a vector

Return type:Vector
getAngle([asDegrees=True])

Return the angle or direction of this vector

Parameters:asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:float
getAngle(position[, loopWidth=0[, asDegrees=True]])

Return the angle or direction of position

Parameters:
  • position (Vector) – The vector to convert
  • loopWidth (float) – X coordinate for wrap around
  • asDegrees (bool) – If this is true return angle in degrees, else return angle in radians
Return type:

float

getDirection(position[, loopWidth=0])

Returns a unit vector in the direction of position

Parameters:
  • position (Vector) – The Vector to calculate direction from
  • loopWidth (float) – X coordinate for wrap around
Return type:

PixelVector

getDirectionX(x[, loopWidth=0])

Returns direction towards x

Parameters:
  • x (float) – X coordinate for direction calculation
  • loopWidth (float) – X coordinate for wrap around
Return type:

int

getDirectionY(y[, loopWidth=0])

Returns direction towards y

Parameters:
  • y (float) – Y coordinate for direction calculation
  • loopWidth (float) – Currently has no effect
Return type:

int

getDistance(position[, loopWidth=0])

Returns the distance from position

Parameters:
  • position (Vector) – The Vector to calculate distance from
  • loopWidth (float) – X coordinate for wrap around
Return type:

float

isDefault()

Returns true if x==0 and y==0, false otherwise

Return type:bool
loop(loopWidth)

Adds loopWidth to x if x < 0. Subtracts loopWidth from x if x >= loopWidth

Parameters:loopWidth (float) – Amount to adjust x coordinate
move(x, y)

Adds arguments to current x,y values

Parameters:
  • x (float) – Change in x coordinate
  • y (float) – Change in y coordinate
shouldLoop(loopWidth)

Returns True if x < 0 or x >= loopWidth

Parameters:loopWidth (float) – X coordinate for wrap around
Return type:bool
toSfml()

Create a copy of this as a sfTileVector

Return type:sfVector
height
y coordinate
width
x coordinate
x
x coordinate
y
y coordinate

Vector3

class Vector3
__add__(arg2)
Parameters:arg2 (Vector3) –
Return type:object
__div__(arg2)
Parameters:arg2 (float) –
Return type:Vector3
__eq__(arg2)
Parameters:arg2 (Vector3) –
Return type:object
__iadd__(arg2)
Parameters:arg2 (Vector3) –
Return type:object
__idiv__(arg2)
Parameters:arg2 (Vector3) –
Return type:object
__imul__(arg2)
Parameters:arg2 (Vector3) –
Return type:object
__init__(x, y, z)
Parameters:
  • x (float) –
  • y (float) –
  • z (float) –
__init__(position)
Parameters:position (sfVector3f) –
__init__(position)
Parameters:position (Vector3) –
__isub__(arg2)
Parameters:arg2 (Vector3) –
Return type:object
__mul__(arg2)
Parameters:arg2 (Vector3) –
Return type:object
__mul__(arg2)
Parameters:arg2 (float) –
Return type:Vector3
__ne__(arg2)
Parameters:arg2 (Vector3) –
Return type:object
__repr__()
Return type:str
__sub__(arg2)
Parameters:arg2 (Vector3) –
Return type:object
asChunk()
Return type:object
asPixel()
Return type:Vector3
asRegion()
Return type:object
asSegment()
Return type:object
asSubtile()
Return type:object
asTile()
Return type:object
asVector()
Return type:Vector3
move(x, y, z)
Parameters:
  • x (float) –
  • y (float) –
  • z (float) –
toSfml()
Return type:sfVector3f
x
y
z

Vector3List

class Vector3List
__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:
  • arg2 (object) –
  • arg3 (object) –
append(arg2)
Parameters:arg2 (object) –
extend(arg2)
Parameters:arg2 (object) –

WeightedRandomGenerator

class WeightedRandomGenerator
__call__([useWorldRandom=False])

Returns and index to one of the values randomly based on individual weight

Parameters:useWorldRandom (bool) – if True then use :class:`World:class:`Random``() else use :class:`Random`()
Return type:int
__call__(start, end[, useWorldRandom=False])

Restricts value to range of min, max weight. Returns and index to one of the values randomly based on individual weight

Parameters:
  • start (int) – minimum value in range
  • end (int) – maximum value in range
  • useWorldRandom (bool) – if True then use :class:`World:class:`Random``() else use :class:`Random`()
Return type:

int

__init__(arg2)
Parameters:arg2 (list) –
__init__(arg2)
Parameters:arg2 (Uint32List) –
findIndex(target)

Returns the index of the first weight that is greater than target

Parameters:target (int) – minimum weight of desired index
Return type:int
hasWeights()

Returns true if initialization has occured

Return type:bool
setWeights(list)

Intialize with a list of weights. Then adjust them to account for individual weight based off of total.

Parameters:list (list) – individual values to be totalled
setWeights(list)

Intialize with a list of weights. Then adjust them to account for individual weight based off of total.

Parameters:list (Uint32List) – individual values to be totalled
totals
List of individual weights

WorldRandom

class WorldRandom
static get(min, max)

Return random float within min and max

Parameters:
  • min (float) – minimum value in range
  • max (float) – maximum value in range
Return type:

float

static get([max=2147483647])

Returns an integer from 0 to max

Parameters:max (int) – maximum value for range
Return type:int
static get(min, max)

Return random integer within min and max

Parameters:
  • min (int) – minimum value in range
  • max (int) – maximum value in range
Return type:

int

static get(arg1)
Parameters:arg1 (list) –
Return type:object
static getBool()

Returns true or false randomly

Return type:bool
static getFloat()

Returns a random float from 0.0 to 1.0

Return type:float
static read(stream)

read current seed from stream

Parameters:stream (DataStream) – where to read from
static seed(seed)

Sets the seed for generating numbers

Parameters:seed (int) – set seed to this value
static write(stream)

Write current seed to stream

Parameters:stream (DataStream) – where to write to