Advertisement
Guest User

Untitled

a guest
Nov 11th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. // Draw Inventory
  2. for (var yy = 0; yy < height; yy++){ // Draw boxes top to bottom
  3. for (var xx = 0; xx < width; xx++){ // Draw boxes left to right
  4. var tx = x + 64 + (xx*box_size); // box x position on screen
  5. var ty = y + 64 + (yy*box_size); // box y position on screen
  6. var cur = (yy*width) + xx + 1; //the current item (y)
  7. show_debug_message(string(cur));
  8. draw_sprite(spr_items, 0, tx, ty); //draw Inventory background
  9. if (cur < item.length){
  10. if (item_index[cur,itemProperty.amount] > 0){ //does the player have any of this item?
  11.  
  12. draw_sprite(spr_items, item_index[cur,itemProperty.sprite], tx, ty); //draw Inventory items
  13. if (item_index[cur,itemProperty.amount] > 0){ // draw item stack numbers
  14. //draw_circle_color(tx, ty-2, 6, c_white, c_white, false);
  15. draw_set_font(fnt_Small3);
  16. draw_text(tx+2, ty+2, item_index[cur,itemProperty.amount]);
  17. }
  18. }
  19. //var _grid = string(item_index);
  20. ds_grid_sort(real(item_index), itemProperty.indexNum, true); // how does this work?! Must use 'item_index'
  21. //ds_grid_sort(item_index,itemProperty.indexNum, true);
  22. }
  23. draw_sprite(spr_itemSelect, 0, (x + 64 + (gx*box_size)),y + 64 + (gy*box_size)); // draw item hover
  24.  
  25. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement