Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/GSOC examples/rotate polygon
diff options
context:
space:
mode:
authorDinko Galetic <dgaletic@everflame.(none)>2010-06-10 09:36:28 (GMT)
committer Dinko Galetic <dgaletic@everflame.(none)>2010-06-10 09:36:28 (GMT)
commit8953dcc49b949e5ae3c79cfd49b9c3ff21e164ca (patch)
tree3dc976bf553807c3cbfdaf896e38808669da12ca /data/GSOC examples/rotate polygon
parent8c7afd466889e93aaef53149a3e20fd390196baf (diff)
Set pygame screen to match gtk.gdk.screen_width/height().
Text boxes are now positioned relative to screen size.
Diffstat (limited to 'data/GSOC examples/rotate polygon')
-rw-r--r--data/GSOC examples/rotate polygon7
1 files changed, 4 insertions, 3 deletions
diff --git a/data/GSOC examples/rotate polygon b/data/GSOC examples/rotate polygon
index fdf1a37..5bd2dcc 100644
--- a/data/GSOC examples/rotate polygon
+++ b/data/GSOC examples/rotate polygon
@@ -16,12 +16,13 @@ from pygame.locals import *
from random import *
from math import cos, sin
from math import pi as Pi
+import gtk
# always need to init first thing
pygame.init()
# XO screen is 1200x900
-size = width, height = 1200, 800
+size = width, height = gtk.gdk.screen_width(), gtk.gdk.screen_height()
# create the window and keep track of the surface
# for drawing into
@@ -152,10 +153,10 @@ while pippy.pygame.next_frame():
msg2 = "Use up and down arrows for controling size. Size : " + str(side_length)
text1 = font.render(msg , True, font_colour)
text_box1 = text1.get_rect()
- text_box1.top = 5
+ text_box1.top = height / 20
text2 = font.render(msg2 , True, font_colour)
text_box2 = text2.get_rect()
- text_box2.top = 20
+ text_box2.top = height / 20 + 14
# if the L or R arrow is pressed (and held), keep adjusting speed
# You'll have to click it real fast if you with to change the speed by