Forum

> > CS2D > Scripts > Extending the picture between two coordinates
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Extending the picture between two coordinates

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

verschoben Extending the picture between two coordinates

acm
User Off Offline

Zitieren
Hello everyone,

I want to resize my image. Its 1x1, and I want to resize it as below picture. How can I do it with LUA?

IMG:https://i.ibb.co/BwhbN28/xc.jpg



Thanks for your help.

Edit: I have now noticed that I have opened the subject to the wrong place, I am very sorry.

Edit x2:
IMG:https://i.ibb.co/9hCYFxn/1.jpg

IMG:https://i.ibb.co/wzfMJcj/22.jpg



@user cs2d_is_a_Gem: I want to extend 1x1 png between these two coordinates as in the picture.
2× editiert, zuletzt 10.06.20 02:28:08

Admin/Mod Kommentar

Wrong topic section, moved. /user GeoB99

alt Re: Extending the picture between two coordinates

cs2d_is_a_Gem
User Off Offline

Zitieren
I do not understand what you want to do, if you explain a little more, I can try to do the code.

http://www.cs2d.com/help.php?luacat=image&luacmd=image

to develop it in detail you should read that link a bit, if you put an image and move it with tween_move and adjust its size with tween_scale, you can get what you want.

this also depends on the resolution of the client so you should also use mp_hudscale
2× editiert, zuletzt 10.06.20 05:06:22

alt Re: Extending the picture between two coordinates

Dousea
User Off Offline

Zitieren
I've forgotten how CS2D transformation system works. I'm assuming angle 0/360 is at 12 o'clock and the scaling origin is at the center of the image.
1
2
3
4
local rot = math.deg(math.atan2(y2-y1, x2-x1)+math.pi*0.5)
local dist = math.sqrt((x1-x2)^2 + (y1-y2)^2)
imagepos(yourimg, (x1+x2)*0.5, (y1+y2)*0.5, rot)
imagescale(yourimg, 1, dist)
Or something like that.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht