Metadata-Version: 2.4
Name: skyport_engine
Version: 0.2.1
Author: Matthew R
Author-email: matthew.le.robins@gmail.com
Description-Content-Type: text/markdown
Requires-Dist: pygame-ce>=2.5.5
Requires-Dist: numpy>=2.3.2
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist


made by : Matthew R and William L

////////////////////////////
-----welcome to skyport-----
////////////////////////////
v0.2.1(unstable)

    the purpos of skyport is to:
is to be a game engine that automaticly takes care of rendering loop , file pre loading and having a few usful utilaty tools


# boilerplate code :
```python
import skyport as sp

dm = sp.Display_Manager(
    window_size=(1920,1080),
    display_size=(960,540),
    window_name="skyport test"
    )

dm.START_RENDERING_THREAD(fps=60)
while dm.running:

    dm.event_handler()


```
# Display_Manager :
the display manager is made to automaticly handle the window on a separete thread so that the rendering loop can be separet from the game loop

# Loader :
the loader is made to pre cache files in memory 

    # how to make a Loader map :
        ```json
        {
            "path":{"value":null,"type":null},
            ...
        }
        ```
        in the Loader_map format there are a couple of types and each do difrent things.
        TYPES:
         - "r" / "replace" : this type will read the file from where "value" sais to rather than the og path. example : ```json "path/jeff.png":{"value":"replacement_path.jpg,"type":"r"} ```
         - "list" : this mode allows you to load an entire file under 1 name by havig "path" as the folder dir and then in "value" you would place a list of files you would like to load. example : ```json "path/dave":{"value":["bob.png","sam/frend.json"...],"type":"list"} ``` how you would acses this is : loader_instance.read(path)[index]
         - "dict" : this type allows you to load an entire folder under one name slightly dif. the "path" would be the folder dir just like in "list" but this time "value" is filled with a dict of {"name":"file"} instead of a list. example ```json "assets/rand":{"value":{"dave":"dave.png","bob":"idk/jeff.csv"},"type":"dict} ``` and how you would acses it is by : loader_instance.read(path)[name]
         - null : this is the defalt and it dose not matter what the "type" is. this mode will load the "path" to the Loader map and how you would acses the file would be : loader_instance.read(path)

        FULL FILE EXAMPLE:
        ```json
        {
            "assets/jeff.png":{
                "value":null,
                "type":null
            },
            "assets/rand/":{
                "value":[
                    "ball.json",
                    "ball.png"
                ],
            "type":"list"
            },
            "assets/icons": {
                "type": "dict",
                "value": {
                    "button1": "button_play.png",
                    "coin": "coin.png",
                    "button2": "button2.png"
                }
            },
            "assets/files/data.png":{
                "value":"texture_pack/file/data.png",
                "type":"replace"
            }
        }
        ```
    # how to use Loader in code :
        the Loader is simple, you first create an instance and pass in __file__ so that the Loader can resolve realative paths then you can pre load the Loader with a Loader map (this is optional) then you can use the Loader to read files whether they have been pre caches or not. example code :
        ```python
        import skyport as sp

        # you need to pass in __file__ so the Loader knows where to do realative paths
        loader = sp.Loader(__file__)
        # (optional) you can pre load all the files you want into the Loader so you dont have to get them later
        loader.load_from_map("loader_map_test1.json")

        # to read the content of the file whether the Loader has pre loaded it or not you can call read()
        file_data = loader.read(path="my_path/image.png",add_to_map=True)
        # this method allows you to create more conviniant names for your pre loaded files
        loader.create_alias("my_path/image.png","image")
        # this returns the dict of supported types and there file handlers
        loader.get_supported_types()
        # you can add your own file types for the loader to support if the loader dose not already suport them 
        loader.add_new_file_handler(".idk",lambda path : open(path,"r"))
        # this is for when u have 1 loaders or 2 name:file maps
        loader.join_maps(map_a=,map_b=)
        # this is for turning any path into an abs path
        loader.resolve_path(path)
        # this is for saving files that are in the Loader
        loader.save(path,map_key) 
        # this is for saving the curent in memory file map
        loader.save_map(path,map)
        # this is for getting the Loader map
        loader.get_map()
        # this is for setting the Loader map
        loader.set_map(map)
        ```
        there are more methods in the loader but they are not mentiond heare

# Util : 
this is a utilaty class that holds random and potentialy usefull methods sutch as 
 - get_angle_and_dist(self,x1:"int",y1:"int",x:"int",y:"int")
 - pryoraty(self,a=None,b=None) : this function will return a if there is an a 
 - snap_cords_in_bounds(self,x:"int",y:"int",max_x:"int",max_y:"int",min_x:"int"=0,min_y:"int"=0) : this snaps cords in side of a rect arya 
 - couculate_dx_dy(self,dist:"int",angle:"float")
 - couculate_angle_dist(self,dx:"int",dy:"int")
 - play_sound(self,soud_obj:"pygame.mixer.Sound", volume=0.5,loops=0)
 - play_sound_from_point(self,pf,sound_pos:list,listener_pos:list,volume:float=0.5,loops=0,distance_fade=0.5)
 - warp_image(self,image:"pygame.Surface",sizex:"int",sizey:"int",angle:"float")
 - rotate_image(self,image:"pygame.Surface",angle:"float")
 - scale_image(self,image:"pygame.Surface",sizex:"int",sizey:"int")
 - color_swap(self,surface: 'pygame.Surface', old_color: tuple, new_color: tuple) -> 'pygame.Surface'
how do use the Util class : 
```python
import skyport as sp

util = sp.Util()

a = util.pryoraty(None,2) # a will be 2

print(a)
```
# Delta_timer : 
    this is for getting the delta time between the curent call of get_dt() and the last one (there is one method -> get_dt())

# Camra :
the Camra is a spesial chunk baced map renderer that can efficiently render large 2d maps (more documentation will come later)

# Chunk :
this class us used by the Camra class to render large 2d maps (more documentation will come later)



dev_info:
    email:matthew.le.robins+proj@gmail.com
    (plz only email if u have found a bug and a good way to fix it and plz ensure i have a way to contact you about you suggested changes or requests)

