Skip to content

Commit b3a2623

Browse files
author
4b796c65
committed
Confirmed working on a Mac OS
1 parent 1b89d3d commit b3a2623

File tree

317 files changed

+38372
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

317 files changed

+38372
-349
lines changed

Frameworks/SDL-1.2.14.dmg

-888 KB
Binary file not shown.

Frameworks/SDL_image-1.2.12.dmg

-271 KB
Binary file not shown.

Frameworks/libpng (universal).dmg

-4.36 MB
Binary file not shown.

MANIFEST.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ include tdl/*.png
55
include tdl/*.txt
66
include tdl/VERSION
77
include tdl/lib/*.txt
8-
include tdl/linux*/*.so
9-
include tdl/win32/*.dll
8+
include tdl/lib/linux*/*.so
9+
include tdl/lib/win32/*.dll
1010
include tdl/lib/darwin/*
11+
include tdl/lib/darwin/SDL.framework/Versions/A/SDL
1112
include fonts/*.png
1213
include fonts/*.txt
1314
include Frameworks/*.framework.tar

examples/eventget.py

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1-
"""
2-
An interactive example of what events are available
3-
"""
4-
5-
import sys
6-
sys.path.insert(0, '../')
7-
8-
import tdl
9-
10-
console = tdl.init(80, 60)
11-
12-
def print_line_append(string):
13-
# move everything on the console up a line with blit
14-
console.blit(console, 0, 0, 80, 57, 0, 1)
15-
# clear the bottom line with drawRect
16-
console.drawRect(0, 57, None, 1, ' ')
17-
# print the string
18-
console.drawStr(0, 57, string)
19-
20-
tdl.setFPS(24) # slow down the program so that the user can clearly see the motion events
21-
22-
while 1:
23-
for event in tdl.event.get():
24-
if event.type == 'QUIT':
25-
raise SystemExit()
26-
elif event.type == 'KEYDOWN':
27-
print_line_append('KEYDOWN event - key=%.2i char=%s keyname=%s alt=%i ctrl=%i shift=%i' % (event.key, repr(event.char), repr(event.keyname), event.alt, event.ctrl, event.shift))
28-
elif event.type == 'KEYUP':
29-
print_line_append('KEYUP event - key=%.2i char=%s keyname=%s alt=%i ctrl=%i shift=%i' % (event.key, repr(event.char), repr(event.keyname), event.alt, event.ctrl, event.shift))
30-
elif event.type == 'MOUSEMOTION':
31-
console.drawRect(0, 59, None, None, ' ')
32-
console.drawStr(0, 59, 'MOUSEMOTION event - pos=%i,%i cell=%i,%i motion=%i,%i cellmotion=%i,%i' % (event.pos + event.cell + event.motion + event.cellmotion))
33-
elif event.type == 'MOUSEDOWN':
34-
print_line_append('MOUSEDOWN event - pos=%i,%i cell=%i,%i button=%i' % (event.pos + event.cell + (event.button,)))
35-
elif event.type == 'MOUSEUP':
36-
print_line_append('MOUSEUP event - pos=%i,%i cell=%i,%i button=%i' % (event.pos + event.cell + (event.button,)))
37-
tdl.flush()
1+
#!/usr/bin/env python
2+
"""
3+
An interactive example of what events are available
4+
"""
5+
6+
import sys
7+
sys.path.insert(0, '../')
8+
9+
import tdl
10+
11+
console = tdl.init(80, 60)
12+
13+
def print_line_append(string):
14+
# move everything on the console up a line with blit
15+
console.blit(console, 0, 0, 80, 57, 0, 1)
16+
# clear the bottom line with drawRect
17+
console.drawRect(0, 57, None, 1, ' ')
18+
# print the string
19+
console.drawStr(0, 57, string)
20+
21+
tdl.setFPS(24) # slow down the program so that the user can clearly see the motion events
22+
23+
while 1:
24+
for event in tdl.event.get():
25+
if event.type == 'QUIT':
26+
raise SystemExit()
27+
elif event.type == 'KEYDOWN':
28+
print_line_append('KEYDOWN event - key=%.2i char=%s keyname=%s alt=%i ctrl=%i shift=%i' % (event.key, repr(event.char), repr(event.keyname), event.alt, event.ctrl, event.shift))
29+
elif event.type == 'KEYUP':
30+
print_line_append('KEYUP event - key=%.2i char=%s keyname=%s alt=%i ctrl=%i shift=%i' % (event.key, repr(event.char), repr(event.keyname), event.alt, event.ctrl, event.shift))
31+
elif event.type == 'MOUSEMOTION':
32+
console.drawRect(0, 59, None, None, ' ')
33+
console.drawStr(0, 59, 'MOUSEMOTION event - pos=%i,%i cell=%i,%i motion=%i,%i cellmotion=%i,%i' % (event.pos + event.cell + event.motion + event.cellmotion))
34+
elif event.type == 'MOUSEDOWN':
35+
print_line_append('MOUSEDOWN event - pos=%i,%i cell=%i,%i button=%i' % (event.pos + event.cell + (event.button,)))
36+
elif event.type == 'MOUSEUP':
37+
print_line_append('MOUSEUP event - pos=%i,%i cell=%i,%i button=%i' % (event.pos + event.cell + (event.button,)))
38+
tdl.flush()

examples/hello_world.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python
12
"""
23
Example showing some of the most basic functions needed to say "Hello World"
34
"""

examples/interactive.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
#!/usr/bin/env python
22
import sys
33
import code
44
import textwrap
@@ -53,7 +53,7 @@ def write(self, string):
5353
if event.type == 'QUIT':
5454
raise SystemExit()
5555
if event.type == 'KEYDOWN':
56-
if event.char == '\r':
56+
if event.keyname == 'ENTER':
5757
sys.stderr = newerr
5858
try:
5959
console.drawRect(0, HEIGHT-1, None, 1, None, (255, 255, 255), (0, 0, 0))
@@ -73,7 +73,7 @@ def write(self, string):
7373
buffer = ''
7474
elif event.ctrl:
7575
pass
76-
elif event.char == '\b':
76+
elif event.keyname == 'BACKSPACE':
7777
if cursor == 0:
7878
continue
7979
if buffer[:cursor][-4:] == ' ':
@@ -100,7 +100,7 @@ def write(self, string):
100100
commands.append(buffer)
101101
buffer = commands.pop(0)
102102
cursor = len(buffer)
103-
elif event.char == '\t':
103+
elif event.keyname == 'TAB':
104104
buffer = buffer[:cursor] + ' ' + buffer[cursor:]
105105
cursor += 4
106106
elif event.keyname == 'ESCAPE':

fonts/arial10x10.png

6.55 KB

fonts/arial12x12.png

7.17 KB

fonts/arial8x8.png

4.92 KB

0 commit comments

Comments
 (0)