-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentender a imagem sprite
153 lines (145 loc) · 1.9 KB
/
entender a imagem sprite
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
#imagem com 8 colunas e 4 linhas imagem 1Ichigo kurosaki.png
>>> c = 8
>>> r = 4
>>> total = c * r
>>> total
32
>>> for i in range(total):
print (i%c)
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
6
7
>>> for i in range(total):
print(i%c,i/c)
0 0.0
1 0.125
2 0.25
3 0.375
4 0.5
5 0.625
6 0.75
7 0.875
0 1.0
1 1.125
2 1.25
3 1.375
4 1.5
5 1.625
6 1.75
7 1.875
0 2.0
1 2.125
2 2.25
3 2.375
4 2.5
5 2.625
6 2.75
7 2.875
0 3.0
1 3.125
2 3.25
3 3.375
4 3.5
5 3.625
6 3.75
7 3.875
>>> l = h = 48
>>> for i in range(total):
print(i%c*l,i/c*h)
0 0.0
48 6.0
96 12.0
144 18.0
192 24.0
240 30.0
288 36.0
336 42.0
0 48.0
48 54.0
96 60.0
144 66.0
192 72.0
240 78.0
288 84.0
336 90.0
0 96.0
48 102.0
96 108.0
144 114.0
192 120.0
240 126.0
288 132.0
336 138.0
0 144.0
48 150.0
96 156.0
144 162.0
192 168.0
240 174.0
288 180.0
336 186.0
>>> for i in range(total):
print("[{0}]->".format(i),(i%c * l, i/c*h,l,h))
[0]-> (0, 0.0, 48, 48)
[1]-> (48, 6.0, 48, 48)
[2]-> (96, 12.0, 48, 48)
[3]-> (144, 18.0, 48, 48)
[4]-> (192, 24.0, 48, 48)
[5]-> (240, 30.0, 48, 48)
[6]-> (288, 36.0, 48, 48)
[7]-> (336, 42.0, 48, 48)
[8]-> (0, 48.0, 48, 48)
[9]-> (48, 54.0, 48, 48)
[10]-> (96, 60.0, 48, 48)
[11]-> (144, 66.0, 48, 48)
[12]-> (192, 72.0, 48, 48)
[13]-> (240, 78.0, 48, 48)
[14]-> (288, 84.0, 48, 48)
[15]-> (336, 90.0, 48, 48)
[16]-> (0, 96.0, 48, 48)
[17]-> (48, 102.0, 48, 48)
[18]-> (96, 108.0, 48, 48)
[19]-> (144, 114.0, 48, 48)
[20]-> (192, 120.0, 48, 48)
[21]-> (240, 126.0, 48, 48)
[22]-> (288, 132.0, 48, 48)
[23]-> (336, 138.0, 48, 48)
[24]-> (0, 144.0, 48, 48)
[25]-> (48, 150.0, 48, 48)
[26]-> (96, 156.0, 48, 48)
[27]-> (144, 162.0, 48, 48)
[28]-> (192, 168.0, 48, 48)
[29]-> (240, 174.0, 48, 48)
[30]-> (288, 180.0, 48, 48)
[31]-> (336, 186.0, 48, 48)