Skip to content

Commit 4a6cd3b

Browse files
committed
Large refactoring of package, putting all into __init__.py
1 parent ace2ee2 commit 4a6cd3b

12 files changed

+4143
-17
lines changed

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# general things to ignore
2+
*.sublime-project
3+
*.sublime-workspace
4+
*.wpr
5+
*.wpu
6+
*.pyc
7+
build/
8+
dist/
9+
*.egg-info/
10+
*.egg
11+
*.py[cod]
12+
__pycache__/
13+
*~
14+
pylint.html
15+
.idea/
16+
.vs/
17+
env
18+
venv/
19+
.pytest_cache/
20+
.tox
21+
.cache

LICENSE.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
license
2+
=======
3+
4+
source code
5+
-----------
6+
7+
raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
8+
BSD-like license that allows static linking with closed source software:
9+
10+
Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
11+
12+
This software is provided "as-is", without any express or implied warranty. In no event
13+
will the authors be held liable for any damages arising from the use of this software.
14+
15+
Permission is granted to anyone to use this software for any purpose, including commercial
16+
applications, and to alter it and redistribute it freely, subject to the following restrictions:
17+
18+
1. The origin of this software must not be misrepresented; you must not claim that you
19+
wrote the original software. If you use this software in a product, an acknowledgment
20+
in the product documentation would be appreciated but is not required.
21+
22+
2. Altered source versions must be plainly marked as such, and must not be misrepresented
23+
as being the original software.
24+
25+
3. This notice may not be removed or altered from any source distribution.
26+
27+
fonts
28+
------
29+
30+
The following fonts [provided with raylib](https://github.com/raysan5/raylib/tree/master/examples/text/resources/fonts) are free to use (freeware) and have been designed by the following people:
31+
32+
* Alpha Beta - Brian Kent (AEnigma)
33+
* Setback - Brian Kent (AEnigma)
34+
* Jupiter Crash - Brian Kent (AEnigma)
35+
* Alagard - Hewett Tsoi
36+
* Romulus - Hewett Tsoi
37+
* Mecha - Captain Falcon
38+
* PixelPlay - Aleksander Shevchuk
39+
* PixAntiqua - Gerhard Großmann
40+
41+
2d art
42+
------
43+
44+
[scarfy spritesheet](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/scarfy.png) and [fudesumi image](https://github.com/raysan5/raylib/blob/master/examples/textures/resources/fudesumi.png) have been created by [Eiden Marsal](https://www.artstation.com/artist/marshall_z) and licensed as [Creative Commons Attribution-NonCommercial 3.0](https://creativecommons.org/licenses/by-nc/3.0/legalcode)
45+
46+
3d models
47+
---------
48+
49+
[medieval city 3d models and textures](https://github.com/raysan5/raylib/tree/master/examples/models/resources/medieval) have been created by Alberto Cano and licensed as [Creative Commons Attribution-NonCommercial 4.0](https://creativecommons.org/licenses/by-nc/4.0/legalcode)

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
raylibpy
2+
========
3+
4+
TODO. (sorry...)

examples/core/core_2d_camera.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# core_2d_camera.py
22

3-
from raylibpy.structures import *
4-
from raylibpy.constants import *
5-
from raylibpy.colors import *
6-
from raylibpy.core import *
7-
from raylibpy.text import *
8-
from raylibpy.shapes import *
3+
from raylibpy import *
4+
# from raylibpy.structures import *
5+
# from raylibpy.constants import *
6+
# from raylibpy.colors import *
7+
# from raylibpy.core import *
8+
# from raylibpy.text import *
9+
# from raylibpy.shapes import *
910

1011
MAX_BUILDINGS = 100
1112

@@ -42,12 +43,14 @@ def main():
4243
)
4344
)
4445

45-
camera = Camera2D(
46-
Vector2(0, 0),
47-
Vector2(player.x + 20, player.y + 20),
48-
0.0,
49-
1.0
50-
)
46+
camera = Camera2D()
47+
48+
camera.offset = Vector2(0, 0)
49+
camera.target = Vector2(player.x + 20, player.y + 20)
50+
camera.rotation = 0.0
51+
camera.zoom = 1.0
52+
53+
print(camera.__class__, Camera2D.__class__)
5154

5255
set_target_fps(60)
5356
# ---------------------------------------------------------------

examples/core/core_3d_camera_first_person.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def main():
6464

6565
rl.clear_background(rl.RAYWHITE)
6666

67-
rl.begin_mode3D(camera)
67+
rl.begin_mode3d(camera)
6868

6969
rl.draw_plane(rl.Vector3(0.0, 0.0, 0.0), rl.Vector2(32.0, 32.0), rl.LIGHTGRAY)
7070
rl.draw_cube(rl.Vector3(-16.0, 2.5, 0.0), 1.0, 5.0, 32.0, rl.BLUE)
@@ -79,7 +79,7 @@ def main():
7979
rl.draw_rectangle(int(camera.target.x), int(-500), 1, screen_height * 4, rl.GREEN)
8080
rl.draw_rectangle(int(-500), int(camera.target.y), screen_width * 4, 1, rl.GREEN)
8181

82-
rl.end_mode3D()
82+
rl.end_mode3d()
8383

8484
# rl.draw_text(b"SCREEN AREA", 640, 10, 20, rl.RED)
8585

examples/core/core_3d_camera_free.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ def main():
4747

4848
rl.clear_background(rl.RAYWHITE)
4949

50-
rl.begin_mode3D(camera)
50+
rl.begin_mode3d(camera)
5151

5252
rl.draw_cube(cube_position, 2.0, 2.0, 2.0, rl.RED)
5353
rl.draw_cube_wires(cube_position, 2.0, 2.0, 2.0, rl.MAROON)
5454

5555
rl.draw_grid(10, 1.0)
5656

57-
rl.end_mode3D()
57+
rl.end_mode3d()
5858

5959
rl.draw_rectangle(10, 10, 320, 133, rl.fade(rl.SKYBLUE, 0.5))
6060
rl.draw_rectangle_lines(10, 10, 320, 133, rl.BLUE)

0 commit comments

Comments
 (0)