Mandaw

mandaw.main
title = "Mandaw"
width = 800
height = 600
bg_color = "black"

# Background sprite
background = type: FileType

fps = 60
keys = []
input = Input()

run(self)



Mandaw(title, width, height, bg_color)

GameObject

mandaw.gameobject
window = type: Mandaw
shape = "rect"
size = (20, 20)
x = 0
y = 0
color = "white"

draw(self)
center(self)
center_x(self)
center_y(self)

# Can be a GameObject or a List of GameObjects
collide(self, rect)



GameObject(window, shape, size, x, y, color)

Input

mandaw.input

Input

pressed = pygame.key.get_pressed()
mouse = pygame.mouse.get_pressed()

update(self)

get_key_pressed(self, key)
get_mouse_button(self, button)



Input()

Sprite

mandaw.sprite
window = type: Mandaw
image = type: FileType
x = 0
y = 0
size = (200, 200)
animations = {}
rect = pygame.Rect(x, y, size[0], size[1])

draw(self)
get_width(self)
get_height(self)
center(self)
center_x(self)
center_y(self)
collide(self, rect)
resize(self, size)
add_animation(self, animation, name)
play_animation(self, name, mirror = None)



Sprite(window, image, x, y, size)

Animation

mandaw.animation
anim_folder = type: FileType
anim_time = type: Int
frames = []
count = len(frames)



Animation(anim_folder, anim_time)

Color

mandaw.color
color = type: String



Color(color)

Text

mandaw.text
window = type: Mandaw
text = type: String
font_size = 24
style = type: String
color = "white"
x = 0
y = 0
font = pygame.font.SysFont(style, font_size)
text = font.render(text, True, color)

draw(self)
center(self)



Text(window, text, font_size, style, color x, y)

Audio

mandaw.audio
file = type: String
volume = type: Int

play(self)
pause(self)
resume(self)
stop(self)



Audio(file, volume)

Line

mandaw.line
window = type: Mandaw
color = type: String
start_pos = type: Int
end_pos = type: Int



Line(window, color, start_pos, end_pos)

Light

mandaw.light
window = type: Mandaw
mask_img = type: FileType

light_init(self, pos)
draw(self)



Light(window, mask_img)
.