code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
#!/usr/bin/env python '''Test that the code snippets mentioned in issue 471 (and related issues 241 and 429) don't have exceptions. (Most of them delete all text in a formatted document with some styles set; one of them (like the test in EMPTY_BOLD.py) sets style on a 0-length range of text in an empty document.) '''...
[ [ 8, 0, 0.0968, 0.1129, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1774, 0.0161, 0, 0.66, 0.1667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2097, 0.0161, 0, 0.66...
[ "'''Test that the code snippets mentioned in issue 471\n(and related issues 241 and 429) don't have exceptions.\n\n(Most of them delete all text in a formatted document\nwith some styles set; one of them (like the test in EMPTY_BOLD.py)\nsets style on a 0-length range of text in an empty document.)\n'''", "__docf...
#!/usr/bin/env python '''Test an unformatted document is editable. Examine and type over the text in the window that appears. The window contents can be scrolled with the mouse wheel. Press ESC to exit the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: STYLE.py 1754 2008-02-10 13:26:52Z Alex.Holk...
[ [ 8, 0, 0.0714, 0.0833, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.131, 0.0119, 0, 0.66, 0.0667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1429, 0.0119, 0, 0.66,...
[ "'''Test an unformatted document is editable.\n\nExamine and type over the text in the window that appears. The window\ncontents can be scrolled with the mouse wheel.\n\nPress ESC to exit the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: STYLE.py 1754 2008-02-10 13:26:52Z Alex.Holkner...
#!/usr/bin/env python '''Test that inline elements are positioned correctly and are repositioned within an incremental layout. Examine and type over the text in the window that appears. There are several elements drawn with grey boxes. These should maintain their sizes and relative document positions as the text is...
[ [ 8, 0, 0.047, 0.0604, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0872, 0.0067, 0, 0.66, 0.1, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.094, 0.0067, 0, 0.66, ...
[ "'''Test that inline elements are positioned correctly and are repositioned\nwithin an incremental layout.\n\nExamine and type over the text in the window that appears. There are several\nelements drawn with grey boxes. These should maintain their sizes and\nrelative document positions as the text is scrolled and...
#!/usr/bin/env python '''Test content_valign = 'center' property of IncrementalTextLayout. Examine and type over the text in the window that appears. The window contents can be scrolled with the mouse wheel. When the content height is less than the window height, the content should be aligned to the center of the w...
[ [ 8, 0, 0.0805, 0.1034, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1494, 0.0115, 0, 0.66, 0.0667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1609, 0.0115, 0, 0.66...
[ "'''Test content_valign = 'center' property of IncrementalTextLayout.\n\nExamine and type over the text in the window that appears. The window\ncontents can be scrolled with the mouse wheel. When the content height\nis less than the window height, the content should be aligned to the center\nof the window.\n\nPre...
#!/usr/bin/env python '''Test content_valign = 'bottom' property of IncrementalTextLayout. Examine and type over the text in the window that appears. The window contents can be scrolled with the mouse wheel. When the content height is less than the window height, the content should be aligned to the bottom of the w...
[ [ 8, 0, 0.0805, 0.1034, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1494, 0.0115, 0, 0.66, 0.0667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1609, 0.0115, 0, 0.66...
[ "'''Test content_valign = 'bottom' property of IncrementalTextLayout.\n\nExamine and type over the text in the window that appears. The window\ncontents can be scrolled with the mouse wheel. When the content height\nis less than the window height, the content should be aligned to the bottom\nof the window.\n\nPre...
#!/usr/bin/env python '''Test that a scheduled function gets called every interval with the correct time delta. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $' import time import unittest from pyglet import clock __noninteractive = True class SCHEDULE_IN...
[ [ 8, 0, 0.0741, 0.0556, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1296, 0.0185, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1481, 0.0185, 0, 0.66,...
[ "'''Test that a scheduled function gets called every interval with the correct\ntime delta.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'", "import time", "import unittest", "from pyglet import clock", "__noninteractive = True", "cla...
#!/usr/bin/env python '''Test that the clock effectively limits the FPS to 20 Hz when requested. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import time import unittest from pyglet import clock __noninteractive = True class FPS_LIMIT(unittest.TestCase): def test_fps_limit(self): clock....
[ [ 8, 0, 0.1167, 0.0667, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2, 0.0333, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2333, 0.0333, 0, 0.66, ...
[ "'''Test that the clock effectively limits the FPS to 20 Hz when requested.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import time", "import unittest", "from pyglet import clock", "__noninteractive = True", "class FPS_LIMIT(unittest.TestCase):\n def test_fps_limit(self):\...
#!/usr/bin/env python '''Test that a scheduled function gets called every tick with the correct time delta. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $' import time import unittest from pyglet import clock __noninteractive = True class SCHEDULE(unitte...
[ [ 8, 0, 0.05, 0.0375, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0875, 0.0125, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1, 0.0125, 0, 0.66, ...
[ "'''Test that a scheduled function gets called every tick with the correct\ntime delta.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'", "import time", "import unittest", "from pyglet import clock", "__noninteractive = True", "class S...
#!/usr/bin/env python # Contributed by Claudio Canepa # Integrated by Ben Smith """ There is the possibility that time.clock be non monotonic in multicore hardware, due to the underlaying use of win32 QueryPerformanceCounter. If your update is seeing a negative dt, then time.clock is probably the culprit. AM...
[ [ 8, 0, 0.2143, 0.1143, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3143, 0.0286, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3429, 0.0286, 0, 0.66...
[ "\"\"\" There is the possibility that time.clock be non monotonic in multicore hardware, \ndue to the underlaying use of win32 QueryPerformanceCounter.\nIf your update is seeing a negative dt, then time.clock is probably the culprit.\nAMD or Intel Patches for multicore may fix this problem (if you see it at all)\"\...
#!/usr/bin/env python '''Test that the clock returns a reasonable average FPS calculation when stimulated at 5 Hz. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import time import unittest from pyglet import clock __noninteractive = True class FPS(unittest.TestCase): def test_fps(self): ...
[ [ 8, 0, 0.1429, 0.1071, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.25, 0.0357, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2857, 0.0357, 0, 0.66, ...
[ "'''Test that the clock returns a reasonable average FPS calculation when\nstimulated at 5 Hz.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import time", "import unittest", "from pyglet import clock", "__noninteractive = True", "class FPS(unittest.TestCase):\n def test_fps(...
#!/usr/bin/env python '''Test that the clock tick function returns the elaspsed time between frames, in seconds. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import time import unittest from pyglet import clock __noninteractive = True class TICK(unittest.TestCase): def test_tick(self): ...
[ [ 8, 0, 0.1333, 0.1, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2333, 0.0333, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2667, 0.0333, 0, 0.66, ...
[ "'''Test that the clock tick function returns the elaspsed time between\nframes, in seconds.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import time", "import unittest", "from pyglet import clock", "__noninteractive = True", "class TICK(unittest.TestCase):\n def test_tick(...
#!/usr/bin/env python '''Test that a scheduled function gets called every once with the correct time delta. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $' import time import unittest from pyglet import clock __noninteractive = True class SCHEDULE_ONCE(u...
[ [ 8, 0, 0.0741, 0.0556, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1296, 0.0185, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1481, 0.0185, 0, 0.66,...
[ "'''Test that a scheduled function gets called every once with the correct\ntime delta.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: TICK.py 310 2006-12-23 15:56:35Z Alex.Holkner $'", "import time", "import unittest", "from pyglet import clock", "__noninteractive = True", "class S...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import pyglet from graphics_common import * __noninteractive = True class TEST_CASE(unittest.TestCase): def check(self, expected, result, dimensions): if len(expected) != len(result) * dimensions /...
[ [ 8, 0, 0.0443, 0.0253, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0759, 0.0127, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0886, 0.0127, 0, 0.66,...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "import pyglet", "from graphics_common import *", "__noninteractive = True", "class TEST_CASE(unittest.TestCase):\n def check(self, expected, result, dimensions):\n if len(expected) != len(result) ...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import pyglet from graphics_common import * __noninteractive = True class TEST_CASE(unittest.TestCase): def check(self, expected, result, dimensions): if len(expected) != len(result) * dimensions /...
[ [ 8, 0, 0.0449, 0.0256, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0769, 0.0128, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0897, 0.0128, 0, 0.66,...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "import unittest", "import pyglet", "from graphics_common import *", "__noninteractive = True", "class TEST_CASE(unittest.TestCase):\n def check(self, expected, result, dimensions):\n if len(expected) != len(result) ...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' from operator import add import random from pyglet.gl import * n_vertices = 42 v3f_data = [v/float(n_vertices*3 + 10) for v in range(n_vertices * 3)] v2f_data = reduce(add, zip(v3f_data[::3], v3f_data[1::3])) c4f_data = [v/floa...
[ [ 8, 0, 0.0538, 0.0308, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0923, 0.0154, 0, 0.66, 0.0435, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1077, 0.0154, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: $'", "from operator import add", "import random", "from pyglet.gl import *", "n_vertices = 42", "v3f_data = [v/float(n_vertices*3 + 10) for v in range(n_vertices * 3)]", "v2f_data = reduce(add, zip(v3f_data[::3], v3f_data[1::3]))...
#!/usr/bin/python # $Id:$ import unittest import pyglet from graphics_common import * __noninteractive = True class TEST_CASE(unittest.TestCase): def check(self, expected, result, dimensions): if len(expected) != len(result) * dimensions / 4: self.fail('Incorrect number of vertices in feedb...
[ [ 1, 0, 0.0548, 0.0137, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.0822, 0.0137, 0, 0.66, 0.2, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.1096, 0.0137, 0, 0.66,...
[ "import unittest", "import pyglet", "from graphics_common import *", "__noninteractive = True", "class TEST_CASE(unittest.TestCase):\n def check(self, expected, result, dimensions):\n if len(expected) != len(result) * dimensions / 4:\n self.fail('Incorrect number of vertices in feedback...
#!/usr/bin/python # $Id:$ import unittest import pyglet from graphics_common import * __noninteractive = True class TEST_CASE(unittest.TestCase): def check(self, expected, result, dimensions): if len(expected) != len(result) * dimensions / 4: self.fail('Incorrect number of vertices in feedb...
[ [ 1, 0, 0.0556, 0.0139, 0, 0.66, 0, 88, 0, 1, 0, 0, 88, 0, 0 ], [ 1, 0, 0.0833, 0.0139, 0, 0.66, 0.2, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.1111, 0.0139, 0, 0.66,...
[ "import unittest", "import pyglet", "from graphics_common import *", "__noninteractive = True", "class TEST_CASE(unittest.TestCase):\n def check(self, expected, result, dimensions):\n if len(expected) != len(result) * dimensions / 4:\n self.fail('Incorrect number of vertices in feedback...
#!/usr/bin/env python '''Draws a full-window quad with two texture units enabled and multi texcoords. Texture unit 0 is a checker pattern of yellow and cyan with env mode replace. Texture unit 1 is a checker pattern of cyan and yellow, with env mode modulate. The result should be flat green (with some variation in ...
[ [ 8, 0, 0.0987, 0.1316, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1842, 0.0132, 0, 0.66, 0.1667, 352, 1, 0, 0, 0, 0, 4, 0 ], [ 1, 0, 0.2105, 0.0132, 0, 0.66,...
[ "'''Draws a full-window quad with two texture units enabled and multi\ntexcoords. Texture unit 0 is a checker pattern of yellow and cyan with\nenv mode replace. Texture unit 1 is a checker pattern of cyan and yellow,\nwith env mode modulate. The result should be flat green (with some variation\nin the center cro...
#!/usr/bin/python # $Id:$ '''OpenGL viewports and projections. This is a simplified interface for setting up projections, and viewports within projections. A `Viewport` is a rectangular area in space that can be rendered into. Most viewports, with the exception of the top-level viewport, belong to an owning project...
[ [ 8, 0, 0.1975, 0.3503, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3822, 0.0064, 0, 0.66, 0.1429, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 3, 0, 0.3981, 0.0127, 0, 0.66...
[ "'''OpenGL viewports and projections.\n\nThis is a simplified interface for setting up projections, and viewports\nwithin projections.\n\nA `Viewport` is a rectangular area in space that can be rendered into. Most\nviewports, with the exception of the top-level viewport, belong to an owning\nprojection. A `Project...
#!/usr/bin/python # $Id:$ from pyglet.gl import * def fillrect(x, y, width, height): glBegin(GL_QUADS) glVertex2f(x, y) glVertex2f(x + width, y) glVertex2f(x + width, y + height) glVertex2f(x, y + height) glEnd() def rect(x, y, width, height): glBegin(GL_LINE_LOOP) glVertex2f(x, y) ...
[ [ 1, 0, 0.2, 0.05, 0, 0.66, 0, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 2, 0, 0.45, 0.35, 0, 0.66, 0.5, 160, 0, 4, 0, 0, 0, 0, 6 ], [ 8, 1, 0.35, 0.05, 1, 0.07, 0, 2...
[ "from pyglet.gl import *", "def fillrect(x, y, width, height):\n glBegin(GL_QUADS)\n glVertex2f(x, y)\n glVertex2f(x + width, y)\n glVertex2f(x + width, y + height)\n glVertex2f(x, y + height)\n glEnd()", " glBegin(GL_QUADS)", " glVertex2f(x, y)", " glVertex2f(x + width, y)", " ...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $' import unittest from pyglet.gl import * from pyglet.ext import projection from pyglet import window import base_projection class VIEWPORT_CLIP(unittest.TestCase): def tes...
[ [ 8, 0, 0.0463, 0.037, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0926, 0.0185, 0, 0.66, 0.1111, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1111, 0.0185, 0, 0.66,...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $'", "import unittest", "from pyglet.gl import *", "from pyglet.ext import projection", "from pyglet import window", "import base_projection", "class VIEWPORT_CLIP(unittest.Tes...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $' import unittest from pyglet.gl import * from pyglet.ext import projection from pyglet import window import base_projection class VIEWPORT_ORTHO(unittest.TestCase): def te...
[ [ 8, 0, 0.0481, 0.0385, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0962, 0.0192, 0, 0.66, 0.1111, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1154, 0.0192, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: WINDOW_OPEN.py 750 2007-03-17 01:16:12Z Alex.Holkner $'", "import unittest", "from pyglet.gl import *", "from pyglet.ext import projection", "from pyglet import window", "import base_projection", "class VIEWPORT_ORTHO(unittest.Te...
#!/usr/bin/env python ''' Model code for managing sprites =============================== ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.gl import * from scene2d.drawable import * class SpriteLayer(object): '''Represents a group of sprites at the same z depth. ''' def __init__...
[ [ 8, 0, 0.0165, 0.0165, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0297, 0.0033, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.033, 0.0033, 0, 0.66, ...
[ "'''\nModel code for managing sprites\n===============================\n\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "from pyglet.gl import *", "from scene2d.drawable import *", "class SpriteLayer(object):\n '''Represents a group of sprites at the same z depth.\n '''\n de...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from ctypes import * from pyglet.gl import * from scene2d.sprite import Sprite from pyglet.font import GlyphString # TODO: inherit from Sprite class TextSprite(object): _layout_width = None # Width to layout text to _tex...
[ [ 8, 0, 0.0243, 0.0139, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0417, 0.0069, 0, 0.66, 0.1429, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0486, 0.0069, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "from ctypes import *", "from pyglet.gl import *", "from scene2d.sprite import Sprite", "from pyglet.font import GlyphString", "class TextSprite(object):\n _layout_width = None # Width to layout text to\n _text_width = 0 ...
#!/usr/bin/env python ''' Simple images etc. to aid debugging =================================== ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import math from scene2d import * from pyglet import image from scene2d.drawable import * from pyglet.gl import * def brensenham_line(x, y, x2, y2): '''...
[ [ 8, 0, 0.045, 0.045, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0811, 0.009, 0, 0.66, 0.0833, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0901, 0.009, 0, 0.66, ...
[ "'''\nSimple images etc. to aid debugging\n===================================\n\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import math", "from scene2d import *", "from pyglet import image", "from scene2d.drawable import *", "from pyglet.gl import *", "def brensenham_line(...
from pyglet.gl import * class DrawEnv(object): '''Sets up drawing environment. My have either or both of a "before" and "after" method. ''' pass class DrawBlended(DrawEnv): '''Sets up texture env for an alpha-blended draw. ''' def before(self): glPushAttrib(GL_ENABLE_BIT | GL_CO...
[ [ 1, 0, 0.0044, 0.0044, 0, 0.66, 0, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 3, 0, 0.024, 0.0262, 0, 0.66, 0.1, 633, 0, 0, 0, 0, 186, 0, 0 ], [ 8, 1, 0.024, 0.0175, 1, 0.1, ...
[ "from pyglet.gl import *", "class DrawEnv(object):\n '''Sets up drawing environment.\n\n My have either or both of a \"before\" and \"after\" method.\n '''\n pass", " '''Sets up drawing environment.\n\n My have either or both of a \"before\" and \"after\" method.\n '''", "class DrawBlende...
#!/usr/bin/env python ''' Management of tile sets ======================= ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import xml.dom import xml.dom.minidom from scene2d.image import Image2d, Drawable from resource import Resource, register_factory from scene2d.drawable import * @registe...
[ [ 8, 0, 0.0476, 0.0476, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0857, 0.0095, 0, 0.66, 0.0909, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0952, 0.0095, 0, 0.66...
[ "'''\nManagement of tile sets\n=======================\n\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import os", "import xml.dom", "import xml.dom.minidom", "from scene2d.image import Image2d, Drawable", "from resource import Resource, register_factory", "from scene2d.drawa...
""" """ from scene2d.map import RectMap, HexMap, RectCell, HexCell from scene2d.camera import FlatCamera from scene2d.view import FlatView, ViewScrollHandler from scene2d.sprite import Sprite, RotatableSprite, SpriteLayer from scene2d.image import Image2d from scene2d.tile import TileSet, Tile __all__ = [ 'RectMap', ...
[ [ 8, 0, 0.1071, 0.1429, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2857, 0.0714, 0, 0.66, 0.1429, 830, 0, 4, 0, 0, 830, 0, 0 ], [ 1, 0, 0.3571, 0.0714, 0, 0.66...
[ "\"\"\"\n\"\"\"", "from scene2d.map import RectMap, HexMap, RectCell, HexCell", "from scene2d.camera import FlatCamera", "from scene2d.view import FlatView, ViewScrollHandler", "from scene2d.sprite import Sprite, RotatableSprite, SpriteLayer", "from scene2d.image import Image2d", "from scene2d.tile impo...
#!/usr/bin/env python ''' Camera for projecting 2d flat scenes ==================================== ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.gl import * from pyglet.event import * class Camera(object): def project(self): '''Set up the GL projection matrix. Leave us in GL_...
[ [ 8, 0, 0.1087, 0.1087, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1957, 0.0217, 0, 0.66, 0.1667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2174, 0.0217, 0, 0.66...
[ "'''\nCamera for projecting 2d flat scenes\n====================================\n\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "from pyglet.gl import *", "from pyglet.event import *", "class Camera(object):\n def project(self):\n '''Set up the GL projection matrix. Leave...
#!/usr/bin/env python ''' Support for loading XML resource files ====================================== This module provides the Resource class which loads XML resource files which may contain scene2d image files, atlases, tile sets and maps. --------------- Getting Started --------------- Assuming the following XM...
[ [ 8, 0, 0.2173, 0.4135, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4304, 0.0042, 0, 0.66, 0.1111, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4346, 0.0042, 0, 0.66...
[ "'''\nSupport for loading XML resource files\n======================================\n\nThis module provides the Resource class which loads XML resource files\nwhich may contain scene2d image files, atlases, tile sets and maps.\n\n---------------", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", ...
#!/usr/bin/env python '''Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from pyglet.gl import glClear import pyglet.window import pygl...
[ [ 8, 0, 0.0959, 0.0959, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1644, 0.0137, 0, 0.66, 0.0667, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1781, 0.0137, 0, 0.66...
[ "'''Testing a sprite.\n\nThe ball should bounce off the sides of the window. You may resize the\nwindow.\n\nThis test should just run without failing.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import os", "import unittest", "from pyglet.gl import glClear", "import pyglet.wind...
#!/usr/bin/env python '''Testing hex map debug rendering. You should see a checkered hex map. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from render_base import RenderBase import scene2d from scene2d.debug import gen_hex_map cla...
[ [ 8, 0, 0.2115, 0.2308, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3846, 0.0385, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4231, 0.0385, 0, 0.66,...
[ "'''Testing hex map debug rendering.\n\nYou should see a checkered hex map.\n\nPress escape or close the window to finish the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import unittest", "from render_base import RenderBase", "import scene2d", "from scene2d.debug import g...
#!/usr/bin/env python '''Testing loading of a map. You should see a simple map with a circular road on it. The tiles are not well-designed :) Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from render_base import RenderBase...
[ [ 8, 0, 0.2069, 0.2414, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3793, 0.0345, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4138, 0.0345, 0, 0.66,...
[ "'''Testing loading of a map.\n\nYou should see a simple map with a circular road on it.\nThe tiles are not well-designed :)\n\nPress escape or close the window to finish the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import os", "import unittest", "from render_base import...
#!/usr/bin/env python '''Testing mouse interaction The cell the mouse is hovering over should highlight in red. Clicking in a cell should highliht that cell green. Clicking again will clear the highlighting. Clicking on the ball sprite should highlight it and not underlying cells. You may press the arrow keys to s...
[ [ 8, 0, 0.1377, 0.2029, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2609, 0.0145, 0, 0.66, 0.0909, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2754, 0.0145, 0, 0.66...
[ "'''Testing mouse interaction\n\nThe cell the mouse is hovering over should highlight in red.\n\nClicking in a cell should highliht that cell green. Clicking again will\nclear the highlighting.\n\nClicking on the ball sprite should highlight it and not underlying cells.", "__docformat__ = 'restructuredtext'", "...
#!/usr/bin/env python '''Testing flat map allow_oob enforcement. Press arrow keys to move view focal point (little ball) around map. Press "o" to turn allow_oob on and off. You should see no black border with allow_oob=False. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtex...
[ [ 8, 0, 0.1795, 0.2308, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3333, 0.0256, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.359, 0.0256, 0, 0.66, ...
[ "'''Testing flat map allow_oob enforcement.\n\nPress arrow keys to move view focal point (little ball) around map.\nPress \"o\" to turn allow_oob on and off.\n\nYou should see no black border with allow_oob=False.\n\nPress escape or close the window to finish the test.", "__docformat__ = 'restructuredtext'", "_...
#!/usr/bin/env python '''Testing rect map debug rendering. You should see a checkered square grid. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from render_base import RenderBase import scene2d from scene2d.debug import gen_rect_ma...
[ [ 8, 0, 0.2115, 0.2308, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3846, 0.0385, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4231, 0.0385, 0, 0.66,...
[ "'''Testing rect map debug rendering.\n\nYou should see a checkered square grid.\n\nPress escape or close the window to finish the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import unittest", "from render_base import RenderBase", "import scene2d", "from scene2d.debug imp...
#!/usr/bin/env python '''Testing flat map scrolling. Press arrow keys to move view focal point (little ball) around map. You will be able to move "off" the map. Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from render_base import ...
[ [ 8, 0, 0.2321, 0.2857, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.4286, 0.0357, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4643, 0.0357, 0, 0.66,...
[ "'''Testing flat map scrolling.\n\nPress arrow keys to move view focal point (little ball) around map.\n\nYou will be able to move \"off\" the map.\n\nPress escape or close the window to finish the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import unittest", "from render_bas...
#!/usr/bin/env python '''Base class for rendering tests. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from pyglet.gl import * import pyglet.window from pyglet.window.event import * from pyglet.window import key from pyglet import clock from scene2d import * from scene2d.draw...
[ [ 8, 0, 0.0538, 0.0308, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0923, 0.0154, 0, 0.66, 0.0769, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1077, 0.0154, 0, 0.66...
[ "'''Base class for rendering tests.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import os", "import unittest", "from pyglet.gl import *", "import pyglet.window", "from pyglet.window.event import *", "from pyglet.window import key", "from pyglet import clock", "from scen...
#!/usr/bin/env python '''Testing mouse interaction The cell the mouse is hovering over should highlight in red. Clicking in a cell should highliht that cell green. Clicking again will clear the highlighting. Clicking on the ball sprite should highlight it and not underlying cells. You may press the arrow keys to s...
[ [ 8, 0, 0.1377, 0.2029, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2609, 0.0145, 0, 0.66, 0.0909, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.2754, 0.0145, 0, 0.66...
[ "'''Testing mouse interaction\n\nThe cell the mouse is hovering over should highlight in red.\n\nClicking in a cell should highliht that cell green. Clicking again will\nclear the highlighting.\n\nClicking on the ball sprite should highlight it and not underlying cells.", "__docformat__ = 'restructuredtext'", "...
#!/usr/bin/env python '''Testing a sprite. The ball should bounce off the sides of the window. You may resize the window. This test should just run without failing. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from pyglet.gl import glClear import pyglet.window import pygle...
[ [ 8, 0, 0.0968, 0.1129, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1774, 0.0161, 0, 0.66, 0.0769, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1935, 0.0161, 0, 0.66...
[ "'''Testing a sprite.\n\nThe ball should bounce off the sides of the window. You may resize the\nwindow.\n\nThis test should just run without failing.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import os", "import unittest", "from pyglet.gl import glClear", "import pyglet.wind...
#!/usr/bin/env python '''Testing loading of a map. You should see a simple map with a circular road on it. The tiles are not well-designed :) Press escape or close the window to finish the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import unittest from render_base import RenderBase...
[ [ 8, 0, 0.2069, 0.2414, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3793, 0.0345, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4138, 0.0345, 0, 0.66,...
[ "'''Testing loading of a map.\n\nYou should see a simple map with a circular road on it.\nThe tiles are not well-designed :)\n\nPress escape or close the window to finish the test.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import os", "import unittest", "from render_base import...
#!/usr/bin/env python '''Testing the map model. This test should just run without failing. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet.window import Window from scene2d import RectMap, HexMap, RectCell, HexCell from scene2d.debug import gen_hex_map, gen_rect_map rmd = [...
[ [ 8, 0, 0.0177, 0.0157, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0315, 0.0039, 0, 0.66, 0.1, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0354, 0.0039, 0, 0.66, ...
[ "'''Testing the map model.\n\nThis test should just run without failing.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import unittest", "from pyglet.window import Window", "from scene2d import RectMap, HexMap, RectCell, HexCell", "from scene2d.debug import gen_hex_map, gen_rect_...
#!/usr/bin/env python '''Testing the sprite model. This test should just run without failing. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import unittest from pyglet.window import Window from pyglet.image import SolidColorImagePattern from scene2d import Sprite, Image2d class SpriteModelTest(unitt...
[ [ 8, 0, 0.0474, 0.0421, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0842, 0.0105, 0, 0.66, 0.125, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0947, 0.0105, 0, 0.66,...
[ "'''Testing the sprite model.\n\nThis test should just run without failing.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import unittest", "from pyglet.window import Window", "from pyglet.image import SolidColorImagePattern", "from scene2d import Sprite, Image2d", "class Sprit...
#!/usr/bin/env python '''Testing flat map allow_oob enforcement. Press 0-9 to set the size of the view in the window (1=10%, 0=100%) Press arrow keys to move view focal point (little ball) around map. Press "o" to turn allow_oob on and off. You should see no black border with allow_oob=False. Press escape or close...
[ [ 8, 0, 0.1569, 0.2157, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.2941, 0.0196, 0, 0.66, 0.0909, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3137, 0.0196, 0, 0.66...
[ "'''Testing flat map allow_oob enforcement.\n\nPress 0-9 to set the size of the view in the window (1=10%, 0=100%)\n\nPress arrow keys to move view focal point (little ball) around map.\nPress \"o\" to turn allow_oob on and off.\n\nYou should see no black border with allow_oob=False.", "__docformat__ = 'restructu...
# Lots Of Sprites ''' Results (us per sprite per frame): sprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k 2000 28.3 29.3 20.6 22.0 after __slots__ removal sprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k 2000 ''' import os import sys import random from pyglet ...
[ [ 8, 0, 0.1, 0.1286, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1857, 0.0143, 0, 0.66, 0.0476, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.2, 0.0143, 0, 0.66, ...
[ "'''\nResults (us per sprite per frame):\nsprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k\n2000 28.3 29.3 20.6 22.0\n\nafter __slots__ removal\nsprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k\n2000", "import os", "import sys", "import random", "from ...
import sys sys.path.insert(0, '/home/richard/src/pyglet.googlecode.com/trunk') import os import math import pyglet.window from resource import * from pyglet.window import key from pyglet import clock from scene2d import * from scene2d.textsprite import * from pyglet import font from layout import * class RocketSpri...
[ [ 1, 0, 0.0052, 0.0052, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 8, 0, 0.0157, 0.0052, 0, 0.66, 0.0238, 368, 3, 2, 0, 0, 0, 0, 1 ], [ 1, 0, 0.0262, 0.0052, 0, 0....
[ "import sys", "sys.path.insert(0, '/home/richard/src/pyglet.googlecode.com/trunk')", "import os", "import math", "import pyglet.window", "from resource import *", "from pyglet.window import key", "from pyglet import clock", "from scene2d import *", "from scene2d.textsprite import *", "from pygle...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.window import Window from pyglet import clock from scene2d.textsprite import * from pyglet import font width, height = 640, 480 window = Window(width=width, height=height) arial = font.load('Arial', 500, bold=True) co...
[ [ 8, 0, 0.0946, 0.0541, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1622, 0.027, 0, 0.66, 0.0556, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1892, 0.027, 0, 0.66, ...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "from pyglet.window import Window", "from pyglet import clock", "from scene2d.textsprite import *", "from pyglet import font", "width, height = 640, 480", "window = Window(width=width, height=height)", "arial = font.load('Ar...
import os import math import pyglet.window from pyglet.window.event import * from pyglet.window import key from pyglet import clock from euclid import Vector2, Matrix3 from scene2d import * class CarSprite(RotatableSprite): def update(self, dt): # handle input and move the car self.angle += (keybo...
[ [ 1, 0, 0.0196, 0.0196, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0392, 0.0196, 0, 0.66, 0.05, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0784, 0.0196, 0, 0....
[ "import os", "import math", "import pyglet.window", "from pyglet.window.event import *", "from pyglet.window import key", "from pyglet import clock", "from euclid import Vector2, Matrix3", "from scene2d import *", "class CarSprite(RotatableSprite):\n def update(self, dt):\n # handle input ...
#!/usr/bin/env python '''Example of simple text wrapping without using layout. ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' from pyglet.gl import * from pyglet.window import Window from pyglet.window import key from pyglet import clock from pyglet import font from scene2d.textsprite import * window =...
[ [ 8, 0, 0.0686, 0.0392, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1176, 0.0196, 0, 0.66, 0.05, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1373, 0.0196, 0, 0.66, ...
[ "'''Example of simple text wrapping without using layout.\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "from pyglet.gl import *", "from pyglet.window import Window", "from pyglet.window import key", "from pyglet import clock", "from pyglet import font", "from scene2d.textspri...
import os import math import pyglet.window from resource import * from pyglet.window import key from pyglet import clock from scene2d import * class PlayerSprite(Sprite): bullets = [] def update(self, dt): self.x += (keyboard[key.RIGHT] - keyboard[key.LEFT]) * 200 * dt if self.left < 0: self.l...
[ [ 1, 0, 0.0097, 0.0097, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0194, 0.0097, 0, 0.66, 0.0435, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0388, 0.0097, 0, ...
[ "import os", "import math", "import pyglet.window", "from resource import *", "from pyglet.window import key", "from pyglet import clock", "from scene2d import *", "class PlayerSprite(Sprite):\n bullets = []\n def update(self, dt):\n self.x += (keyboard[key.RIGHT] - keyboard[key.LEFT]) * ...
class Rect(object): '''Define a rectangular area. Many convenience handles and other properties are also defined - all of which may be assigned to which will result in altering the position and sometimes dimensions of the Rect. The Rect area includes the bottom and left borders but not the top an...
[ [ 3, 0, 0.5035, 0.9859, 0, 0.66, 0, 333, 0, 35, 0, 0, 186, 0, 19 ], [ 8, 1, 0.0493, 0.0634, 1, 0.9, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 2, 1, 0.1021, 0.0423, 1, 0.9, ...
[ "class Rect(object):\n '''Define a rectangular area.\n\n Many convenience handles and other properties are also defined - all of\n which may be assigned to which will result in altering the position\n and sometimes dimensions of the Rect.\n\n The Rect area includes the bottom and left borders but not...
Blocker = object() Start = False End = object() class Path(dict): @classmethod def determine_path(cls, field, width, height): path = cls() path.width = width path.height = height path.ends = set() path.starts = [] cells = [] for y in range(height): ...
[ [ 14, 0, 0.005, 0.005, 0, 0.66, 0, 454, 3, 0, 0, 0, 186, 10, 1 ], [ 14, 0, 0.01, 0.005, 0, 0.66, 0.25, 620, 1, 0, 0, 0, 0, 4, 0 ], [ 14, 0, 0.0149, 0.005, 0, 0.66, ...
[ "Blocker = object()", "Start = False", "End = object()", "class Path(dict):\n @classmethod\n def determine_path(cls, field, width, height):\n path = cls()\n path.width = width\n path.height = height\n path.ends = set()\n path.starts = []", " def determine_path(cls...
# desktop tower defense clone import math import random from pyglet import window from pyglet import image from pyglet import resource from pyglet import clock from pyglet.window import mouse import view import tilemap import spryte import path field_cells = ''' +++++++++++EEEEE++++++++++++ +##########.....########...
[ [ 1, 0, 0.0052, 0.0026, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0078, 0.0026, 0, 0.66, 0.025, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0129, 0.0026, 0, 0...
[ "import math", "import random", "from pyglet import window", "from pyglet import image", "from pyglet import resource", "from pyglet import clock", "from pyglet.window import mouse", "import view", "import tilemap", "import spryte", "import path", "field_cells = '''\n+++++++++++EEEEE++++++++++...
# Lots Of Sprites ''' Results for 2000 sprites: platform us per sprite per frame --------------------------------------------------------------------- Intel C2Quad Q6600 (2.4GHz), GeForce 7800 18.2478245656 Intel C2Duo T7500 (2.2GHz), GeForce 8400M GS 19.115903827 AMD 64 3500...
[ [ 8, 0, 0.0926, 0.1235, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1728, 0.0123, 0, 0.66, 0.0357, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1852, 0.0123, 0, 0.66...
[ "'''\nResults for 2000 sprites:\n\nplatform us per sprite per frame\n---------------------------------------------------------------------\nIntel C2Quad Q6600 (2.4GHz), GeForce 7800 18.2478245656\nIntel C2Duo T7500 (2.2GHz), GeForce 8400M GS 19.115903827\nAMD 64 3500+ (1.8G...
import sys import random import math from pyglet import window from pyglet import clock from pyglet import resource import spryte NUM_CARS = 100 if len(sys.argv) > 1: NUM_CARS = int(sys.argv[1]) win = window.Window(vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) cars = spryte.SpriteBatch() car = reso...
[ [ 1, 0, 0.027, 0.027, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0541, 0.027, 0, 0.66, 0.0625, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0811, 0.027, 0, 0.66...
[ "import sys", "import random", "import math", "from pyglet import window", "from pyglet import clock", "from pyglet import resource", "import spryte", "NUM_CARS = 100", "if len(sys.argv) > 1:\n NUM_CARS = int(sys.argv[1])", " NUM_CARS = int(sys.argv[1])", "win = window.Window(vsync=False)"...
import random import math from pyglet import window from pyglet import image from pyglet import clock from pyglet import gl from pyglet import resource from pyglet.window import key import spryte win = window.Window(width=640, height=400,vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) balls = spryte.Sprit...
[ [ 1, 0, 0.01, 0.01, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.02, 0.01, 0, 0.66, 0.0333, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.04, 0.01, 0, 0.66, 0....
[ "import random", "import math", "from pyglet import window", "from pyglet import image", "from pyglet import clock", "from pyglet import gl", "from pyglet import resource", "from pyglet.window import key", "import spryte", "win = window.Window(width=640, height=400,vsync=False)", "fps = clock.Cl...
import operator from pyglet import gl, event import spryte import tilemap class View(object): '''Render a flat view of a scene2d.Scene. Attributes: scene -- a scene2d.Scene instance allow_oob -- indicates whether the viewport will allow viewing of ...
[ [ 1, 0, 0.0048, 0.0048, 0, 0.66, 0, 616, 0, 1, 0, 0, 616, 0, 0 ], [ 1, 0, 0.0144, 0.0048, 0, 0.66, 0.25, 182, 0, 2, 0, 0, 182, 0, 0 ], [ 1, 0, 0.024, 0.0048, 0, 0.6...
[ "import operator", "from pyglet import gl, event", "import spryte", "import tilemap", "class View(object):\n '''Render a flat view of a scene2d.Scene.\n\n Attributes:\n\n scene -- a scene2d.Scene instance\n allow_oob -- indicates whether the viewport will allow\n ...
import os import math from pyglet import image, gl, clock, graphics, sprite class SpriteBatchGroup(graphics.Group): def __init__(self, x, y, parent=None): super(SpriteBatchGroup, self).__init__(parent) self.x, self.y = x, y def set(self): if self.x or self.y: gl.glTranslat...
[ [ 1, 0, 0.0051, 0.0051, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0102, 0.0051, 0, 0.66, 0.1667, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0204, 0.0051, 0, ...
[ "import os", "import math", "from pyglet import image, gl, clock, graphics, sprite", "class SpriteBatchGroup(graphics.Group):\n def __init__(self, x, y, parent=None):\n super(SpriteBatchGroup, self).__init__(parent)\n self.x, self.y = x, y\n\n def set(self):\n if self.x or self.y:\n...
from pyglet import image import spryte class Map(spryte.SpriteBatch): '''Rectangular map. "cells" argument must be a row-major list of lists of Sprite instances. ''' def set_cells(self, cell_width, cell_height, cells, origin=None): self.cell_width, self.cell_height = cell_width, cell_height ...
[ [ 1, 0, 0.0116, 0.0116, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0349, 0.0116, 0, 0.66, 0.5, 37, 0, 1, 0, 0, 37, 0, 0 ], [ 3, 0, 0.5233, 0.9419, 0, 0.66,...
[ "from pyglet import image", "import spryte", "class Map(spryte.SpriteBatch):\n '''Rectangular map.\n\n \"cells\" argument must be a row-major list of lists of Sprite instances.\n '''\n def set_cells(self, cell_width, cell_height, cells, origin=None):\n self.cell_width, self.cell_height = cell...
import os import math from pyglet import window from pyglet import resource from pyglet import image from pyglet.window import key from pyglet import clock import spryte import view win = window.Window(vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) map = [ [ 0, 1, 1, 1, 2, 3], [ 5, 6, 16, 1...
[ [ 1, 0, 0.0143, 0.0143, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0286, 0.0143, 0, 0.66, 0.0357, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0571, 0.0143, 0, ...
[ "import os", "import math", "from pyglet import window", "from pyglet import resource", "from pyglet import image", "from pyglet.window import key", "from pyglet import clock", "import spryte", "import view", "win = window.Window(vsync=False)", "fps = clock.ClockDisplay(color=(1, 1, 1, 1))", "...
import sys import random from pyglet import window from pyglet import image from pyglet import clock from pyglet import resource import spryte NUM_BOOMS = 20 if len(sys.argv) > 1: NUM_BOOMS = int(sys.argv[1]) win = window.Window(vsync=False) fps = clock.ClockDisplay(color=(1, 1, 1, 1)) explosions = spryte.Spri...
[ [ 1, 0, 0.0208, 0.0208, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0417, 0.0208, 0, 0.66, 0.05, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0833, 0.0208, 0, 0....
[ "import sys", "import random", "from pyglet import window", "from pyglet import image", "from pyglet import clock", "from pyglet import resource", "import spryte", "NUM_BOOMS = 20", "if len(sys.argv) > 1:\n NUM_BOOMS = int(sys.argv[1])", " NUM_BOOMS = int(sys.argv[1])", "win = window.Windo...
''' Code by Richard Jones, released into the public domain. Beginnings of something like http://en.wikipedia.org/wiki/Thrust_(video_game) ''' import sys import math import euclid import primitives import pyglet from pyglet.window import key from pyglet.gl import * window = pyglet.window.Window(fullscreen='-fs' in ...
[ [ 8, 0, 0.0179, 0.0298, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0357, 0.006, 0, 0.66, 0.0588, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0417, 0.006, 0, 0.66, ...
[ "'''\nCode by Richard Jones, released into the public domain.\n\nBeginnings of something like http://en.wikipedia.org/wiki/Thrust_(video_game)\n'''", "import sys", "import math", "import euclid", "import primitives", "import pyglet", "from pyglet.window import key", "from pyglet.gl import *", "windo...
import math import pyglet from pyglet.gl import * class SmoothLineGroup(pyglet.graphics.Group): def set_state(self): glPushAttrib(GL_ENABLE_BIT) glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glEnable(GL_LINE_SMOOTH) glLineWidth(2) def unset_state...
[ [ 1, 0, 0.025, 0.025, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.075, 0.025, 0, 0.66, 0.25, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.1, 0.025, 0, 0.66, ...
[ "import math", "import pyglet", "from pyglet.gl import *", "class SmoothLineGroup(pyglet.graphics.Group):\n def set_state(self):\n glPushAttrib(GL_ENABLE_BIT)\n glEnable(GL_BLEND)\n glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)\n glEnable(GL_LINE_SMOOTH)\n glLineWidth...
''' Code by Richard Jones, released into the public domain. Inspired by http://screamyguy.net/lines/index.htm This code uses a single drawing buffer so that successive drawing passes may be used to create the line fading effect. The fading is achieved by drawing a translucent black quad over the entire scene before d...
[ [ 8, 0, 0.0693, 0.1287, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1584, 0.0099, 0, 0.66, 0.0714, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.1683, 0.0099, 0, 0.66...
[ "'''\nCode by Richard Jones, released into the public domain.\n\nInspired by http://screamyguy.net/lines/index.htm\n\nThis code uses a single drawing buffer so that successive drawing passes\nmay be used to create the line fading effect. The fading is achieved\nby drawing a translucent black quad over the entire sc...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: obj_test.py 111 2006-10-20 06:39:12Z r1chardj0n3s $' import sys import os import ctypes import pyglet from pyglet.gl import * from model import obj, geometric w = pyglet.window.Window() fourfv = ctypes.c_float * 4 glLightfv(GL_LI...
[ [ 8, 0, 0.0593, 0.0339, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.1017, 0.0169, 0, 0.66, 0.0417, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1186, 0.0169, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: obj_test.py 111 2006-10-20 06:39:12Z r1chardj0n3s $'", "import sys", "import os", "import ctypes", "import pyglet", "from pyglet.gl import *", "from model import obj, geometric", "w = pyglet.window.Window()", "fourfv = ctypes...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: gl_tree_test.py 114 2006-10-22 09:46:11Z r1chardj0n3s $' import math import random from pyglet.window import * from pyglet.window import mouse from pyglet import clock from ctypes import * from pyglet.window.event import * from pygl...
[ [ 8, 0, 0.0389, 0.0222, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0667, 0.0111, 0, 0.66, 0.037, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0778, 0.0111, 0, 0.66,...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: gl_tree_test.py 114 2006-10-22 09:46:11Z r1chardj0n3s $'", "import math", "import random", "from pyglet.window import *", "from pyglet.window import mouse", "from pyglet import clock", "from ctypes import *", "from pyglet.windo...
import os import warnings from pyglet.gl import * from pyglet import image class Material(object): diffuse = [.8, .8, .8] ambient = [.2, .2, .2] specular = [0., 0., 0.] emission = [0., 0., 0.] shininess = 0. opacity = 1. texture = None def __init__(self, name): self.name = nam...
[ [ 1, 0, 0.0048, 0.0048, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0095, 0.0048, 0, 0.66, 0.1429, 358, 0, 1, 0, 0, 358, 0, 0 ], [ 1, 0, 0.019, 0.0048, 0, 0...
[ "import os", "import warnings", "from pyglet.gl import *", "from pyglet import image", "class Material(object):\n diffuse = [.8, .8, .8]\n ambient = [.2, .2, .2]\n specular = [0., 0., 0.]\n emission = [0., 0., 0.]\n shininess = 0.\n opacity = 1.\n texture = None", " diffuse = [.8, ...
import math import random from pyglet.gl import * import euclid M_2PI = math.pi * 2.0 class DisplayList(int): def draw(self): glCallList(self) def _TRI((v1, n1, t1, b1), (v2, n2, t2, b2), (v3, n3, t3, b3)): glNormal3f(n1[0], n1[1], n1[2]); glVertex3f(v1[0], v1[1], v1[2]) glNormal3f(n2[0], n2[1],...
[ [ 1, 0, 0.0066, 0.0066, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0132, 0.0066, 0, 0.66, 0.0588, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0265, 0.0066, 0, ...
[ "import math", "import random", "from pyglet.gl import *", "import euclid", "M_2PI = math.pi * 2.0", "class DisplayList(int):\n def draw(self):\n glCallList(self)\n\n glNormal3f(n1[0], n1[1], n1[2]); glVertex3f(v1[0], v1[1], v1[2])\n glNormal3f(n2[0], n2[1], n2[2]); glVertex3f(v2[0], v2[1]...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: //depot/task/DEV-99/client/tests.py#13 $' import sys sys.path.insert(0, '../../') sys.path.insert(0, '../layout/') from pyglet.window import * from pyglet import clock from pyglet.gl import * from pyglet import media import layout...
[ [ 8, 0, 0.0143, 0.0082, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0245, 0.0041, 0, 0.66, 0.0455, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0286, 0.0041, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id: //depot/task/DEV-99/client/tests.py#13 $'", "import sys", "sys.path.insert(0, '../../')", "sys.path.insert(0, '../layout/')", "from pyglet.window import *", "from pyglet import clock", "from pyglet.gl import *", "from pyglet im...
import os from pyglet import image _data = {} filename = os.path.join dirname = os.path.dirname(__file__) def load_gui_image(filename): if not os.path.isabs(filename): filename = os.path.join(dirname, 'data', filename) return load_image(filename) def load_image(*filename): filename = os.path.jo...
[ [ 1, 0, 0.05, 0.05, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.15, 0.05, 0, 0.66, 0.1667, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 14, 0, 0.25, 0.05, 0, 0.66, 0...
[ "import os", "from pyglet import image", "_data = {}", "filename = os.path.join", "dirname = os.path.dirname(__file__)", "def load_gui_image(filename):\n if not os.path.isabs(filename):\n filename = os.path.join(dirname, 'data', filename)\n return load_image(filename)", " if not os.path....
'''Clipboard implementation for OS X using Win32 Based on implementation from: http://aspn.activestate.com/ASPN/Mail/Message/ctypes-users/1771866 ''' from ctypes import * from pyglet.window.win32.constants import CF_TEXT, GHND OpenClipboard = windll.user32.OpenClipboard EmptyClipboard = windll.user32.EmptyClipboard ...
[ [ 1, 0, 0.0294, 0.0294, 0, 0.66, 0, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0588, 0.0294, 0, 0.66, 0.5, 239, 0, 2, 0, 0, 239, 0, 0 ], [ 3, 0, 0.5441, 0.8824, 0, 0.6...
[ "from ctypes import *", "from pyglet.window.win32.constants import CF_TEXT, GHND", "class Win32Clipboard(object):\n\n def get_text(self):\n # XXX Doesn't handle CF_UNICODETEXT yet.\n if not IsClipboardFormatAvailable(CF_TEXT):\n return ''\n if not OpenClipboard(c_int(0)):\n ...
'''Clipboard implementation for X11 using xlib. ''' from ctypes import * from pyglet import window from pyglet.window.xlib import xlib XA_PRIMARY = xlib.Atom(1) XA_STRING = xlib.Atom(31) CurrentTime = 0 AnyPropertyType = 0 class XlibClipboard(object): def get_text(self): display = window.get_platform().g...
[ [ 8, 0, 0.0273, 0.0364, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0545, 0.0182, 0, 0.66, 0.1111, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0909, 0.0182, 0, 0.66...
[ "'''Clipboard implementation for X11 using xlib.\n'''", "from ctypes import *", "from pyglet import window", "from pyglet.window.xlib import xlib", "XA_PRIMARY = xlib.Atom(1)", "XA_STRING = xlib.Atom(31)", "CurrentTime = 0", "AnyPropertyType = 0", "class XlibClipboard(object):\n def get_text(self...
'''Interaction with the Operating System text clipboard ''' import sys def get_text(): '''Get a string from the clipboard. ''' return _clipboard.get_text() def put_text(text): '''Put the string onto the clipboard. ''' return _clipboard.put_text(text) # Try to determine which platform to use....
[ [ 8, 0, 0.0577, 0.0769, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1538, 0.0385, 0, 0.66, 0.25, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 2, 0, 0.2885, 0.1538, 0, 0.66, ...
[ "'''Interaction with the Operating System text clipboard\n'''", "import sys", "def get_text():\n '''Get a string from the clipboard.\n '''\n return _clipboard.get_text()", " '''Get a string from the clipboard.\n '''", " return _clipboard.get_text()", "def put_text(text):\n '''Put the ...
import sys import xml.sax.saxutils from pyglet.gl import * from pyglet.window import mouse, key from wydget import event, layouts, loadxml from wydget.widgets.frame import Frame from wydget.widgets.label import Label class MenuItem(Label): name = 'menu-item' @event.default('menu-item') def on_element_enter(item...
[ [ 1, 0, 0.0101, 0.0101, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0202, 0.0101, 0, 0.66, 0.0769, 759, 0, 1, 0, 0, 759, 0, 0 ], [ 1, 0, 0.0404, 0.0101, 0, ...
[ "import sys", "import xml.sax.saxutils", "from pyglet.gl import *", "from pyglet.window import mouse, key", "from wydget import event, layouts, loadxml", "from wydget.widgets.frame import Frame", "from wydget.widgets.label import Label", "class MenuItem(Label):\n name = 'menu-item'", " name = ...
from wydget import anim from wydget.widgets.frame import Frame class Drawer(Frame): '''A *transparent container* that may hide and expose its contents. ''' name='drawer' HIDDEN='hidden' EXPOSED='exposed' LEFT='left' RIGHT='right' TOP='top' BOTTOM='bottom' def __init__(self, pa...
[ [ 1, 0, 0.0059, 0.0059, 0, 0.66, 0, 601, 0, 1, 0, 0, 601, 0, 0 ], [ 1, 0, 0.0118, 0.0059, 0, 0.66, 0.25, 566, 0, 1, 0, 0, 566, 0, 0 ], [ 3, 0, 0.1391, 0.2367, 0, 0....
[ "from wydget import anim", "from wydget.widgets.frame import Frame", "class Drawer(Frame):\n '''A *transparent container* that may hide and expose its contents.\n '''\n name='drawer'\n\n HIDDEN='hidden'\n EXPOSED='exposed'\n LEFT='left'", " '''A *transparent container* that may hide and e...
from pyglet.gl import * from pyglet import clock from pyglet.window import mouse from wydget import element, event, data, util, anim from wydget.widgets.button import Button, RepeaterButton from wydget.widgets.label import Label from wydget.widgets.frame import Frame class SliderCommon(Frame): slider_size = 16 ...
[ [ 1, 0, 0.0028, 0.0028, 0, 0.66, 0, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 1, 0, 0.0056, 0.0028, 0, 0.66, 0.0435, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0084, 0.0028, 0, ...
[ "from pyglet.gl import *", "from pyglet import clock", "from pyglet.window import mouse", "from wydget import element, event, data, util, anim", "from wydget.widgets.button import Button, RepeaterButton", "from wydget.widgets.label import Label", "from wydget.widgets.frame import Frame", "class Slider...
from pyglet.gl import * from pyglet.window import mouse from pyglet import media, clock from wydget import element, event, util, data, layouts, anim from wydget.widgets.frame import Frame from wydget.widgets.label import Image, Label from wydget.widgets.button import Button class Movie(Frame): name='movie' de...
[ [ 1, 0, 0.0051, 0.0051, 0, 0.66, 0, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 1, 0, 0.0103, 0.0051, 0, 0.66, 0.0667, 503, 0, 1, 0, 0, 503, 0, 0 ], [ 1, 0, 0.0154, 0.0051, 0, ...
[ "from pyglet.gl import *", "from pyglet.window import mouse", "from pyglet import media, clock", "from wydget import element, event, util, data, layouts, anim", "from wydget.widgets.frame import Frame", "from wydget.widgets.label import Image, Label", "from wydget.widgets.button import Button", "class...
from pyglet.gl import * from pyglet import clock from pyglet.window import key, mouse from wydget import element, event, util, anim, data class Checkbox(element.Element): name='checkbox' is_focusable = True def __init__(self, parent, value=False, width=16, height=16, **kw): self.parent = parent ...
[ [ 1, 0, 0.02, 0.02, 0, 0.66, 0, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 1, 0, 0.04, 0.02, 0, 0.66, 0.1667, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.06, 0.02, 0, 0.66, 0....
[ "from pyglet.gl import *", "from pyglet import clock", "from pyglet.window import key, mouse", "from wydget import element, event, util, anim, data", "class Checkbox(element.Element):\n name='checkbox'\n is_focusable = True\n\n def __init__(self, parent, value=False, width=16, height=16, **kw):\n ...
from wydget.widgets.button import Button, TextButton, RepeaterButton from wydget.widgets.frame import Frame, TabbedFrame from wydget.widgets.drawer import Drawer from wydget.widgets.label import Image, Label, XHTML from wydget.widgets.menu import MenuItem, PopupMenu from wydget.widgets.movie import Movie from wydget.wi...
[ [ 1, 0, 0.0294, 0.0294, 0, 0.66, 0, 570, 0, 3, 0, 0, 570, 0, 0 ], [ 1, 0, 0.0588, 0.0294, 0, 0.66, 0.0625, 566, 0, 2, 0, 0, 566, 0, 0 ], [ 1, 0, 0.0882, 0.0294, 0, ...
[ "from wydget.widgets.button import Button, TextButton, RepeaterButton", "from wydget.widgets.frame import Frame, TabbedFrame", "from wydget.widgets.drawer import Drawer", "from wydget.widgets.label import Image, Label, XHTML", "from wydget.widgets.menu import MenuItem, PopupMenu", "from wydget.widgets.mov...
import sys import string from pyglet.gl import * from pyglet.window import key, mouse from wydget import event, anim, util, element from wydget.widgets.frame import Frame from wydget.widgets.label import Label from wydget import clipboard # for detecting words later letters = set(string.letters) class Cursor(elemen...
[ [ 1, 0, 0.002, 0.002, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.004, 0.002, 0, 0.66, 0.0435, 890, 0, 1, 0, 0, 890, 0, 0 ], [ 1, 0, 0.008, 0.002, 0, 0.66, ...
[ "import sys", "import string", "from pyglet.gl import *", "from pyglet.window import key, mouse", "from wydget import event, anim, util, element", "from wydget.widgets.frame import Frame", "from wydget.widgets.label import Label", "from wydget import clipboard", "letters = set(string.letters)", "c...
import os from pyglet.gl import * from pyglet.window import mouse from pyglet import media, clock from wydget import element, event, util, data, layouts from wydget.widgets.frame import Frame from wydget.widgets.label import Image, Label from wydget.widgets.button import Button class Music(Frame): name='music' ...
[ [ 1, 0, 0.0066, 0.0066, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0199, 0.0066, 0, 0.66, 0.0769, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 1, 0, 0.0265, 0.0066, 0, ...
[ "import os", "from pyglet.gl import *", "from pyglet.window import mouse", "from pyglet import media, clock", "from wydget import element, event, util, data, layouts", "from wydget.widgets.frame import Frame", "from wydget.widgets.label import Image, Label", "from wydget.widgets.button import Button",...
from pyglet.gl import * from wydget import loadxml from wydget import util from wydget.widgets.label import Label class Progress(Label): name = 'progress' def __init__(self, parent, value=0.0, show_value=True, bar_color='gray', bgcolor=(.3, .3, .3, 1), color='white', width=None, height...
[ [ 1, 0, 0.0213, 0.0213, 0, 0.66, 0, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 1, 0, 0.0638, 0.0213, 0, 0.66, 0.25, 601, 0, 1, 0, 0, 601, 0, 0 ], [ 1, 0, 0.0851, 0.0213, 0, 0....
[ "from pyglet.gl import *", "from wydget import loadxml", "from wydget import util", "from wydget.widgets.label import Label", "class Progress(Label):\n name = 'progress'\n def __init__(self, parent, value=0.0, show_value=True,\n bar_color='gray', bgcolor=(.3, .3, .3, 1), color='white',\n ...
from pyglet.window import mouse import event def DragHandler(rule, buttons=mouse.LEFT): class _DragHandler(object): original_position = None mouse_buttons = buttons @event.select(rule) def on_drag(self, widget, x, y, dx, dy, buttons, modifiers): if not buttons & self....
[ [ 1, 0, 0.0625, 0.0312, 0, 0.66, 0, 503, 0, 1, 0, 0, 503, 0, 0 ], [ 1, 0, 0.125, 0.0312, 0, 0.66, 0.5, 371, 0, 1, 0, 0, 371, 0, 0 ], [ 2, 0, 0.5781, 0.8125, 0, 0.66...
[ "from pyglet.window import mouse", "import event", "def DragHandler(rule, buttons=mouse.LEFT):\n class _DragHandler(object):\n original_position = None\n mouse_buttons = buttons\n\n @event.select(rule)\n def on_drag(self, widget, x, y, dx, dy, buttons, modifiers):\n if ...
import math class RestartLayout(Exception): '''During layout an element has mutated the scene (eg. through adding scrollbars) and thus layout must be restarted). ''' def parse_value(value, base_value=0): '''Parse a numeric value spec which is one of: NNN integer NN.MMM float ...
[ [ 1, 0, 0.0025, 0.0025, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 3, 0, 0.0114, 0.0102, 0, 0.66, 0.1, 868, 0, 0, 0, 0, 645, 0, 0 ], [ 8, 1, 0.0127, 0.0076, 1, 0.1...
[ "import math", "class RestartLayout(Exception):\n '''During layout an element has mutated the scene (eg. through adding\n scrollbars) and thus layout must be restarted).\n '''", " '''During layout an element has mutated the scene (eg. through adding\n scrollbars) and thus layout must be restarted...
import os, sys from wydget import event, widgets, layouts from wydget.dialogs import base if sys.platform == 'darwin': default_dir = os.path.expanduser('~/Desktop') elif sys.platform in ('win32', 'cygwin'): default_dir = 'c:/' else: default_dir = os.path.expanduser('~/Desktop') class FileOpen(base.Dialog...
[ [ 1, 0, 0.0074, 0.0074, 0, 0.66, 0, 688, 0, 2, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0221, 0.0074, 0, 0.66, 0.1111, 601, 0, 3, 0, 0, 601, 0, 0 ], [ 1, 0, 0.0294, 0.0074, 0, ...
[ "import os, sys", "from wydget import event, widgets, layouts", "from wydget.dialogs import base", "if sys.platform == 'darwin':\n default_dir = os.path.expanduser('~/Desktop')\nelif sys.platform in ('win32', 'cygwin'):\n default_dir = 'c:/'\nelse:\n default_dir = os.path.expanduser('~/Desktop')", ...
from wydget import event from wydget import widgets from wydget import layouts from wydget.dialogs import base class Question(base.Dialog): id = '-question-dialog' name = 'question-dialog' classes = ('dialog', ) def __init__(self, parent, text, callback=None, cancel=True, font_size=None, p...
[ [ 1, 0, 0.0167, 0.0167, 0, 0.66, 0, 601, 0, 1, 0, 0, 601, 0, 0 ], [ 1, 0, 0.0333, 0.0167, 0, 0.66, 0.1429, 601, 0, 1, 0, 0, 601, 0, 0 ], [ 1, 0, 0.05, 0.0167, 0, 0....
[ "from wydget import event", "from wydget import widgets", "from wydget import layouts", "from wydget.dialogs import base", "class Question(base.Dialog):\n id = '-question-dialog'\n name = 'question-dialog'\n classes = ('dialog', )\n\n def __init__(self, parent, text, callback=None, cancel=True,\...
from wydget import widgets, event class Dialog(widgets.Frame): def __init__(self, parent, x=0, y=0, z=0, width=None, height=None, classes=(), border='black', bgcolor='white', padding=2, **kw): if 'dialog' not in classes: classes = ('dialog', ) + classes super(Dialog, self)....
[ [ 1, 0, 0.0588, 0.0294, 0, 0.66, 0, 601, 0, 2, 0, 0, 601, 0, 0 ], [ 3, 0, 0.4559, 0.7059, 0, 0.66, 0.5, 814, 0, 3, 0, 0, 937, 0, 5 ], [ 2, 1, 0.2353, 0.2059, 1, 0.0...
[ "from wydget import widgets, event", "class Dialog(widgets.Frame):\n def __init__(self, parent, x=0, y=0, z=0, width=None, height=None,\n classes=(), border='black', bgcolor='white', padding=2, **kw):\n if 'dialog' not in classes:\n classes = ('dialog', ) + classes\n super(D...
from wydget.dialogs.question import Question, Message from wydget.dialogs.file import FileOpen
[ [ 1, 0, 0.6667, 0.3333, 0, 0.66, 0, 703, 0, 2, 0, 0, 703, 0, 0 ], [ 1, 0, 1, 0.3333, 0, 0.66, 1, 634, 0, 1, 0, 0, 634, 0, 0 ] ]
[ "from wydget.dialogs.question import Question, Message", "from wydget.dialogs.file import FileOpen" ]
import operator import math from wydget import util from wydget.widgets.label import Label TOP = 'top' BOTTOM = 'bottom' LEFT = 'left' RIGHT = 'right' CENTER = 'center' FILL = 'fill' intceil = lambda i: int(math.ceil(i)) class Layout(object): '''Absolute positioning layout -- also base class for other layouts. ...
[ [ 1, 0, 0.0022, 0.0022, 0, 0.66, 0, 616, 0, 1, 0, 0, 616, 0, 0 ], [ 1, 0, 0.0044, 0.0022, 0, 0.66, 0.0588, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0087, 0.0022, 0, ...
[ "import operator", "import math", "from wydget import util", "from wydget.widgets.label import Label", "TOP = 'top'", "BOTTOM = 'bottom'", "LEFT = 'left'", "RIGHT = 'right'", "CENTER = 'center'", "FILL = 'fill'", "intceil = lambda i: int(math.ceil(i))", "class Layout(object):\n '''Absolute ...
'''Define the core `Element` class from which all gui widgets are derived. All gui elements have: - the parent widget - an id, element name and list of classes - a list of children widgets - a position in 3D space, relative to their parent's position - dimensions available as width, height, rect and inner_rect - scal...
[ [ 8, 0, 0.0516, 0.1014, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.1031, 0.0017, 0, 0.66, 0.125, 878, 0, 1, 0, 0, 878, 0, 0 ], [ 1, 0, 0.1049, 0.0017, 0, 0.66,...
[ "'''Define the core `Element` class from which all gui widgets are derived.\n\nAll gui elements have:\n\n- the parent widget\n- an id, element name and list of classes\n- a list of children widgets\n- a position in 3D space, relative to their parent's position", "import inspect", "import math", "from pyglet.g...
import math from pyglet import clock linear = lambda t: t cosine90 = lambda t: 1-math.cos(t * math.pi/2) cosine180 = lambda t: 1-abs(math.cos(t * math.pi)) exponential = lambda t: (math.exp(t)-1) / (math.exp(1)-1) half_parabola = lambda t: (1000*t)**2 / 1000**2 inverted_half_parabola = lambda t: 1-((1000*t)**2 / 1000...
[ [ 1, 0, 0.0056, 0.0056, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 1, 0, 0.0167, 0.0056, 0, 0.66, 0.0588, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 14, 0, 0.0278, 0.0056, 0, ...
[ "import math", "from pyglet import clock", "linear = lambda t: t", "cosine90 = lambda t: 1-math.cos(t * math.pi/2)", "cosine180 = lambda t: 1-abs(math.cos(t * math.pi))", "exponential = lambda t: (math.exp(t)-1) / (math.exp(1)-1)", "half_parabola = lambda t: (1000*t)**2 / 1000**2", "inverted_half_para...
from pyglet.gl import * from pyglet import font from layout import * import util class Style(object): font_name = '' font_size = 14 def getFont(self, name=None, size=None): if name is None: name = self.font_name if size is None: size = self.font_size return font.load(name, size)...
[ [ 1, 0, 0.0138, 0.0069, 0, 0.66, 0, 531, 0, 1, 0, 0, 531, 0, 0 ], [ 1, 0, 0.0207, 0.0069, 0, 0.66, 0.1667, 182, 0, 1, 0, 0, 182, 0, 0 ], [ 1, 0, 0.0276, 0.0069, 0, ...
[ "from pyglet.gl import *", "from pyglet import font", "from layout import *", "import util", "class Style(object):\n\n font_name = ''\n font_size = 14\n\n def getFont(self, name=None, size=None):\n if name is None: name = self.font_name\n if size is None: size = self.font_size", " ...
'''Usage: %s <arguments> -h h draw hexes with given height in a rectangular grid -x h draw hexes with given height in a hex grid -r w[,h] draw a rect grid -s w,h map size in cells (default=5,5) -f render flat (default) -o render orthographic projection -...
[ [ 1, 0, 0.0476, 0.0476, 0, 0.66, 0, 509, 0, 3, 0, 0, 509, 0, 0 ], [ 1, 0, 0.1429, 0.0476, 0, 0.66, 0.1429, 658, 0, 1, 0, 0, 658, 0, 0 ], [ 1, 0, 0.1905, 0.0476, 0, ...
[ "import sys, getopt, os", "import pyglet.ext.scene2d", "import pyglet.window", "import pyglet.window.event", "from pyglet import clock", "import pyglet.image", "from pyglet.ext.scene2d.debug import gen_hex_map, gen_rect_map, gen_recthex_map", "class SaveHandler:\n def on_text(self, text):\n ...
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import shutil import sys import time from xml.dom.minidom import parse try: from xml.etree import ElementTree except ImportError: from elementtree import ElementTree def get_elem_by_id(doc, name, id): for el...
[ [ 8, 0, 0.0241, 0.0138, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0414, 0.0069, 0, 0.66, 0.0833, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0483, 0.0069, 0, 0.66...
[ "'''\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import os", "import shutil", "import sys", "import time", "from xml.dom.minidom import parse", "try:\n from xml.etree import ElementTree\nexcept ImportError:\n from elementtree import ElementTree", " from xml.etree...
#!/usr/bin/env python '''Generate PDF documentation Requires docutils, docbook XSL stylesheets, xsltproc and Apache FOP (with Batik). ''' __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import shutil import subprocess from xml.dom.minidom import parse from docutils.core import publish_doctree, pu...
[ [ 8, 0, 0.0266, 0.0266, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0479, 0.0053, 0, 0.66, 0.0625, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0532, 0.0053, 0, 0.66...
[ "'''Generate PDF documentation\n\nRequires docutils, docbook XSL stylesheets, xsltproc and Apache FOP (with\nBatik).\n'''", "__docformat__ = 'restructuredtext'", "__version__ = '$Id$'", "import os", "import shutil", "import subprocess", "from xml.dom.minidom import parse", "from docutils.core import p...
# epydoc -- Backwards compatibility # # Copyright (C) 2005 Edward Loper # Author: Edward Loper <edloper@loper.org> # URL: <http://epydoc.sf.net> # # $Id: util.py 956 2006-03-10 01:30:51Z edloper $ """ Backwards compatibility with previous versions of Python. This module provides backwards compatibility by defining se...
[ [ 8, 0, 0.056, 0.044, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.08, 0.004, 0, 0.66, 0.25, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 7, 0, 0.12, 0.028, 0, 0.66, 0.5, ...
[ "\"\"\"\nBackwards compatibility with previous versions of Python.\n\nThis module provides backwards compatibility by defining several\nfunctions and classes that were not available in earlier versions of\nPython. Intented usage:\n\n >>> from epydoc.compat import *", "__docformat__ = 'epytext'", "try:\n ...
# # objdoc: epydoc documentation completeness checker # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: checker.py 1366 2006-09-07 15:54:59Z edloper $ # """ Documentation completeness checker. This module defines a single class, C{DocChecker}, which can be used to check the that specified classes of objects are d...
[ [ 8, 0, 0.0315, 0.0143, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0401, 0.0029, 0, 0.66, 0.1111, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0573, 0.0029, 0, 0.66,...
[ "\"\"\"\nDocumentation completeness checker. This module defines a single\nclass, C{DocChecker}, which can be used to check the that specified\nclasses of objects are documented.\n\"\"\"", "__docformat__ = 'epytext en'", "import re, sys, os.path, string", "from xml.dom.minidom import Text as _Text", "from ...
# # epydoc.py: epydoc LaTeX output generator # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: latex.py 1479 2007-02-13 22:01:15Z edloper $ # """ The LaTeX output generator for epydoc. The main interface provided by this module is the L{LatexWriter} class. @todo: Inheritance=listed """ __docformat__ = 'epytext e...
[ [ 8, 0, 0.0114, 0.006, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0149, 0.001, 0, 0.66, 0.1, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0169, 0.001, 0, 0.66, 0...
[ "\"\"\"\nThe LaTeX output generator for epydoc. The main interface provided by\nthis module is the L{LatexWriter} class.\n\n@todo: Inheritance=listed\n\"\"\"", "__docformat__ = 'epytext en'", "import os.path, sys, time, re, textwrap, codecs", "from epydoc.apidoc import *", "from epydoc.compat import *", ...
# # epydoc.css: default epydoc CSS stylesheets # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: html_css.py 1517 2007-02-16 06:13:56Z edloper $ # """ Predefined CSS stylesheets for the HTML outputter (L{epydoc.docwriter.html}). @type STYLESHEETS: C{dictionary} from C{string} to C{(string, string)} @var STYLESHEE...
[ [ 8, 0, 0.0306, 0.0296, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0463, 0.0019, 0, 0.66, 0.0625, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.05, 0.0019, 0, 0.66, ...
[ "\"\"\"\nPredefined CSS stylesheets for the HTML outputter (L{epydoc.docwriter.html}).\n\n@type STYLESHEETS: C{dictionary} from C{string} to C{(string, string)}\n@var STYLESHEETS: A dictionary mapping from stylesheet names to CSS\n stylesheets and descriptions. A single stylesheet may have\n multiple names. ...
# # epydoc.css: default help page # Edward Loper # # Created [01/30/01 05:18 PM] # $Id: html_help.py 1239 2006-07-05 11:29:50Z edloper $ # """ Default help file for the HTML outputter (L{epydoc.docwriter.html}). @type HTML_HELP: C{string} @var HTML_HELP: The contents of the HTML body for the default help page. """ __...
[ [ 8, 0, 0.0632, 0.0368, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0842, 0.0053, 0, 0.66, 0.5, 959, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.55, 0.9053, 0, 0.66, ...
[ "\"\"\"\nDefault help file for the HTML outputter (L{epydoc.docwriter.html}).\n\n@type HTML_HELP: C{string}\n@var HTML_HELP: The contents of the HTML body for the default\nhelp page.\n\"\"\"", "__docformat__ = 'epytext en'", "HTML_HELP = '''\n<h1 class=\"epydoc\"> API Documentation </h1>\n\n<p> This document co...