Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/GSOC examples/Koch snowflake
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/Koch snowflake
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/Koch snowflake')
-rw-r--r--data/GSOC examples/Koch snowflake15
1 files changed, 8 insertions, 7 deletions
diff --git a/data/GSOC examples/Koch snowflake b/data/GSOC examples/Koch snowflake
index 2fb218e..00159bd 100644
--- a/data/GSOC examples/Koch snowflake
+++ b/data/GSOC examples/Koch snowflake
@@ -3,13 +3,14 @@
import pippy, pygame, sys
from pygame.locals import *
from random import *
-import math
-
+import math
+import gtk
+
# always need to init first thing
pygame.init()
# XO screen is 1200x900
-size = width, height = 1200, 900
+size = width, height = gtk.gdk.screen_width(), gtk.gdk.screen_height()
# create the window and keep track of the surface
# for drawing into
@@ -169,8 +170,8 @@ font = pygame.font.Font(None, font_size)
text = font.render(use, True, font_colour)
text_box = text.get_rect()
# Where the box will be placed.
-text_box.top = 100
-text_box.left = 50
+text_box.top = height / 15 + 30
+text_box.left = width / 30
lines = starting_lines
@@ -196,8 +197,8 @@ while pippy.pygame.next_frame():
msg = "Step: " + str(depth) + "/6"
text2 = font.render(msg , True, font_colour)
text_box2 = text2.get_rect()
- text_box2.top = 130
- text_box2.left = 50
+ text_box2.top = height / 15
+ text_box2.left = width / 30
# Write the instructions and the current step on the screen.
screen.blit(text, text_box)
screen.blit(text2, text_box2)