.:HyPeX:. Posted November 5, 2014 Share Posted November 5, 2014 Hey guys is there a way to set a piority to dxDraw? I use already the true postGui to get over a blur effect, but an image is being distorsioned by a dxRectangle wich should be underneath. Moving it on top or under within the lua makes no effect. Link to comment
rtx Posted November 5, 2014 Share Posted November 5, 2014 You have to draw what you want underneath first. dxDrawText ( "under" ) dxDrawText ( "max_pri" ) If you use post_gui this will not have any effect, unless they're both post_gui Link to comment
.:HyPeX:. Posted November 5, 2014 Author Share Posted November 5, 2014 They're both post_gui true, and i'm drawing dxDrawImage before dxDrawRectangle. Still dxDrawImage is shaded by the rectangle... i belive this is due to the fact one is dxDrawImage and the other is dxDrawImage, but there should be a way arround this.. Link to comment
Gallardo9944 Posted November 6, 2014 Share Posted November 6, 2014 You can set onClientRender priorities for that. Higher priority = under everything (executes first), lower priority - over everything (executes last). This is the way it works: local renderUnder() -- First Layer end addEventHandler("onClientRender",root,renderUnder,true,"high+5") -- "high + 5" is an optional value if you need more layers like that, you can simply use "high" without any problems. local renderMiddle() -- Second Layer end addEventHandler("onClientRender",root,renderMiddle) -- We don't change it because it has "normal" priority already. function renderOverlap() -- Third Layer end addEventHandler("onClientRender",root,renderOverlap,true,"low-5") -- The most top layer. Same as first one, -5 isn't necessary and it's used when you really need to. That's just an example. You can split them around all resources, start whenever you want, change timing when render is added, but the layers will still look as they should. Link to comment
.:HyPeX:. Posted November 6, 2014 Author Share Posted November 6, 2014 were you found this "attribute" to the onClientRender? just to know Link to comment
MTA Team botder Posted November 6, 2014 MTA Team Share Posted November 6, 2014 addEventHandler, see optional arguments. Link to comment
Gallardo9944 Posted November 7, 2014 Share Posted November 7, 2014 This is completely optional and I use it only if I have renders across resources. If it's in 1 resource, I just put things in the requested order: from the bottom to the top, as TiM3 said. Link to comment
.:HyPeX:. Posted November 8, 2014 Author Share Posted November 8, 2014 This is completely optional and I use it only if I have renders across resources. If it's in 1 resource, I just put things in the requested order: from the bottom to the top, as TiM3 said. Well that's not working so i'll try this new way. Thank you guys! 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