@@ -31,14 +31,14 @@ msvc15 and linux amd64).
31
31
32
32
raylibpy will look for the respective binary in 3 locations:
33
33
* In the ` RAYLIB_BIN_PATH ` environment variable;
34
- * in the directory where the ` __main__ ` module is located, and
34
+ * in the directory where the ` " __main__" ` module is located, and
35
35
* in the raylibpy package directory.
36
36
37
- ` RAYLIB_LIB_PATH ` accepts as value: ` __main__ ` , as the entry point module directory;
38
- ` __file__ ` as the package directory or another specific directory.
37
+ ` RAYLIB_LIB_PATH ` accepts as value: ` " __main__" ` , as the entry point module directory;
38
+ ` " __file__" ` as the package directory or another specific directory.
39
39
40
40
if ` RAYLIB_BIN_PATH ` is not set, it will look in the package directory first,
41
- then in the ` __main__ ` module location. Note though that ` __main__ ` refers the module selected to
41
+ then in the ` __main__ ` module location. Note though that ` " __main__" ` refers the module selected to
42
42
start the Python interpreter, not the ` __main__.py ` file, although it might be the case.
43
43
44
44
The binaries made available by raylib are all OpenGL 3.3. For OpenGL 1.1 or 2.1,
@@ -91,10 +91,10 @@ number of components:
91
91
``` python
92
92
vec_a = Vector3(3 ., 5 ., 7 .)
93
93
vec_b = Vector3(4 ., 2 ., 0 .)
94
- vec_a * vec_b # outputs (12.0, 10.0, 0.0)
95
- vec_a + (8 , 100 , - 1 ) # outputs (11.0, 105.0, 6.0)
96
- vec_a %= 2 # augmented assignment (modulo)
97
- vec_a # outputs (1.0, 1.0, 0.0)
94
+ vec_a * vec_b # outputs (12.0, 10.0, 0.0)
95
+ vec_a + (8 , 100 , - 1 ) # outputs (11.0, 105.0, 6.0)
96
+ vec_a %= 2 # augmented assignment (modulo)
97
+ vec_a # outputs (1.0, 1.0, 0.0)
98
98
```
99
99
100
100
Vectors also support GLSL vector swizzling. Also, ` x ` , ` y ` , ` z ` and ` w ` coordinates maps to
@@ -104,21 +104,21 @@ texture coordinates (`u` and `v`):
104
104
``` python
105
105
# Reading (__getattr__)
106
106
vec3 = Vector3(123.0 , 467.0 , 789.0 )
107
- vec2 = vec3.uv # x and y respectively as u and v
108
- vec3 = vec3.bgr # x, y and z respectively as r, g and b ( rgb is not available in Vector 2)
107
+ vec2 = vec3.uv # x and y respectively as u and v
108
+ vec3 = vec3.bgr # x, y and z respectively as r, g and b ( rgb is not available in Vector 2)
109
109
vec4 = vec2.rrrg # for attribute reading, is ok to repeat components
110
110
111
111
112
112
# Writing (__setattr__)
113
113
vec3 = Vector3(123.0 , 467.0 , 789.0 )
114
- vec4.yxwz = 10 , 0 , - 1 , vec3.z # sequences of ints and/or floats are accepted as value
114
+ vec4.yxwz = 10 , 0 , - 1 , vec3.z # sequences of ints and/or floats are accepted as value
115
115
vec2.vu = vec3.xy # x and y respectively as u and v
116
- vec3.bgr = 12 , vec4.x # x, y and z respectively as r, g and b ( rgb is not available in Vector 2)
116
+ vec3.bgr = 12 , vec4.x # x, y and z respectively as r, g and b ( rgb is not available in Vector 2)
117
117
118
118
# the following raises an exception:
119
- vec3.rrr = vec4.yxw # for attribute writing, is _not_ ok to repeat components
120
- vec2.br = vec4.uv # r, g and b is not available in Vector2
121
- vec4.brxy = (0 ., 0 ., vec2.x, vec3.z) # can't mix component name groups (rgba, xywz and uv)
119
+ vec3.rrr = vec4.yxw # for attribute writing, is _not_ ok to repeat components
120
+ vec2.br = vec4.uv # r, g and b is not available in Vector2
121
+ vec4.brxy = (0 ., 0 ., vec2.x, vec3.z) # can't mix component name groups (rgba, xywz and uv)
122
122
```
123
123
124
124
Constructors and swizzled attributes now accept any combination of numbers,
@@ -127,11 +127,11 @@ vectors and sequences, as long as the total number of arguments are preserved:
127
127
# all these results in the same Vector4
128
128
a = Vector4(3 , 4 , 5 , 6 )
129
129
b = Vector4(a.xy, 5 , 6 )
130
- c = Vector4(b.x, b.yz, b.w )
131
- d = Vector4(c.x , c.y, c.zw)
132
- e = Vector4(d.xy, d.zw )
130
+ c = Vector4(b.x, b.yz, 6 )
131
+ d = Vector4(3 , c.y, c.zw)
132
+ e = Vector4(d.xy, ( 5 , 6 ) )
133
133
f = Vector4(e.xyz, 6 )
134
- g = Vector4(f.x , f.yzw)
134
+ g = Vector4(3 , f.yzw)
135
135
h = Vector4(g)
136
136
```
137
137
0 commit comments