Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / SetTextAngle

Author
Message
easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 7th Feb 2014 01:21 Edited at: 7th Feb 2014 05:50
Hey Everybody,

I thought I'd share this function I just wrote for my WIP

TextAlongLine(iTextID, fX1, fY1, fX2, fY2)


My Trig isn't the best, so this function could probably be done better.

I'm sure many of you will find this useful.

btw, is the UCF project still active?
If so I'll add this there and a mod can lock/delete this post if they wish


EDIT: Whoops, it's TextAlongLine, not SetTextAngle

EDIT2: Important!!! This is made for a game where the aspect ratio of the x/y pixels is 1/1
ie. Anything done with SetVirtualResolution
If you use the other one (forget it's name , the one where the res is 100x100 no matter what ), you must change this line:
tal_dist=sqrt((x1 - x2)^2 + ((y1-y2)/1.0)^2)
Change the 1.0 to whatever your aspect ratio might be (1.5 is a good bet)

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Feb 2014 03:56
Thanks! That looks like it might be very useful at some point.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Feb 2014 05:21

Login to post a reply

Server time is: 2024-11-25 01:46:03
Your offset time is: 2024-11-25 01:46:03