Advertisement
Guest User

GUI code

a guest
Mar 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1.  
  2.  
  3. if(global.system[? "max-stamina"] < 100)
  4. {
  5. global.system[? "max-stamina"] = 100;
  6. }
  7.  
  8. var timeString = string(global.system[? "hour"]) + ":" + string(global.system[? "minute"]);
  9.  
  10.  
  11.  
  12.  
  13. ///Draw the hud back
  14. draw_sprite_ext(sprSunIcon, timeIcon(), (960-(128*global.scale)), 16, global.scale, global.scale, obj_control.iconRot, c_white, 1);
  15.  
  16. if(global.weather == "Rainy")
  17. draw_sprite_ext(sprRainIcon, -1, (960-(128*global.scale)), 16, global.scale, global.scale, 0, c_white, 1);
  18. draw_set_colour(c_white);
  19. draw_sprite_ext(sprHUDBack, 0, (960-(128*global.scale)), 0, global.scale, global.scale, 0, c_white, 1);
  20.  
  21.  
  22. draw_set_colour(c_black);
  23. draw_text_ext_transformed(((960-(128*global.scale)))+14, 10, timeString, 16, -1, global.scale, global.scale, 0);
  24. draw_text_ext_transformed((960 -(128*global.scale)) + 14, (24 * global.scale)+2, global.held, 16, -1, global.scale, global.scale, 0);
  25. draw_set_halign(fa_right);
  26. draw_text_ext_transformed(956, 10, "$: " + string(global.system[? "money"]), 16, -1, global.scale, global.scale, 0);
  27. draw_set_halign(fa_left);
  28.  
  29.  
  30. draw_set_colour(c_white);
  31. draw_text_ext_transformed(((960-(128*global.scale)))+12, 8, timeString, 16, -1, global.scale, global.scale, 0);
  32. draw_text_ext_transformed((960 -(128*global.scale)) + 12, (24 * global.scale), global.held, 16, -1, global.scale, global.scale, 0);
  33. draw_set_halign(fa_right);
  34. draw_text_ext_transformed(954, 8, "$: " + string(global.system[? "money"]), 16, -1, global.scale, global.scale, 0);
  35. draw_set_halign(fa_left);
  36.  
  37.  
  38.  
  39. draw_set_alpha(global.hudAlph);
  40. draw_sprite_ext(sprHotbar, 0, 480, 540, global.scale, global.scale, 0, c_white, global.hudAlph);
  41. //draw the items in the hot bar list
  42. var hotList = ds_list_create();
  43. var hotItemList = ds_list_create();
  44. for(var i = 0; i <= 9; i++)
  45. {
  46. hotList[| i] = itemSprite(global.inv[? "inventory-"+string(i)+"-item"]);
  47. hotItemList[| i] = global.inv[? "inventory-"+string(i)+"-amount"];
  48. }
  49.  
  50. switch(global.scale)
  51. {
  52. case 2:
  53. {
  54. var fourtyX = 44;
  55. }
  56.  
  57. case 3:
  58. {
  59. var fourtyX = 66;
  60. }
  61. }
  62.  
  63. if(global.scale == 3)
  64. {
  65.  
  66. draw_sprite_ext(sprHeld, 0, 0, sprite_get_height(sprBarBack)*global.scale, global.scale, global.scale, 0, c_white, global.hudAlph);
  67. draw_sprite_ext(itemSprite(global.inv[? "inventory-"+string(global.system[? "invSel"])+"-item"]), 0, 36, (sprite_get_height(sprBarBack)*global.scale) + 24, global.scale, global.scale, 0, c_white, global.hudAlph);
  68.  
  69. for(var j = 0; j <= 9; j++)
  70. {
  71. draw_sprite_ext(hotList[| j], 0, ((fourtyX+2)+((480 -(144 * global.scale)) + fourtyX))+(j*fourtyX), 540 - (16*global.scale), global.scale, global.scale, 0, c_white, global.hudAlph);
  72. }
  73.  
  74.  
  75. draw_sprite_ext(sprHotbarSel, real(global.system[? "invSel"]), 480, 540, global.scale, global.scale, 0, c_white, global.hudAlph);
  76.  
  77. for(var z = 0; z <= 9; z++)
  78. {
  79. draw_set_font(obj_control.invFont);
  80. draw_set_halign(fa_center);
  81. if(hotItemList[| z] > 0)
  82. {
  83.  
  84. drawTextOutlined(hotItemList[| z], round(((fourtyX+2)+((480 -(144 * global.scale)) + fourtyX))+(z*fourtyX)), round(540 - 16), c_white, c_black)
  85. }
  86. draw_set_halign(fa_left);
  87. }
  88. }
  89. else
  90. {
  91. draw_sprite_ext(sprHeld, 0, 0, sprite_get_height(sprBarBack)*global.scale, global.scale, global.scale, 0, c_white, global.hudAlph);
  92. draw_sprite_ext(itemSprite(global.inv[? "inventory-"+string(global.system[? "invSel"])+"-item"]), 0, 24, (sprite_get_height(sprBarBack)*global.scale) + 24, global.scale, global.scale, 0, c_white, global.hudAlph);
  93.  
  94. for(var j = 0; j <= 9; j++)
  95. {
  96. draw_sprite_ext(hotList[| j], 0, (((480 -(114 * global.scale))) + (j*fourtyX))+30, 540 - (16*global.scale), global.scale, global.scale, 0, c_white, global.hudAlph);
  97. }
  98.  
  99.  
  100. draw_sprite_ext(sprHotbarSel, real(global.system[? "invSel"]), 480, 540, global.scale, global.scale, 0, c_white, global.hudAlph);
  101.  
  102. for(var z = 0; z <= 9; z++)
  103. {
  104. draw_set_font(obj_control.invFont);
  105. draw_set_halign(fa_center);
  106. if(hotItemList[| z] > 0)
  107. {
  108.  
  109. drawTextOutlined(hotItemList[| z], (((480 -(114 * global.scale))) + (z*fourtyX))+30, 540 - 16, c_white, c_black)
  110. }
  111. draw_set_halign(fa_left);
  112. }
  113. }
  114. draw_set_alpha(1);
  115. /*
  116.  
  117. width = (Current Health / Max Health) * Max Size of Bar
  118.  
  119. draw_text(960 - 200,hy+42,string_hash_to_newline("$:"));
  120. draw_set_halign(fa_right);
  121. draw_text(956,hy+42,string_hash_to_newline(string(global.system[? "money"])));
  122. draw_set_halign(fa_left);
  123. draw_text(hx+6,hy+8,string_hash_to_newline(global.held));
  124. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement