This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import glob | |
import os | |
import time | |
import sys | |
from gooey import Gooey, GooeyParser | |
from PIL import Image | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This is an example of a `discord.ext.commands.Bot` subclass that allows you to pass | |
an `options=` keyword argument to `load_extension`. The argument can optionally receive | |
a dictionary that is passed to the `setup()` function of an extension. This works by | |
checking if an extension also implements an `options=` keyword argument and passing the dictionary | |
to it. Receiving this dictionary is opt-in, if `options=` is not implemented for the `setup()` function | |
of an extension, the resulting behavior will be as if `options=` were never passed to `load_extension`, thereby | |
making it backwards-compatible with any older extensions. | |
Tested with discord.py 2.0.0 alpha. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
from pygame import Surface, Rect | |
pygame.init() | |
listtypes = set((list, tuple)) | |
pygame_classes = set((Surface, Rect)) | |
_text0 = "invalid Spritesheet coordinate: " | |
_text1 = ". Coordinates must be like this: (x, y, width, height)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Two user-friendly classes for integrating a 2D camera system for pygame. | |
# | |
# The first class is Camera2, which is essentially a 2D camera with rect-like behaviour. To setup something like player tracking, one can simply do: | |
### Cam2 = Camera2(area=(0, 0, WIDTH, HEIGHT), view_distance=1000) | |
### Cam2.center = player.rect.center | |
# for even more precise control, one can do: | |
### Cam2.anchor = (Cam2.w*0.3, Cam2.h*0.7) # some coordinate on the screen |