Mind.Orientation¶
Classes, methods and functions marked with * aren’t for usual cases, they are made to help to the rest of the library.
-
exception
Mind.Orientation.
MapError
(x, y, max_x, max_y)[source]¶ Exception for points outside the map.*
-
class
Mind.Orientation.
point
(x, y, Map, description='Unknown', quiet=False)[source]¶ Basic point class.
-
class
Mind.Orientation.
line
(points, Map, description='Unknown', quiet=False, from_line_seg=False)[source]¶ Basic line class.
-
class
Mind.Orientation.
line_seg
(points, Map, description='Unknown', quiet=False, from_line=False)[source]¶ Basic line segment class.
-
class
Mind.Orientation.
ray
(start_p, some_p, Map, description='Unknown', quiet=False)[source]¶ Basic ray class.
-
class
Mind.Orientation.
direction
(point, angle, Map, description='Unknown', quiet=False)[source]¶ Basic direction class.
-
class
Mind.Orientation.
group_of_points
(Map, description='Unknown', *points, quiet=False)[source]¶ Class for group of points.
-
class
Mind.Orientation.
rect
(x, y, width, height, Map, description='Unknown', quiet=False)[source]¶ Basic map rect class.
-
class
Mind.Orientation.
circle
(centre, radius, Map, description='Unknown', quiet=False)[source]¶ Basic circle class.
-
class
Mind.Orientation.
layer
(name, props, mapping, Map)[source]¶ Basic tilemap layer (Tile Layer) class.*
-
class
Mind.Orientation.
map_obj
(name, Type, props, picture, Map, obj)[source]¶ Blitable tilemap object class.
-
class
Mind.Orientation.
Subject
(name, Type, props, picture, Map, obj)[source]¶ Basic centre tilemap object class (subclass of
map_obj
).
-
class
Mind.Orientation.
objectgroup
(name, props, objects, Map)[source]¶ Basic tilemap objectgroup (Object Layer) class.
-
class
Mind.Orientation.
tiled_map
(name, decode=[{}, {}, {}], else_=[<class 'Mind.Orientation.layer'>, <class 'Mind.Orientation.objectgroup'>, <class 'Mind.Orientation.Object'>], gid_point=True, gid_line=True)[source]¶ Basic class for map in Tiled.
Parameters: - name (str) – file name
- decode (list of dicts) – decoding; first dict is for layers, second for objectgroup and third for object
- else (list) – default decoding; first for layer, second for objectgroup, third for object
- gid_point (bool) – if
True
object’s obj will be point if rect doesn’t have width and height - gid_line (bool) – if
True
object’s obj will be line if rect doesn’t have width or height
-
set_camera_pos
(x, y, pos=(50, 50), edge=True)[source]¶ Sets camera position.
Parameters: - x (int) – x position of point
- y (int) – y position of point
- pos (tuple) – point of screen in percentage
- edge (bool) – if
True
won’t be outside the screen
-
clone_obj
(key, key_type='name')[source]¶ Returns list of all objects with given parameter.
Parameters: - key (str) – parameter of searching object/s
- key_type (str) – name, group or type; what key means.
-
class
Mind.Orientation.
moving_map
(name, x, y, decode=[{}, {}, {}], else_=[<class 'Mind.Orientation.layer'>, <class 'Mind.Orientation.objectgroup'>, <class 'Mind.Orientation.Object'>], gid_point=True, gid_line=True)[source]¶ Subclass of
tiled_map
for easier moving.Parameters: - name (str) – file name
- x (int) – map centre object x
- y (int) – map centre object y
- decode (list of dicts) – decoding; first dict is for layers, second for objectgroup and third for object
- else (list) – default decoding; first for layer, second for objectgroup, third for object
- gid_point (bool) – if
True
object’s obj will be point if rect doesn’t have width and height - gid_line (bool) – if
True
object’s obj will be line if rect doesn’t have width or height
-
set_position
(x, y, pos=(50, 50), edge=True)[source]¶ Sets centre object position
Parameters: - x (int) – x position of centre object
- y (int) – y position of centre object
- pos (tuple) – point of screen in percentage
- edge (bool) – if
True
won’t be outside the screen
-
move
(hor, ver, pos=(50, 50), edge=True)[source]¶ Moves centre object.
Parameters: - hor (int) – horizontal movement (positive for right, negative for left)
- ver (int) – vertical movement (positive for down, negative for up)
- pos (tuple) – point of screen in percentage
- edge (bool) – if
True
won’t be outside the screen