redditing Posted October 27, 2020 Share Posted October 27, 2020 How to set dxDraw to the back of the screen? Link to comment
Scripting Moderators xLive Posted October 28, 2020 Scripting Moderators Share Posted October 28, 2020 What do you mean by "the back of the screen"? Link to comment
redditing Posted October 28, 2020 Author Share Posted October 28, 2020 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 IIYAMA Posted October 28, 2020 Moderators Share Posted October 28, 2020 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. 1 Link to comment
redditing Posted October 28, 2020 Author Share Posted October 28, 2020 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! 1 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