Jump to content

DxDraw back or front problem


redditing

Recommended Posts

2 hours ago, xLive said:

What do you mean by "the back of the screen"?

imagine that you have two drawn dxdraws, and they overlap, only one of them is on the front and is all visible but covers the back part of the other dxdraw 
so my question is how to make dxdraw the first to the back and the second to the front of the screen
Link to comment
  • Moderators
14 minutes ago, redditing said:

so my question

Please use normal text format, it makes it hard to

Spoiler

read...

 


 

dxDraw functions are like paint, the last colour you put on the canvas will be visible.

 

Which means that it is all about timing, this can be adjusted by changing the addEventHandler priority.

https://wiki.multitheftauto.com/wiki/AddEventHandler

removedEventHandler > addEventHandler

 

addEventHandler( "onClientRender", root, function () end, false, "high" ) -- first layer of paint = back
addEventHandler( "onClientRender", root, function () end, false, "normal" ) -- normal = middle
addEventHandler( "onClientRender", root, function () end, false, "low" ) -- last layer of paint = top

addEventHandler( "onClientRender", root, function () end, false, "low-1" ) -- last layer of paint = top top
addEventHandler( "onClientRender", root, function () end, false, "low-2" ) -- last layer of paint = top top top

 


 

An alternative is looping through a table and changing the item order.

 

 

 

 

  • Like 1
Link to comment
17 minutes ago, IIYAMA said:

Please use normal text format, it makes it hard to

  Reveal hidden contents

read...

 


 

dxDraw functions are like paint, the last colour you put on the canvas will be visible.

 

Which means that it is all about timing, this can be adjusted by changing the addEventHandler priority.

https://wiki.multitheftauto.com/wiki/AddEventHandler

removedEventHandler > addEventHandler

 


addEventHandler( "onClientRender", root, function () end, false, "high" ) -- first layer of paint = back
addEventHandler( "onClientRender", root, function () end, false, "normal" ) -- normal = middle
addEventHandler( "onClientRender", root, function () end, false, "low" ) -- last layer of paint = top

addEventHandler( "onClientRender", root, function () end, false, "low-1" ) -- last layer of paint = top top
addEventHandler( "onClientRender", root, function () end, false, "low-2" ) -- last layer of paint = top top top

 


 

An alternative is looping through a table and changing the item order.

 

 

 

 

Forgive me for that font, I was just typing on my phone and the font was always changing on my phone, but thanks to you I was able to fix it, Thanks!

  • Like 1
Link to comment

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