Jump to content

dxDrawAnimatedCircle


.:HyPeX:.

Recommended Posts

Hello everyone, today i came across radians, sin, cos and stuff, and in a start i tried to make smth like this...

OrhnWbw.png

But in-game prototipes were awful, so keeped playing, and finished doing a function for making animated circles but with lines... (Since using circles again proved extremly laggy aswell :D)

I asked my friend MVM to record it for a clear demonstration of the animation...

PD: This is just a test script, it contains a basic loop of the function with this:

  
local start = getTickCount() 
addEventHandler("onClientRender", root, function() 
local duration = 15000 
local now = getTickCount() 
local End = start + duration 
local elapsed = now -start 
local progress = elapsed / duration 
  
if progress >= 1 then 
start = getTickCount() 
end 
  
dxDrawAnimatedCircle(progress) 
  
end) 

I had no idea what to do with this so if it is usefull, please tell me, if you want the function pm me on skype @tsbreuer

Link to comment
Interesting Script, good job.

Would always help the community to post your resource on the community site.

Been on Wiki for a year now: https://wiki.multitheftauto.com/wiki/DxDrawCircle

In a start i used that to write draw the small circles in the first prototype, proved too laggy and not so good looking, so i rewrote mine down again to skip using that function xD

Instead of updating it every frame, you could draw it in your render target and update it only when it actually changes. That would save some frames if it doesn't change very often.

How so?

  
--Deleted 

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...