Jump to content

rectangle jump line


Fabioxps

Recommended Posts

Posted

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

Posted
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?

Posted (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 by Fabioxps
Posted
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.

  • Thanks 1
Posted
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

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