×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Tutorial] Utílitario Image Editor
[Tutorial] Utílitario Image Editor
Sklag
« Citoyen »
1648351140000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#1
  4
  • Como Usar
  • Código
Image Editor 1.1

Olá ratinho! que tenta sempra acerta a posição mais demora um pouco pra acertar-la, digamos que você não seja bom em matematica, ou não tem conhecimento o suficiente, este Script, lhe auxilia como um editor de imagens, agradeço Ninguem#0095 pela função
nineSlicedRect Usada neste script.

Como usar?

Você tem uma tabela de botões pra modificar sua imagem:
https://i.imgur.com/WA4VRS3.png

Você tem onde mostra sua imagem, seu addImage, enviar a imagem que você colocar, printar a função
as setas mexem com o anchor da imagem
https://i.imgur.com/exa2GXQ.png
https://i.imgur.com/8d195e0.png
https://i.imgur.com/2tG099w.png
Image Editor 1.0
1.0

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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
-- made by Sklag#2552, version 1.0

data = {}
windows95button = {
{img="17f83de5e4a.png", w=3, h=3},
{img="17f83decc1d.png", w=1, h=3},
{img="17f83df26b3.png", w=3, h=3},
{img="17f83df8406.png", w=3, h=1},
{img="17f83dfe21f.png", w=1, h=1},
{img="17f83e04755.png", w=3, h=1},
{img="17f83e0a283.png", w=3, h=3},
{img="17f83e0fd89.png", w=1, h=3},
{img="17f83e1586f.png", w=3, h=3},
}

windows95window = {
{img="17f83ff3f58.png", w=3, h=20},
{img="17f8400d793.png", w=1, h=20},
{img="17f840196d7.png", w=3, h=20},
{img="17f83df8406.png", w=3, h=1},
{img="17f83dfe21f.png", w=1, h=1},
{img="17f83e04755.png", w=3, h=1},
{img="17f83e0a283.png", w=3, h=3},
{img="17f83e0fd89.png", w=1, h=3},
{img="17f83e1586f.png", w=3, h=3},
}

nineSlicedRect = function(source, target, targetPlayer, x, y, width, height)
return {
tfm.exec.addImage (source[1].img, target, x, y, targetPlayer, 1, 1),
tfm.exec.addImage (source[2].img, target, x+source[1].w, y, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1),
tfm.exec.addImage (source[3].img, target, x+width-source[3].w, y, targetPlayer, 1, 1),
tfm.exec.addImage (source[4].img, target, x, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[5].img, target, x+source[1].w, y+source[1].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[6].img, target, x+width-source[6].w, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[7].img, target, x, y+height-source[7].h, targetPlayer, 1, 1),
tfm.exec.addImage (source[8].img, target, x+source[7].w, y+height-source[8].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1),
tfm.exec.addImage (source[9].img, target, x+width-source[9].w, y+height-source[9].h, targetPlayer, 1, 1),
}
end

