Jump to content

dxDraw Piority


.:HyPeX:.

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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.

Posted

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.

Posted
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!

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