[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx demo/psyko2.py librenderables/renderabl...
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] gzz/gfx demo/psyko2.py librenderables/renderabl... |
Date: |
Tue, 01 Oct 2002 15:12:46 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 02/10/01 15:12:46
Modified files:
gfx/demo : psyko2.py
gfx/librenderables: renderables.py
Log message:
Make HorizText not ignore x, y, and z parameters
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/psyko2.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.91&tr2=1.92&r1=text&r2=text
Patches:
Index: gzz/gfx/demo/psyko2.py
diff -c gzz/gfx/demo/psyko2.py:1.7 gzz/gfx/demo/psyko2.py:1.8
*** gzz/gfx/demo/psyko2.py:1.7 Tue Oct 1 10:08:27 2002
--- gzz/gfx/demo/psyko2.py Tue Oct 1 15:12:44 2002
***************
*** 195,201 ****
vs.map.put(self.pq, cs1, cs2)
if 0:
! cs1 = vs.coords.affineCoordsys(0, 10, 570, 450, 1, 0, 0, 1)
vs.matcher.add(cs1, "msg")
putText(vs, cs1, words[self.seed], color=(0,0,0),w=4,h=4)
--- 195,201 ----
vs.map.put(self.pq, cs1, cs2)
if 0:
! cs1 = vs.coords.affineCoordsys(0, 5, 570, 450, 1, 0, 0, 1)
vs.matcher.add(cs1, "msg")
putText(vs, cs1, words[self.seed], color=(0,0,0),w=4,h=4)
***************
*** 319,325 ****
else:
msg2 = "Ei ollut nähty"
! cs1 = vs.coords.affineCoordsys(0, 10, 350, 350, 1, 0, 0, 1)
vs.matcher.add(cs1, "msg")
putText(vs, cs1, msg, color=(0,0,0),w=1,h=1,x=100)
putText(vs, cs1, msg2, color=(0,0,0),w=1,h=1, y=400)
--- 319,325 ----
else:
msg2 = "Ei ollut nähty"
! cs1 = vs.coords.affineCoordsys(0, 5, 350, 350, 1, 0, 0, 1)
vs.matcher.add(cs1, "msg")
putText(vs, cs1, msg, color=(0,0,0),w=1,h=1,x=100)
putText(vs, cs1, msg2, color=(0,0,0),w=1,h=1, y=400)
***************
*** 346,352 ****
putnoc(vs, background(self.bgcolor))
if self.message != None:
! cs1 = vs.coords.affineCoordsys(0, 10, 300, 450, 1, 0, 0, 1)
vs.matcher.add(cs1, "msg")
putText(vs, cs1, self.message, color=(1,1,1))
--- 346,352 ----
putnoc(vs, background(self.bgcolor))
if self.message != None:
! cs1 = vs.coords.affineCoordsys(0, 5, 300, 450, 1, 0, 0, 1)
vs.matcher.add(cs1, "msg")
putText(vs, cs1, self.message, color=(1,1,1))
***************
*** 415,428 ****
font = None
! def getText(text, x = 0, y = 0, z = 20, w = 1, h = 1):
global font
if font == None:
font = GL.createFont("gfx/fonts/a010013l.pfb", 100)
return GLRen.createHorizText(font, text, x, y, z, w,h)
! def putText(vs, cs1, text, color = None, x = 0, y = 0, z = 20, w = 1, h = 1):
if color != None:
putnoc(vs, getDListNocoords("Color " + js(color)))
putnoc(vs, getDListNocoords("""
--- 415,428 ----
font = None
! def getText(text, x = 0, y = 0, z = 0, w = 1, h = 1):
global font
if font == None:
font = GL.createFont("gfx/fonts/a010013l.pfb", 100)
return GLRen.createHorizText(font, text, x, y, z, w,h)
! def putText(vs, cs1, text, color = None, x = 0, y = 0, z = 0, w = 1, h = 1):
if color != None:
putnoc(vs, getDListNocoords("Color " + js(color)))
putnoc(vs, getDListNocoords("""
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.91
gzz/gfx/librenderables/renderables.py:1.92
*** gzz/gfx/librenderables/renderables.py:1.91 Tue Oct 1 13:05:32 2002
--- gzz/gfx/librenderables/renderables.py Tue Oct 1 15:12:46 2002
***************
*** 833,847 ****
template<class Coords> struct Vertexer {
const Coords &c;
float wmul, hmul;
! Vertexer(Coords &c, float wmul, float hmul) : c(c), wmul(wmul),
hmul(hmul) { }
template<class T> void operator()(const T &x, const T &y) {
! ZPt tmp(x * wmul, y * hmul, 0);
! c.vertex(tmp);
}
};
""",
"RenderCode" : """
! Vertexer<Coords> v(coords1, widthmul, heightmul);
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND);
Text::renderIter(*r, txt.begin(), txt.end(),
--- 833,848 ----
template<class Coords> struct Vertexer {
const Coords &c;
float wmul, hmul;
! ZPt origin;
! Vertexer(Coords &c, float wmul, float hmul, ZPt origin) : c(c),
wmul(wmul), hmul(hmul), origin(origin) { }
template<class T> void operator()(const T &x, const T &y) {
! ZVec tmp(x * wmul, y * hmul, 0);
! c.vertex(origin + tmp);
}
};
""",
"RenderCode" : """
! Vertexer<Coords> v(coords1, widthmul, heightmul, origin);
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND);
Text::renderIter(*r, txt.begin(), txt.end(),
- [Gzz-commits] gzz/gfx demo/psyko2.py librenderables/renderabl...,
Janne V. Kujala <=