eventNewPlayer = function(name)
if not data[name] then
data[name] = {
image = "answer",
type = ":1",
target = 'nil',
scaleX = '1',
scaleY = '1',
angle = 'nil',
alpha = '1',
anchorX = '0',
anchorY = '0',
inv = false,
j = 0
}
end
for i = 37,40 do
tfm.exec.bindKeyboard(name, i, true, true)
end
nineSlicedRect(windows95window, ":1000", name, 0, 20, 800, 400)
nineSlicedRect(windows95window, ":1000", name, 350, 65, 400, 300)
nineSlicedRect(windows95window, ":1000", name, 145, 65, 200, 300)
nineSlicedRect(windows95button, ":1000", name, 355, 340, 190, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 65, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 90, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 115, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 140, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 165, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 190, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 630, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 655, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 680, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 705, 375, 20, 20)
ui.addTextArea(21, "<font color='#f'><p align='center'>↓", name, 650, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(12, "<font color='#f'><p align='center'>←", name, 575, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(13, "<font color='#f'><p align='center'>↑", name, 600, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(14, "<font color='#f'><p align='center'>→", name, 625, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(15, "<font color='#f'><p align='center'><a href='event:escolherinverter'>Inverter", name, 10, 190, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(16, "<font color='#f'><p align='center'><a href='event:escolheralpha'>Transparencia", name, 10, 165, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(17, "<font color='#f'><p align='center'><a href='event:escolherangle'>Angle", name, 10, 140, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(18, "<font color='#f'><p align='center'><a href='event:escolhertype'>Tipo", name, 10, 115, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(19, "<font color='#f'><p align='center'><a href='event:escolherscaley'>Scale Y", name, 10, 90, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(20, "<font color='#f'><p align='center'><a href='event:escolherscalex'>Scale X", name, 10, 65, 130, 20, 0xf, 0xf, 2, true)

ui.addTextArea(1, "<font color='#f'><p align='center'><a href='event:escolherimagem'>Escolher Imagem", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(3, "<font color='#f'>type: ???", name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(4, "<font color='#f'>targetPlayer: ???", name, 150, 95, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(5, "<font color='#f'>image: ???", name, 150, 105, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(6, "<font color='#f'>scaleX: ???", name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(7, "<font color='#f'>scaleY: ???", name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(8, "<font color='#f'>angle: ???", name, 150, 135, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(9, "<font color='#f'>alpha: ???", name, 150, 145, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(10, "<font color='#f'>anchorX: ???", name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(11, "<font color='#f'>anchorY: ???", name, 150, 165, nil, 20, 0xf, 0xf, 2, true)

end

eventTextAreaCallback = function(id, name, event)
if (event == "escolherimagem" and id == 1) then
ui.addPopup(1, 2, "Escolha uma Imagem.", name, 300, 150, 150, true)
elseif (event == "printarfunction" and id == 2) then
print('Coloque no tfm.exec.addImage: '..data[name].image..'", "'..data[name].type..'", 100, 100, '..data[name].target..', '..data[name].scaleX..', '..data[name].scaleY..', '..data[name].angle..', '..data[name].alpha..', '..data[name].anchorX..', '..data[name].anchorY)
elseif (event == "escolherscalex" and id == 20) then
ui.addPopup(2, 2, "Escolha um Scale X.", name, 300, 150, 150, true)
elseif (event == "escolherscaley" and id == 19) then
ui.addPopup(3, 2, "Escolha um Scale Y.", name, 300, 150, 150, true)
elseif (event == "escolhertype" and id == 18) then
ui.addPopup(4, 2, "Escolha um Tipo.", name, 300, 150, 150, true)
elseif (event == "escolherangle" and id == 17) then
ui.addPopup(5, 2, "Escolha um Angulo.", name, 300, 150, 150, true)
elseif (event == "escolheralpha" and id == 16) then
ui.addPopup(6, 2, "Nivel de transparencia.", name, 300, 150, 150, true)
elseif (event == "escolherinverter" and id == 15) then
if (data[name].inv == true) then
if (data[name].j == 1) then
data[name].scaleX = data[name].scaleX * 1
end
data[name].inv = true
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
elseif (data[name].inv == false) then
data[name].j = 1
data[name].scaleX = data[name].scaleX * -1
print(data[name].scaleX)
data[name].inv = false
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
end
end
end

eventKeyboard = function(name, key, down, x, y)
if (key == 37) then
data[name].anchorX = data[name].anchorX +0.1
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)

elseif (key == 40) then
data[name].anchorY = data[name].anchorY -0.1
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

elseif (key == 39) then
data[name].anchorX = data[name].anchorX -0.1
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

elseif (key == 38) then
data[name].anchorY = data[name].anchorY +0.1
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

end
end

eventPopupAnswer = function(id, name, answer)
if (id == 1 and answer) then
data[name].image = answer
print(data[name].image)
img = answer
data[name].image = img
img = tfm.exec.addImage(answer, ":1", 510, 175, data[name].targetPlayer, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
nineSlicedRect(windows95button, ":1000", name, 555, 340, 190, 20)
ui.addTextArea(1, "<font color='#f'><p align='center'><a href='event:escolherimagem'>Escolher Imagem", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(2, "<font color='#f'><p align='center'><a href='event:printarfunction'>Printar função", name, 550, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(4, "<font color='#f'>targetPlayer: "..data[name].target, name, 150, 95, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(5, "<font color='#f'>image: "..answer, name, 150, 105, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(7, "<font color='#f'>scaleY: "..data[name].scaleY, name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(8, "<font color='#f'>angle: "..data[name].angle, name, 150, 135, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(9, "<font color='#f'>alpha: "..data[name].alpha, name, 150, 145, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 2 and answer) then
data[name].scaleX = answer
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 3 and answer) then
data[name].scaleY = answer
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(7, "<font color='#f'>scaleY: "..data[name].scaleY, name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 4 and answer) then
data[name].type = answer
ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 5 and answer) then
data[name].angle = answer
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(8, "<font color='#f'>angle: "..data[name].angle, name, 150, 135, nil, 20, 0xf, 0xf, 2, true)

ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 6 and answer) then
data[name].alpha = answer
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

ui.addTextArea(9, "<font color='#f'>alpha: "..data[name].alpha, name, 150, 145, nil, 20, 0xf, 0xf, 2, true)

end
end

for all in pairs(tfm.get.room.playerList) do
eventNewPlayer(all)
end

Image Editor 1.1

1.1

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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
-- made by Sklag#2552, version 1.1

data = {}
windows95button = {
{img="17f83de5e4a.png", w=3, h=3},
{img="17f83decc1d.png", w=1, h=3},
{img="17f83df26b3.png", w=3, h=3},
{img="17f83df8406.png", w=3, h=1},
{img="17f83dfe21f.png", w=1, h=1},
{img="17f83e04755.png", w=3, h=1},
{img="17f83e0a283.png", w=3, h=3},
{img="17f83e0fd89.png", w=1, h=3},
{img="17f83e1586f.png", w=3, h=3},
}

windows95window = {
{img="17f83ff3f58.png", w=3, h=20},
{img="17f8400d793.png", w=1, h=20},
{img="17f840196d7.png", w=3, h=20},
{img="17f83df8406.png", w=3, h=1},
{img="17f83dfe21f.png", w=1, h=1},
{img="17f83e04755.png", w=3, h=1},
{img="17f83e0a283.png", w=3, h=3},
{img="17f83e0fd89.png", w=1, h=3},
{img="17f83e1586f.png", w=3, h=3},
}

nineSlicedRect = function(source, target, targetPlayer, x, y, width, height)
return {
tfm.exec.addImage (source[1].img, target, x, y, targetPlayer, 1, 1),
tfm.exec.addImage (source[2].img, target, x+source[1].w, y, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1),
tfm.exec.addImage (source[3].img, target, x+width-source[3].w, y, targetPlayer, 1, 1),
tfm.exec.addImage (source[4].img, target, x, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[5].img, target, x+source[1].w, y+source[1].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[6].img, target, x+width-source[6].w, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[7].img, target, x, y+height-source[7].h, targetPlayer, 1, 1),
tfm.exec.addImage (source[8].img, target, x+source[7].w, y+height-source[8].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1),
tfm.exec.addImage (source[9].img, target, x+width-source[9].w, y+height-source[9].h, targetPlayer, 1, 1),
}
end

eventNewPlayer = function(name)
if not data[name] then
data[name] = {
image = "answer",
type = ":1",
target = 'nil',
scaleX = '1',
scaleY = '1',
angle = 'nil',
alpha = '1',
anchorX = '0',
anchorY = '0',
inv = false,
j = 0
}
end
for i = 37,40 do
tfm.exec.bindKeyboard(name, i, true, true)
end
nineSlicedRect(windows95window, ":1000", name, 0, 20, 800, 400)
nineSlicedRect(windows95window, ":1000", name, 350, 65, 400, 300)
nineSlicedRect(windows95window, ":1000", name, 145, 65, 200, 300)
nineSlicedRect(windows95button, ":1000", name, 355, 340, 190, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 65, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 90, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 115, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 140, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 165, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 190, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 630, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 655, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 680, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 705, 375, 20, 20)
ui.addTextArea(21, "<font color='#f'><p align='center'>↓", name, 650, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(12, "<font color='#f'><p align='center'>←", name, 575, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(13, "<font color='#f'><p align='center'>↑", name, 600, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(14, "<font color='#f'><p align='center'>→", name, 625, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(15, "<font color='#f'><p align='center'><a href='event:escolherinverter'>Inverter", name, 10, 190, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(16, "<font color='#f'><p align='center'><a href='event:escolheralpha'>Transparencia", name, 10, 165, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(17, "<font color='#f'><p align='center'><a href='event:escolherangle'>Angle", name, 10, 140, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(18, "<font color='#f'><p align='center'><a href='event:escolhertype'>Tipo", name, 10, 115, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(19, "<font color='#f'><p align='center'><a href='event:escolherscaley'>Scale Y", name, 10, 90, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(20, "<font color='#f'><p align='center'><a href='event:escolherscalex'>Scale X", name, 10, 65, 130, 20, 0xf, 0xf, 2, true)

ui.addTextArea(1, "<font color='#f'><p align='center'><a href='event:escolherimagem'>Escolher Imagem", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(3, "<font color='#f'>type: ???", name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(4, "<font color='#f'>targetPlayer: ???", name, 150, 95, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(5, "<font color='#f'>image: ???", name, 150, 105, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(6, "<font color='#f'>scaleX: ???", name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(7, "<font color='#f'>scaleY: ???", name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(8, "<font color='#f'>angle: ???", name, 150, 135, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(9, "<font color='#f'>alpha: ???", name, 150, 145, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(10, "<font color='#f'>anchorX: ???", name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(11, "<font color='#f'>anchorY: ???", name, 150, 165, nil, 20, 0xf, 0xf, 2, true)

end

eventTextAreaCallback = function(id, name, event)
if (event == "escolherimagem" and id == 1) then
ui.addPopup(1, 2, "Escolha uma Imagem.", name, 300, 150, 150, true)
elseif (event == "printarfunction" and id == 2) then
print('Coloque no tfm.exec.addImage: '..data[name].image..'", "'..data[name].type..'", 100, 100, '..data[name].target..', '..data[name].scaleX..', '..data[name].scaleY..', '..data[name].angle..', '..data[name].alpha..', '..data[name].anchorX..', '..data[name].anchorY)
elseif (event == "escolherscalex" and id == 20) then
ui.addPopup(2, 2, "Escolha um Scale X.", name, 300, 150, 150, true)
elseif (event == "escolherscaley" and id == 19) then
ui.addPopup(3, 2, "Escolha um Scale Y.", name, 300, 150, 150, true)
elseif (event == "escolhertype" and id == 18) then
ui.addPopup(4, 2, "Escolha um Tipo.", name, 300, 150, 150, true)
elseif (event == "escolherangle" and id == 17) then
ui.addPopup(5, 2, "Escolha um Angulo.", name, 300, 150, 150, true)
elseif (event == "escolheralpha" and id == 16) then
ui.addPopup(6, 2, "Nivel de transparencia.", name, 300, 150, 150, true)
elseif (event == "escolherinverter" and id == 15) then
if (data[name].inv == true) then
if (data[name].j == 1) then
data[name].scaleX = data[name].scaleX * 1
end
data[name].inv = true
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
elseif (data[name].inv == false) then
data[name].j = 1
data[name].scaleX = data[name].scaleX * -1
print(data[name].scaleX)
data[name].inv = false
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, nil, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
end
end
end

eventKeyboard = function(name, key, down, x, y)
if (key == 37) then
data[name].anchorX = data[name].anchorX +0.1
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)

elseif (key == 40) then
data[name].anchorY = data[name].anchorY -0.1
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

elseif (key == 39) then
data[name].anchorX = data[name].anchorX -0.1
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

elseif (key == 38) then
data[name].anchorY = data[name].anchorY +0.1
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

end
end

eventPopupAnswer = function(id, name, answer)
if (id == 1 and answer) then
data[name].image = answer
print(data[name].image)
img = answer
data[name].image = img
img = tfm.exec.addImage(answer, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
nineSlicedRect(windows95button, ":1000", name, 555, 340, 190, 20)
ui.addTextArea(1, "<font color='#f'><p align='center'><a href='event:escolherimagem'>Escolher Imagem", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(2, "<font color='#f'><p align='center'><a href='event:printarfunction'>Printar função", name, 550, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(4, "<font color='#f'>targetPlayer: "..data[name].target, name, 150, 95, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(5, "<font color='#f'>image: "..answer, name, 150, 105, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(7, "<font color='#f'>scaleY: "..data[name].scaleY, name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(8, "<font color='#f'>angle: "..data[name].angle, name, 150, 135, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(9, "<font color='#f'>alpha: "..data[name].alpha, name, 150, 145, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 2 and answer) then
data[name].scaleX = answer
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 3 and answer) then
data[name].scaleY = answer
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(7, "<font color='#f'>scaleY: "..data[name].scaleY, name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 4 and answer) then
data[name].type = answer
ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 5 and answer) then
data[name].angle = answer
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(8, "<font color='#f'>angle: "..data[name].angle, name, 150, 135, nil, 20, 0xf, 0xf, 2, true)

ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 6 and answer) then
data[name].alpha = answer
tfm.exec.removeImage(img)
img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

ui.addTextArea(9, "<font color='#f'>alpha: "..data[name].alpha, name, 150, 145, nil, 20, 0xf, 0xf, 2, true)

end
end

for all in pairs(tfm.get.room.playerList) do
eventNewPlayer(all)
end

Image Editor 1.1b


Concertado bug de desaparecer a imagem de outro pra outro jogador
Concertado bug de imagens duplicadas

1.1b

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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
-- made by Sklag#2552, version 1.1b

data = {}
windows95button = {
{img="17f83de5e4a.png", w=3, h=3},
{img="17f83decc1d.png", w=1, h=3},
{img="17f83df26b3.png", w=3, h=3},
{img="17f83df8406.png", w=3, h=1},
{img="17f83dfe21f.png", w=1, h=1},
{img="17f83e04755.png", w=3, h=1},
{img="17f83e0a283.png", w=3, h=3},
{img="17f83e0fd89.png", w=1, h=3},
{img="17f83e1586f.png", w=3, h=3},
}

windows95window = {
{img="17f83ff3f58.png", w=3, h=20},
{img="17f8400d793.png", w=1, h=20},
{img="17f840196d7.png", w=3, h=20},
{img="17f83df8406.png", w=3, h=1},
{img="17f83dfe21f.png", w=1, h=1},
{img="17f83e04755.png", w=3, h=1},
{img="17f83e0a283.png", w=3, h=3},
{img="17f83e0fd89.png", w=1, h=3},
{img="17f83e1586f.png", w=3, h=3},
}

nineSlicedRect = function(source, target, targetPlayer, x, y, width, height)
return {
tfm.exec.addImage (source[1].img, target, x, y, targetPlayer, 1, 1),
tfm.exec.addImage (source[2].img, target, x+source[1].w, y, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1),
tfm.exec.addImage (source[3].img, target, x+width-source[3].w, y, targetPlayer, 1, 1),
tfm.exec.addImage (source[4].img, target, x, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[5].img, target, x+source[1].w, y+source[1].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[6].img, target, x+width-source[6].w, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[7].img, target, x, y+height-source[7].h, targetPlayer, 1, 1),
tfm.exec.addImage (source[8].img, target, x+source[7].w, y+height-source[8].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1),
tfm.exec.addImage (source[9].img, target, x+width-source[9].w, y+height-source[9].h, targetPlayer, 1, 1),
}
end

eventNewPlayer = function(name)
if not data[name] then
data[name] = {
image = "answer",
type = ":1",
target = 'nil',
scaleX = '1',
scaleY = '1',
angle = 'nil',
alpha = '1',
anchorX = '0',
anchorY = '0',
inv = false,
img = "",
j = 0
}
end
for i = 37,40 do
tfm.exec.bindKeyboard(name, i, true, true)
end
nineSlicedRect(windows95window, ":1000", name, 0, 20, 800, 400)
nineSlicedRect(windows95window, ":1000", name, 350, 65, 400, 300)
nineSlicedRect(windows95window, ":1000", name, 145, 65, 200, 300)
nineSlicedRect(windows95button, ":1000", name, 355, 340, 190, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 65, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 90, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 115, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 140, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 165, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 190, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 630, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 655, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 680, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 705, 375, 20, 20)
ui.addTextArea(21, "<font color='#f'><p align='center'>↓", name, 650, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(12, "<font color='#f'><p align='center'>←", name, 575, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(13, "<font color='#f'><p align='center'>↑", name, 600, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(14, "<font color='#f'><p align='center'>→", name, 625, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(15, "<font color='#f'><p align='center'><a href='event:escolherinverter'>Inverter", name, 10, 190, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(16, "<font color='#f'><p align='center'><a href='event:escolheralpha'>Transparencia", name, 10, 165, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(17, "<font color='#f'><p align='center'><a href='event:escolherangle'>Angulo", name, 10, 140, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(18, "<font color='#f'><p align='center'><a href='event:escolhertype'>Tipo", name, 10, 115, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(19, "<font color='#f'><p align='center'><a href='event:escolherscaley'>Scale Y", name, 10, 90, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(20, "<font color='#f'><p align='center'><a href='event:escolherscalex'>Scale X", name, 10, 65, 130, 20, 0xf, 0xf, 2, true)

ui.addTextArea(1, "<font color='#f'><p align='center'><a href='event:escolherimagem'>Escolher Imagem", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(3, "<font color='#f'>type: ???", name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(4, "<font color='#f'>targetPlayer: ???", name, 150, 95, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(5, "<font color='#f'>image: ???", name, 150, 105, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(6, "<font color='#f'>scaleX: ???", name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(7, "<font color='#f'>scaleY: ???", name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(8, "<font color='#f'>angle: ???", name, 150, 135, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(9, "<font color='#f'>alpha: ???", name, 150, 145, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(10, "<font color='#f'>anchorX: ???", name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(11, "<font color='#f'>anchorY: ???", name, 150, 165, nil, 20, 0xf, 0xf, 2, true)

end

eventTextAreaCallback = function(id, name, event)
if (event == "escolherimagem" and id == 1) then
ui.addPopup(1, 2, "Choose a Image.", name, 300, 150, 150, true)
elseif (event == "printarfunction" and id == 2) then
print('put in the tfm.exec.addImage: '..data[name].image..'", "'..data[name].type..'", 100, 100, '..data[name].target..', '..data[name].scaleX..', '..data[name].scaleY..', '..data[name].angle..', '..data[name].alpha..', '..data[name].anchorX..', '..data[name].anchorY)
elseif (event == "escolherscalex" and id == 20) then
ui.addPopup(2, 2, "Choose Scale X.", name, 300, 150, 150, true)
elseif (event == "escolherscaley" and id == 19) then
ui.addPopup(3, 2, "Choose Scale Y.", name, 300, 150, 150, true)
elseif (event == "escolhertype" and id == 18) then
ui.addPopup(4, 2, "Choose a Type.", name, 300, 150, 150, true)
elseif (event == "escolherangle" and id == 17) then
ui.addPopup(5, 2, "Choose a Angle.", name, 300, 150, 150, true)
elseif (event == "escolheralpha" and id == 16) then
ui.addPopup(6, 2, "Nivel de transparencia.", name, 300, 150, 150, true)
elseif (event == "escolherinverter" and id == 15) then
if (data[name].inv == true) then
if (data[name].j == 1) then
data[name].scaleX = data[name].scaleX * 1
end
data[name].inv = true
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
elseif (data[name].inv == false) then
data[name].j = 1
data[name].scaleX = data[name].scaleX * -1
print(data[name].scaleX)
data[name].inv = false
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
end
end
end

eventKeyboard = function(name, key, down, x, y)
if (key == 37) then
data[name].anchorX = data[name].anchorX +0.1
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)

elseif (key == 40) then
data[name].anchorY = data[name].anchorY -0.1
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

elseif (key == 39) then
data[name].anchorX = data[name].anchorX -0.1
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

elseif (key == 38) then
data[name].anchorY = data[name].anchorY +0.1
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

end
end

eventPopupAnswer = function(id, name, answer)
if (id == 1 and answer) then
data[name].image = answer
print(data[name].image)
img = answer
data[name].image = img
data[name].img = tfm.exec.addImage(answer, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
nineSlicedRect(windows95button, ":1000", name, 555, 340, 190, 20)
ui.addTextArea(1, "<font color='#f'><p align='center'><a href='event:escolherimagem'>Escolher Imagem", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(2, "<font color='#f'><p align='center'><a href='event:printarfunction'>Printar a função", name, 550, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(4, "<font color='#f'>targetPlayer: "..data[name].target, name, 150, 95, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(5, "<font color='#f'>image: "..answer, name, 150, 105, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(7, "<font color='#f'>scaleY: "..data[name].scaleY, name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(8, "<font color='#f'>angle: "..data[name].angle, name, 150, 135, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(9, "<font color='#f'>alpha: "..data[name].alpha, name, 150, 145, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 2 and answer) then
data[name].scaleX = answer
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 3 and answer) then
data[name].scaleY = answer
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(7, "<font color='#f'>scaleY: "..data[name].scaleY, name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 4 and answer) then
data[name].type = answer
ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 5 and answer) then
data[name].angle = answer
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(8, "<font color='#f'>angle: "..data[name].angle, name, 150, 135, nil, 20, 0xf, 0xf, 2, true)

ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 6 and answer) then
data[name].alpha = answer
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

ui.addTextArea(9, "<font color='#f'>alpha: "..data[name].alpha, name, 150, 145, nil, 20, 0xf, 0xf, 2, true)

end
end

for all in pairs(tfm.get.room.playerList) do
eventNewPlayer(all)
end


Dernière modification le 1648418400000
Ninguem
« Consul »
1648386720000
    • Ninguem#0095
    • Profil
    • Derniers messages
    • Tribu
#2
  1
Que coisa linda esse editor! Não pensei que alguém fosse querer usar o tema de windows 95 shaushaus

Estou windorizado!
Sklag
« Citoyen »
1648393500000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#3
  1
Ninguem a dit :
Que coisa linda esse editor! Não pensei que alguém fosse querer usar o tema de windows 95 shaushaus

Estou windorizado!

Eu so fiz por passa tempo mesmo kk
Sklag
« Citoyen »
1648398240000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#4
  0
Image Editor 1.1

Agora a imagem que você colocar aparece somenta pra pessoa que colocou a imagem.
Natsmiro
« Citoyen »
1648403760000
    • Natsmiro#0000
    • Profil
    • Derniers messages
    • Tribu
#5
  0
Muito legal. Me lembrou os antigos Windows que tinha aqueles editores de imagens. Bem criativo.
Sklag
« Citoyen »
1648418400000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#6
  0
Image Editor 1.1b


Concertado bug de desaparecer a imagem de outro pra outro jogador
Concertado bug de imagens duplicadas

1.1b

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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
-- made by Sklag#2552, version 1.1b

data = {}
windows95button = {
{img="17f83de5e4a.png", w=3, h=3},
{img="17f83decc1d.png", w=1, h=3},
{img="17f83df26b3.png", w=3, h=3},
{img="17f83df8406.png", w=3, h=1},
{img="17f83dfe21f.png", w=1, h=1},
{img="17f83e04755.png", w=3, h=1},
{img="17f83e0a283.png", w=3, h=3},
{img="17f83e0fd89.png", w=1, h=3},
{img="17f83e1586f.png", w=3, h=3},
}

windows95window = {
{img="17f83ff3f58.png", w=3, h=20},
{img="17f8400d793.png", w=1, h=20},
{img="17f840196d7.png", w=3, h=20},
{img="17f83df8406.png", w=3, h=1},
{img="17f83dfe21f.png", w=1, h=1},
{img="17f83e04755.png", w=3, h=1},
{img="17f83e0a283.png", w=3, h=3},
{img="17f83e0fd89.png", w=1, h=3},
{img="17f83e1586f.png", w=3, h=3},
}

nineSlicedRect = function(source, target, targetPlayer, x, y, width, height)
return {
tfm.exec.addImage (source[1].img, target, x, y, targetPlayer, 1, 1),
tfm.exec.addImage (source[2].img, target, x+source[1].w, y, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1),
tfm.exec.addImage (source[3].img, target, x+width-source[3].w, y, targetPlayer, 1, 1),
tfm.exec.addImage (source[4].img, target, x, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[5].img, target, x+source[1].w, y+source[1].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[6].img, target, x+width-source[6].w, y+source[1].h, targetPlayer, 1, (height-source[1].h-source[7].h)/source[4].h),
tfm.exec.addImage (source[7].img, target, x, y+height-source[7].h, targetPlayer, 1, 1),
tfm.exec.addImage (source[8].img, target, x+source[7].w, y+height-source[8].h, targetPlayer, (width-source[1].w-source[3].w)/source[2].w, 1),
tfm.exec.addImage (source[9].img, target, x+width-source[9].w, y+height-source[9].h, targetPlayer, 1, 1),
}
end

eventNewPlayer = function(name)
if not data[name] then
data[name] = {
image = "answer",
type = ":1",
target = 'nil',
scaleX = '1',
scaleY = '1',
angle = 'nil',
alpha = '1',
anchorX = '0',
anchorY = '0',
inv = false,
img = "",
j = 0
}
end
for i = 37,40 do
tfm.exec.bindKeyboard(name, i, true, true)
end
nineSlicedRect(windows95window, ":1000", name, 0, 20, 800, 400)
nineSlicedRect(windows95window, ":1000", name, 350, 65, 400, 300)
nineSlicedRect(windows95window, ":1000", name, 145, 65, 200, 300)
nineSlicedRect(windows95button, ":1000", name, 355, 340, 190, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 65, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 90, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 115, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 140, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 165, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 10, 190, 130, 20)
nineSlicedRect(windows95button, ":1000", name, 630, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 655, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 680, 375, 20, 20)
nineSlicedRect(windows95button, ":1000", name, 705, 375, 20, 20)
ui.addTextArea(21, "<font color='#f'><p align='center'>↓", name, 650, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(12, "<font color='#f'><p align='center'>←", name, 575, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(13, "<font color='#f'><p align='center'>↑", name, 600, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(14, "<font color='#f'><p align='center'>→", name, 625, 375, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(15, "<font color='#f'><p align='center'><a href='event:escolherinverter'>Inverter", name, 10, 190, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(16, "<font color='#f'><p align='center'><a href='event:escolheralpha'>Transparencia", name, 10, 165, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(17, "<font color='#f'><p align='center'><a href='event:escolherangle'>Angulo", name, 10, 140, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(18, "<font color='#f'><p align='center'><a href='event:escolhertype'>Tipo", name, 10, 115, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(19, "<font color='#f'><p align='center'><a href='event:escolherscaley'>Scale Y", name, 10, 90, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(20, "<font color='#f'><p align='center'><a href='event:escolherscalex'>Scale X", name, 10, 65, 130, 20, 0xf, 0xf, 2, true)

ui.addTextArea(1, "<font color='#f'><p align='center'><a href='event:escolherimagem'>Escolher Imagem", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(3, "<font color='#f'>type: ???", name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(4, "<font color='#f'>targetPlayer: ???", name, 150, 95, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(5, "<font color='#f'>image: ???", name, 150, 105, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(6, "<font color='#f'>scaleX: ???", name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(7, "<font color='#f'>scaleY: ???", name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(8, "<font color='#f'>angle: ???", name, 150, 135, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(9, "<font color='#f'>alpha: ???", name, 150, 145, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(10, "<font color='#f'>anchorX: ???", name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(11, "<font color='#f'>anchorY: ???", name, 150, 165, nil, 20, 0xf, 0xf, 2, true)

end

eventTextAreaCallback = function(id, name, event)
if (event == "escolherimagem" and id == 1) then
ui.addPopup(1, 2, "Choose a Image.", name, 300, 150, 150, true)
elseif (event == "printarfunction" and id == 2) then
print('put in the tfm.exec.addImage: '..data[name].image..'", "'..data[name].type..'", 100, 100, '..data[name].target..', '..data[name].scaleX..', '..data[name].scaleY..', '..data[name].angle..', '..data[name].alpha..', '..data[name].anchorX..', '..data[name].anchorY)
elseif (event == "escolherscalex" and id == 20) then
ui.addPopup(2, 2, "Choose Scale X.", name, 300, 150, 150, true)
elseif (event == "escolherscaley" and id == 19) then
ui.addPopup(3, 2, "Choose Scale Y.", name, 300, 150, 150, true)
elseif (event == "escolhertype" and id == 18) then
ui.addPopup(4, 2, "Choose a Type.", name, 300, 150, 150, true)
elseif (event == "escolherangle" and id == 17) then
ui.addPopup(5, 2, "Choose a Angle.", name, 300, 150, 150, true)
elseif (event == "escolheralpha" and id == 16) then
ui.addPopup(6, 2, "Nivel de transparencia.", name, 300, 150, 150, true)
elseif (event == "escolherinverter" and id == 15) then
if (data[name].inv == true) then
if (data[name].j == 1) then
data[name].scaleX = data[name].scaleX * 1
end
data[name].inv = true
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
elseif (data[name].inv == false) then
data[name].j = 1
data[name].scaleX = data[name].scaleX * -1
print(data[name].scaleX)
data[name].inv = false
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
end
end
end

eventKeyboard = function(name, key, down, x, y)
if (key == 37) then
data[name].anchorX = data[name].anchorX +0.1
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)

elseif (key == 40) then
data[name].anchorY = data[name].anchorY -0.1
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

elseif (key == 39) then
data[name].anchorX = data[name].anchorX -0.1
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

elseif (key == 38) then
data[name].anchorY = data[name].anchorY +0.1
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

end
end

eventPopupAnswer = function(id, name, answer)
if (id == 1 and answer) then
data[name].image = answer
print(data[name].image)
img = answer
data[name].image = img
data[name].img = tfm.exec.addImage(answer, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
nineSlicedRect(windows95button, ":1000", name, 555, 340, 190, 20)
ui.addTextArea(1, "<font color='#f'><p align='center'><a href='event:escolherimagem'>Escolher Imagem", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(2, "<font color='#f'><p align='center'><a href='event:printarfunction'>Printar a função", name, 550, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(4, "<font color='#f'>targetPlayer: "..data[name].target, name, 150, 95, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(5, "<font color='#f'>image: "..answer, name, 150, 105, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(7, "<font color='#f'>scaleY: "..data[name].scaleY, name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(8, "<font color='#f'>angle: "..data[name].angle, name, 150, 135, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(9, "<font color='#f'>alpha: "..data[name].alpha, name, 150, 145, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(10, "<font color='#f'>anchorX: "..data[name].anchorX, name, 150, 155, nil, 20, 0xf, 0xf, 2, true)
ui.addTextArea(11, "<font color='#f'>anchorY: "..data[name].anchorY, name, 150, 165, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 2 and answer) then
data[name].scaleX = answer
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(6, "<font color='#f'>scaleX: "..data[name].scaleX, name, 150, 115, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 3 and answer) then
data[name].scaleY = answer
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(7, "<font color='#f'>scaleY: "..data[name].scaleY, name, 150, 125, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 4 and answer) then
data[name].type = answer
ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 5 and answer) then
data[name].angle = answer
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)
ui.addTextArea(8, "<font color='#f'>angle: "..data[name].angle, name, 150, 135, nil, 20, 0xf, 0xf, 2, true)

ui.addTextArea(3, "<font color='#f'>type: "..data[name].type, name, 150, 85, nil, 20, 0xf, 0xf, 2, true)
elseif (id == 6 and answer) then
data[name].alpha = answer
tfm.exec.removeImage(data[name].img)
data[name].img = tfm.exec.addImage(data[name].image, ":1", 510, 175, name, data[name].scaleX, data[name].scaleY, data[name].angle, data[name].alpha, data[name].anchorX, data[name].anchorY)

ui.addTextArea(9, "<font color='#f'>alpha: "..data[name].alpha, name, 150, 145, nil, 20, 0xf, 0xf, 2, true)

end
end

for all in pairs(tfm.get.room.playerList) do
eventNewPlayer(all)
end
Gamedroit
« Citoyen »
1652842620000
    • Gamedroit#3347
    • Profil
    • Derniers messages
    • Tribu
#7
  0
Ficou legal, a única coisa que peço é um ponto central na janela para poder alinhar facilmente a imagem
Devillorde
« Citoyen »
1698962400000
    • Devillorde#1090
    • Profil
    • Derniers messages
    • Tribu
#8
  0
Top de mais cara, facilita muito o teste
Sklag
« Citoyen »
1698968220000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#9
  0
Devillorde a dit :
Top de mais cara, facilita muito o teste

O Código ta mal escrito, agora que o pessoal vai usar vou atualizar essa budega kk
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Tutorial] Utílitario Image Editor
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27