×

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
  • /
  • Utility Image Editor
Utility Image Editor
Sklag
« Citoyen »
1648352460000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#1
  1
  • How To Use
  • Code
Image Editor 1.1

Hello little mouse! who always tries to get the right position, let's say you're not good at math, or you don't have enough knowledge, this Script will help you as an image editor, thanks Ninguem #0095 for the function
nineSlicedRect Used in this script.

How to use?

You have several buttons to modify your image:
https://i.imgur.com/6bodkWD.png


you have where to show your image, your addImage, send the image you put, print the function
the arrows mess with the image anchor
https://i.imgur.com/fEISKtX.png
https://i.imgur.com/8d195e0.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
215
 -- 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'>Reverse", name, 10, 190, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(16, "<font color='#f'><p align='center'><a href='event:escolheralpha'>Transparency", 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'>Type", 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'>Choose a Image", 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(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'>Choose a Image", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(2, "<font color='#f'><p align='center'><a href='event:printarfunction'>Print the Function", 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'>Reverse", name, 10, 190, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(16, "<font color='#f'><p align='center'><a href='event:escolheralpha'>Transparency", 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'>Type", 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'>Choose a Image", 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(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'>Choose a Image", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(2, "<font color='#f'><p align='center'><a href='event:printarfunction'>Print the Function", 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

1.2

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'>Reverse", name, 10, 190, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(16, "<font color='#f'><p align='center'><a href='event:escolheralpha'>Transparency", 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'>Type", 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'>Choose a Image", 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'>Choose a Image", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(2, "<font color='#f'><p align='center'><a href='event:printarfunction'>Print the Function", 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 1648418040000
Hufdasr
« Citoyen »
1648403400000
    • Hufdasr#0000
    • Profil
    • Derniers messages
    • Tribu
#2
  0
good job!
Sklag
« Citoyen »
1648403520000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#3
  0
Hufdasr a dit :
good job!

thanks
Sklag
« Citoyen »
1648417920000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#4
  0
Image Editor 1.1b


Bugs fix:
Interfering with the image of another player
duplication

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'>Reverse", name, 10, 190, 130, 20, 0xf, 0xf, 2, true)
ui.addTextArea(16, "<font color='#f'><p align='center'><a href='event:escolheralpha'>Transparency", 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'>Type", 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'>Choose a Image", 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'>Choose a Image", name, 360, 340, 190, 20, 0xf, 0xf, 2, true)
ui.addTextArea(2, "<font color='#f'><p align='center'><a href='event:printarfunction'>Print the Function", 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 1648418040000
Wizardamani0
« Censeur »
1650671400000
    • Wizardamani0#6277
    • Profil
    • Derniers messages
    • Tribu
#5
  0
this is so good,man!
continue!!!
King_seniru
« Censeur »
1650789900000
    • King_seniru#5890
    • Profil
    • Derniers messages
    • Tribu
#6
  2
We living in 2022 and man really used the Windows95 theme :joy: Good job tho, I like the design!
Sklag
« Citoyen »
1650826260000
    • Sklag#2552
    • Profil
    • Derniers messages
    • Tribu
#7
  0
Wizardamani0 a dit :
this is so good,man! continue!!!

new version coming

King_seniru a dit :
We living in 2022 and man really used the Windows95 theme :joy: Good job tho, I like the design!

thanks
Laiba
« Sénateur »
1675332300000
    • Laiba#5965
    • Profil
    • Derniers messages
#8
  1
Good job!!!♡


Sklag
Grth_demon
« Citoyen »
1679360040000
    • Grth_demon#2154
    • Profil
    • Derniers messages
    • Tribu
#9
  0
No good jobs!

I got spawn 61 x x 99999999 from utility
Grth_demon
« Citoyen »
1723393980000
    • Grth_demon#5896
    • Profil
    • Derniers messages
    • Tribu
#10
  0
Grth_demon a dit :
No good jobs!

I got spawn 61 x x 99999999 from utility

._.
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Utility Image Editor
© Atelier801 2018

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

Version 1.27