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

  • MTA Team
Posted

And did you do it correctly?

"high" will be drawn frist (bottom)

"normal" will be drawn as next

"low" will be drawn as last (top)

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.

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.

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