﻿ Unreal Software - Thread: Extending the picture between two coordinates

# Extending the picture between two coordinates

3 replies
Goto Page
1
acm
User
Offline
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?

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:

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

Wrong topic section, moved. / GeoB99
10.06.20 02:23:35 am
cs2d_is_a_Gem
User
Offline
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
edited 2×, last 10.06.20 05:06:22 am
10.06.20 05:24:52 am
Dousea
User
Offline
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.
Code:
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.
I'm awesome ... and I really like cookies.
10.06.20 04:43:46 pm
acm
User
Offline
I found this thread guys.drawline

Thanks for your help, solved.
1
﻿