Components

Animation

__init__(name : str, image_name : str, area_list : list, |OPTIONAL| frame_delay : float <0>, delay_list : list <None>, auto_play : bool <False>)
Variables
image_name  : str
area_list   : list
frame_delay : float
delay_list  : list
Methods
run()
pause()
restart()
getFrame() -> float
getState() -> str
getArea() -> tuple

BoxCollider

__init__(width : int, height : int, |OPTIONAL| ghost : bool <False>, is_platform : bool <False>)
Variables
width           : int
height          : int
ghost           : bool
is_platform     : bool
collide_objects : dict
Methods
checkCollision(axis : str)

Camera

__init__(screen_width : int, screen_height : int, |OPTIONAL|, offset_x : int <0>, offset_y : int <0>, max_width : int <0>, max_height : int <0>)
Variables
screen_width  : int
screen_height : int
offset_x      : int
offset_y      : int
max_width     : int
max_height    : int
Methods
apply(rect : pygame.Rect)

Light

__init__(app : godity.core.App, radius : int, |OPTIONAL| color : tuple <(255,255,255)>, image_name : str <None>, follow_camera : bool <True>, smooth_scale : bool <False>)
Variables
radius        : int
color         : tuple
image_name    : str
follow_camera : bool
smooth_scale  : bool
Methods
getDrawImage() -> list [pygame.Surface, pygame.Rect]

Rigidbody

__init__(app, |OPTIONAL| velocity : float <2>, mass : float <3>, use_gravity : bool <True>, drop_platform_key : int <pygame.K_DOWN>)
Variables
air_time          : float
velocity          : float
mass              : float
use_gravity       : bool
drop_platform_key : int
direction         : godity.math.Vector2
gravity           : float <0>
on_ground         : bool
is_jumping        : bool
platform_drop     : bool
Methods
move()
jump(force : float)

SpriteRenderer

__init__(app : godity.core.App, image_name : str, |OPTIONAL| area : tuple <None>, tile_width : int <0>, tile_height : int <0>, offset_x : int <0>, offset_y : int <0>, flip_x : bool <False>, flip_y : bool <False>, smooth_scale : bool <False>, follow_camera : bool <True>)
Variables
image_name    : str
area          : tuple
tile_width    : int
tile_height   : int
offset_x      : int
offset_y      : int
flip_x        : bool
flip_y        : bool
smooth_scale  : bool
follow_camera : bool
rect          : pygame.Rect
Methods
updateRect()
setArea(area : tuple)
setFlip(x : bool, y : bool)
setImage(image_path : str, |OPTIONAL| convert_alpha : False)
getDrawImage() -> list [pygame.Surface, pygame.Rect]

Tilemap

__init__(file_path : str, |OPTIONAL| object_offset_x : int <0>, object_offset_y : int <0>)
Variables
tmx_data        : pytmx.pytmx.TiledMap
width           : int
height          : int
object_offset_x : int
object_offset_y : int
image           : pygame.Surface
Methods
getDrawImage() -> list [pygame.Surface, pygame.Rect]

Transform

__init__(|OPTIONAL| position : godity.math.Vector2 <None>, scale : godity.math.Vector2 <None>, rotation : int <0>)
Variables
position : godity.math.Vector2
scale    : godity.math.Vector2
rotation : int
Methods
move(vector2 : godity.math.Vector2)
rotate(angle : int)
setRotation(vector2 : godity.math.Vector2)
setPosition(vector2 : godity.math.Vector2)
setPositionX(value : float)
setPositionY(value : float)
setScale(vector2 : godity.math.Vector2)
setScaleX(value : float)
setScaleY(value : float)
updateChildrenPosition()