Oussema Posted April 9, 2017 Share Posted April 9, 2017 (edited) When i use xmlNodeGetValue then draw it with dxdrawtext fps will be droped to <10 function dxDrawTest () local node = xmlLoadFile("Lang/english.xml") local optionsNode = xmlFindChild ( node, "category", Count ) local instructionsNode = xmlFindChild ( optionsNode, "subcategory", tableSetText ) local instructionsNodes = xmlFindChild ( instructionsNode, "content", 0 ) local instructions = xmlNodeGetValue ( instructionsNodes ) dxDrawText(instructions, 0,5, 375, 518, tocolor(255, 255, 255, 255)) end addEventHandler("onClientRender",root,dxDrawTest) Edited April 9, 2017 by Oussema 1 Link to comment
Mr.Loki Posted April 9, 2017 Share Posted April 9, 2017 Note: To prevent memory leaks, ensure each call to xmlLoadFile has a matching call to xmlUnloadFile Don't forget to unload your XML files after loading them. Also, I don't think you should be rendering XML function... bad performance. Store the data from the XML in a table or var and render that Link to comment
NeXuS™ Posted April 10, 2017 Share Posted April 10, 2017 You could just do local node = xmlLoadFile("Lang/english.xml") local optionsNode = xmlFindChild ( node, "category", Count ) local instructionsNode = xmlFindChild ( optionsNode, "subcategory", tableSetText ) local instructionsNodes = xmlFindChild ( instructionsNode, "content", 0 ) local instructions = xmlNodeGetValue ( instructionsNodes ) xmlUnloadFile(node) function dxDrawTest () dxDrawText(instructions, 0,5, 375, 518, tocolor(255, 255, 255, 255)) end addEventHandler("onClientRender",root,dxDrawTest) 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