1 from __future__
import division
2 from actor
import actor
3 from pyglet
.gl
.gl
import *
13 def __init__ (self
, owner
, user
):
14 actor
.__init
__ (self
, owner
)
18 self
.tex
= owner
.res
.image ('ball.png')
19 self
.oval
.size
.x
= self
.tex
.width
/ 2
20 self
.oval
.size
.y
= self
.tex
.height
/ 2
25 glTranslated (self
.oval
.pos
.x
, self
.oval
.pos
.y
, 0)
27 glBindTexture (GL_TEXTURE_2D
, self
.tex
.id)
28 glBegin (GL_TRIANGLE_STRIP
)
29 glColor4d (1, 1, 1, 1)
31 glTexCoord2d (self
.tex
.tex_coords
[0],
32 self
.tex
.tex_coords
[1])
33 glVertex2d (-self
.oval
.size
.x
,
36 glTexCoord2d (self
.tex
.tex_coords
[3],
37 self
.tex
.tex_coords
[4])
38 glVertex2d ( self
.oval
.size
.x
,
41 glTexCoord2d (self
.tex
.tex_coords
[9],
42 self
.tex
.tex_coords
[10])
43 glVertex2d (-self
.oval
.size
.x
,
46 glTexCoord2d (self
.tex
.tex_coords
[6],
47 self
.tex
.tex_coords
[7])
48 glVertex2d ( self
.oval
.size
.x
,