_Marco_ Posted October 8, 2020 Share Posted October 8, 2020 Hi, how can I make rows and columns like the picture below? https://www.linkpicture.com/view.php?img=LPic5f7f31bfb0fc3841759827 Link to comment
Moderators Patrick Posted October 8, 2020 Moderators Share Posted October 8, 2020 (edited) -- LAYOUT local cells = 30 local cells_in_a_row = 6 -- CELL SIZE local cell_size = 30 local cell_gap = 5 -- LEFT-TOP corner position local start_x, start_y = 500, 500 addEventHandler("onClientRender", root, function() -- use loop to draw 30 cells for i = 0, cells-1 do -- calculate cell index in row. ("i % cells_in_a_row" returns a number between 0 and 5) (modulo) local nth_cell = i % cells_in_a_row -- calculate row index local nth_row = math.floor(i / cells_in_a_row) -- cell position local x, y = start_x + (cell_size+cell_gap)*nth_cell, start_y + (cell_size+cell_gap)*nth_row -- draw cell background and text dxDrawRectangle(x, y, cell_size, cell_size) dxDrawText(i, x, y, x+cell_size, y+cell_size, 0xff000000, 1, "default", "center", "center") end end) Edited October 8, 2020 by Patrick 1 Link to comment
_Marco_ Posted October 10, 2020 Author Share Posted October 10, 2020 Ty Is it possible to do something that will be transferred to the second slot if the first slot is full? Example If the first slot has an item, the next item will be in the second slot Link to comment
Tekken Posted October 11, 2020 Share Posted October 11, 2020 You want to have images in the cells ? Take a look here: Link to comment
_Marco_ Posted October 14, 2020 Author Share Posted October 14, 2020 I want it to be in the slots with the above method. Link to comment
Tekken Posted October 14, 2020 Share Posted October 14, 2020 you want the same item to be divided in 2 or more separate slots? Link to comment
_Marco_ Posted October 15, 2020 Author Share Posted October 15, 2020 I want when one item is placed in slot 1 the next item in slot 2 Slot tables are made according to the above method 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