Fabioxps Posted March 31, 2020 Share Posted March 31, 2020 I am making an inventory each line of this inventory has 6 rectangles how can I make a function to detect every 6 rectangles skip a line and draw the next 6 below Link to comment
The_GTA Posted March 31, 2020 Share Posted March 31, 2020 13 minutes ago, Fabioxps said: I am making an inventory each line of this inventory has 6 rectangles how can I make a function to detect every 6 rectangles skip a line and draw the next 6 below Hello Fabioxps, what have you coded so far? Can you share it with us? Link to comment
Fabioxps Posted March 31, 2020 Author Share Posted March 31, 2020 (edited) sorry for my bad English I am Brazilian come on. local tabela = { [1], [2], [3], [4], [5], [6], [7] } for i=1 #tabela do dxDrawRectangle() end each 6 items in the table the next ones will be created in a new line Edited March 31, 2020 by Fabioxps Link to comment
The_GTA Posted March 31, 2020 Share Posted March 31, 2020 51 minutes ago, Fabioxps said: sorry for my bad English I am Brazilian come on. local tabela = { [1], [2], [3], [4], [5], [6], [7] } for i=1 #tabela do dxDrawRectangle() end each 6 items in the table the next ones will be created in a new line Np, here is an idea: local row = math.floor(i / 6); local column = ( i % 6 ); Then you can multiply row with pixel height, column with pixel width of rectangle. 1 Link to comment
Fabioxps Posted March 31, 2020 Author Share Posted March 31, 2020 1 hour ago, The_GTA said: Np, aqui está uma ideia: Então você pode multiplicar a linha com a altura do pixel, a coluna com a largura do pixel do retângulo. thank you and it's an honor for me to have you here 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