comparison pytouhou/game/text.pxd @ 473:1c891c71cf22

Cythonize pytouhou.game.text.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 16 Sep 2013 18:42:12 +0200
parents
children 2276229282fd
comparison
equal deleted inserted replaced
472:8038f1957b71 473:1c891c71cf22
1 from pytouhou.game.element cimport Element
2 from pytouhou.game.sprite cimport Sprite
3 from pytouhou.utils.interpolator cimport Interpolator
4
5 cdef class Glyph(Element):
6 pass
7
8
9 cdef class Widget(Element):
10 cdef public object update
11 cdef public bint changed
12
13 cdef unsigned long frame
14 cdef object back_anm
15
16 #def update(self)
17
18
19 cdef class GlyphCollection(Widget):
20 cdef Sprite ref_sprite
21 cdef object anm
22 cdef list glyphes
23 cdef long xspacing
24
25 cpdef set_length(self, unsigned long length)
26 cpdef set_sprites(self, list sprite_indexes)
27 cpdef set_color(self, text=*, color=*)
28 cpdef set_alpha(self, unsigned char alpha)
29
30
31 cdef class Text(GlyphCollection):
32 cdef bytes text
33 cdef long shift, timeout, duration, start
34 cdef Interpolator fade_interpolator
35 cdef unsigned char alpha
36
37 cpdef set_text(self, bytes text)
38 #def timeout_update(self)
39 #def move_timeout_update(self)
40 #def fadeout_timeout_update(self)
41 cdef void fade(self, unsigned long duration, unsigned char alpha, formula=*) except *
42 cpdef set_timeout(self, long timeout, str effect=*, long duration=*, long start=*)
43
44
45 cdef class Counter(GlyphCollection):
46 cdef long value
47
48 cpdef set_value(self, long value)
49
50
51 cdef class Gauge(Element):
52 cdef public long value, max_length, maximum
53
54 cpdef set_value(self, long value)
55 cpdef update(self)
56
57
58 cdef class NativeText(Element):
59 cdef public object update
60
61 cdef unicode text
62 cdef long width, height
63 cdef unsigned char alpha
64 cdef bint shadow
65 cdef bytes align #TODO: use a proper enum.
66 cdef unsigned long frame, timeout, duration
67 cdef long start
68 cdef double to[2], end[2]
69 cdef list gradient
70 cdef Interpolator fade_interpolator, offset_interpolator
71 cdef object texture
72
73 #def normal_update(self)
74 #def timeout_update(self)
75 #def move_timeout_update(self)
76 #def move_ex_timeout_update(self)
77 #def fadeout_timeout_update(self)
78
79 cdef void fade(self, unsigned long duration, unsigned char alpha, formula=*) except *
80 cdef void move_in(self, unsigned long duration, double x, double y, formula=*) except *
81 cpdef set_timeout(self, long timeout, str effect=*, long duration=*, long start=*, to=*, end=*)