@@ -223,13 +223,11 @@ def set_screen_size(self, w: int, h: int) -> None:
223223 """
224224 ShaderLib .use (DefaultShader .TEXT )
225225 ShaderLib .set_uniform ("textureID" , 0 )
226- ShaderLib .set_uniform ("screenSize" , w , h )
226+ ShaderLib .set_uniform ("screenSize" , float ( w ), float ( h ) )
227227 ShaderLib .set_uniform ("fontSize" , 1.0 )
228- ShaderLib .set_uniform ("textColor " , 1.0 , 1.0 , 1.0 , 1.0 )
228+ ShaderLib .set_uniform ("textColour " , 1.0 , 1.0 , 1.0 , 1.0 )
229229
230- def render_text (
231- self , font : str , x : int , y : int , text : str , colour : Vec3 = Vec3 (1 , 1 , 1 )
232- ) -> None :
230+ def render_text (self , font : str , x : int , y : int , text : str , colour : Vec3 = Vec3 (1.0 , 1.0 , 1.0 )) -> None :
233231 """
234232 Renders a string of text to the screen.
235233
@@ -276,7 +274,7 @@ def render_text(
276274 gl .glActiveTexture (gl .GL_TEXTURE0 )
277275 gl .glBindTexture (gl .GL_TEXTURE_2D , atlas .texture )
278276 ShaderLib .use (DefaultShader .TEXT )
279- ShaderLib .set_uniform ("textColor " , colour .x , colour .y , colour .z , 1.0 )
277+ ShaderLib .set_uniform ("textColour " , float ( colour .x ), float ( colour .y ), float ( colour .z ) , 1.0 )
280278 # We are drawing one point per character
281279 vao .set_num_indices (len (render_data ) // 8 )
282280 vao .draw ()
@@ -288,9 +286,7 @@ def render_text(
288286 if polygon_mode != gl .GL_FILL :
289287 gl .glPolygonMode (gl .GL_FRONT_AND_BACK , polygon_mode )
290288
291- def _build_instances (
292- self , font : str , text : str , start_x : int , start_y : int
293- ) -> List [float ]:
289+ def _build_instances (self , font : str , text : str , start_x : int , start_y : int ) -> List [float ]:
294290 """
295291 Generates vertex attribute data for each character in a string.
296292
0 commit comments