Muurlio_ Posted January 17, 2023 Share Posted January 17, 2023 Does anyone know why the text is appearing this way and not where I request it? (next to the image) this is my current code followed by the print of the problem. function dxInv() local dados = getElementData(localPlayer, 'inv.item') or {} local x = 0.4047 local tx = 0.4273 local ty = 0.3945 local y = 0.3919 for i,v in ipairs(dados) do dxDrawImage(screenW * x, screenH * y, screenW * 0.0484, screenH * 0.0755, item[(v.id)].img, 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawText("("..(v.qnt)..")", screenW * tx, screenH * ty, screenW * 0.4516, screenH * 0.4141, tocolor(255, 255, 255, 255), 1.00, "default", "right", "top", false, false, true, false, false) x = x + 0.0515 tx = tx + 0.0515 if x > 0.6009 then y = y + 0.0808 x = 0.4047 tx = 0.4273 ty = ty + 0.0808 end end end Link to comment
Trust aka Tiffergan Posted January 18, 2023 Share Posted January 18, 2023 It's hard to say without more information about the problem. Some things you might want to check are: Make sure that the dxDrawText function is being called after the dxDrawImage function so that the text is drawn on top of the image. Verify that the tx and ty variables are being set to the correct screen coordinates before the dxDrawText call. Check the item table in the dxDrawImage call to ensure that it contains the correct image file path. Make sure that the item table is defined and containing expected values. Verify that the screenW and screenH variables are set to the correct values for the current window size. Check the output of getElementData(localPlayer, 'inv.item') or {} to ensure that it returns the expected data. Make sure that the dxDrawText function is receiving the correct arguments and that they are in the correct order. Check if there is any error message in the console. It may be helpful to add some debugging output or print statements to help you see what's happening at each step. 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