Forum




Scaling Image
5 replies




Please write here what you want to.

I pressed the attack button on tile x 16 and y 15.
So, you said there about mouse position at screen?
soo..., you want to create a resizable image by mouse?
edited 3×, last 05.06.14 02:16:53 pm


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
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
function Array(m,v) local array = {} for i = 1, m do array[i]=v end return array end img = Array(32,0) X = Array(32,0) Y = Array(32,0) key = Array(32,false) addhook("attack","attack") function attack(id) if key[id] then 	key[id] = false else 	reqcld(id,2) 	key[id] = true end end addhook('clientdata','request') function request(id,m,x,y) if m == 2 then 			if not key[id] then 				img[id] = image("gfx/block.bmp",0,0,0) 				imagepos(img[id],x,y,0) 				X[id] = x 				Y[id] = y 			else 				imagepos(img[id], X[id]+(x-X[id])/2, Y[id]+(y-Y[id])/2,0) 				imagescale(img[id], math.abs(X[id]-x)/32, math.abs(Y[id]-y)/32) 			end end end addhook("always","always") function always() for id = 1,32 do 	if player(id,"exists") then 		if key[id] then 			reqcld(id,2) 		end 	end end end



