Jump to content

EventHandler Priority


Bonsai

Recommended Posts

Posted

Hey Guys,

I tried to use the priority argument on "addEventHandler" to manage the order of dx stuff that is drawn "onClientRender".

It did not work, so I wonder if this is something that cannot be done this way?

Can it be done at all?

I need a way to make sure certain things are always on top of others, even things that come from different resources.

Using postGui is kinda annoying since it blocks gui elements.

Bonsai

Posted

Yeah, that's what I did.

Anyway, meanwhile I found the problem.

I was using "onClientPreRender" because I needed the delta time and this event is always triggered before "onClientRender".

Now I will probably have to change everything to "onClientPreRender".

Thanks for your reply.

Bonsai

Posted

You can write like about 3 lines of code and you'll have delta time onClientRender. Anyway, onClientPreRender isn't a bad solution either, so it's ultimately your choice which one you'll use.

Previously known as MrTasty.

Posted
You can write like about 3 lines of code and you'll have delta time onClientRender. Anyway, onClientPreRender isn't a bad solution either, so it's ultimately your choice which one you'll use.

I thought about that.

I usually prefer to use things that are already existing instead of writing something new.

I'm not sure if onClientPreRender has any disadvantage over onClientRender.

So far it seems to be working fine tho.

  • Moderators
Posted

Mta_game_proccess.png

https://wiki.multitheftauto.com/wiki/Ga ... sing_Order

As scripter you don't want to execute too much DX functions, before rendering the actually game.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

Yep, I switched to what MrTasty said and simply calculate the delta time on my own.

Using onClientRender instead of onClientPreRender also pretty much ensures, with setting a low priority, no other resource or map will draw on top of it.

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...