Bonsai Posted January 4, 2016 Share Posted January 4, 2016 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 Link to comment
MTA Team botder Posted January 4, 2016 MTA Team Share Posted January 4, 2016 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) Link to comment
Bonsai Posted January 4, 2016 Author Share Posted January 4, 2016 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 Link to comment
Addlibs Posted January 4, 2016 Share Posted January 4, 2016 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. Link to comment
Bonsai Posted January 4, 2016 Author Share Posted January 4, 2016 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. Link to comment
Moderators IIYAMA Posted January 4, 2016 Moderators Share Posted January 4, 2016 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. Link to comment
Bonsai Posted January 5, 2016 Author Share Posted January 5, 2016 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. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now