function loadGUIs(){OS.AddScript("gui/titleScreen.js"),OS.AddScript("gui/inventoryGUI.js"),OS.AddScript("gui/mapGUI.js"),OS.AddScript("gui/tradeGUI.js")}var guiControl={topOfBackground:pixel(4),upperBorder:pixel(15),lowerBorder:pixel(5),leftBorder:pixel(12),rightBorder:pixel(7),iconSize:8,iconScaled:pixel(8),iconPosition:function(e){return guiControl.iconScaled*e},rowTop:function(e){return guiControl.upperBorder+pixel((guiControl.iconSize+2)*e)},drawIcon:function(e,a,r,o){OS.context.drawImage(guiControl.icons,guiControl.iconPosition(e),guiControl.iconPosition(a),guiControl.iconScaled,guiControl.iconScaled,r,o,guiControl.iconScaled,guiControl.iconScaled)},drawItem:function(e,a,r){var o=e%4,i=Math.floor(e/4);OS.context.drawImage(guiControl.itemSheet,guiControl.iconPosition(o),guiControl.iconPosition(i),guiControl.iconScaled,guiControl.iconScaled,a,r,guiControl.iconScaled,guiControl.iconScaled)},drawCursor:function(e,a){OS.context.drawImage(guiControl.cursor,e,a)},drawPageArrow:function(e,a,r){OS.context.drawImage(guiControl.arrows,"left"==e?0:pixel(4),0,pixel(4),pixel(7),a,r,pixel(4),pixel(7))}};guiControl.titleImage=new Image,guiControl.titleImage.src="images/title.png",guiControl.background=new Image,guiControl.background.src="images/guiBackground.png",guiControl.cursor=new Image,guiControl.cursor.src="images/guiCursor.png",guiControl.arrows=new Image,guiControl.arrows.src="images/arrows.png",guiControl.alpha_black4=new Image,guiControl.alpha_black4.src="images/alphabet_black_4px.png",guiControl.alpha_white4=new Image,guiControl.alpha_white4.src="images/alphabet_white_4px.png",guiControl.alpha_yellow4=new Image,guiControl.alpha_yellow4.src="images/alphabet_yellow_4px.png",guiControl.alpha_black6=new Image,guiControl.alpha_black6.src="images/alphabet_black_6px.png",guiControl.alpha_white6=new Image,guiControl.alpha_white6.src="images/alphabet_white_6px.png",guiControl.alpha_yellow6=new Image,guiControl.alpha_yellow6.src="images/alphabet_yellow_6px.png",guiControl.itemSheet=new Image,guiControl.itemSheet.src="images/items_sheet.png",guiControl.icons=new Image,guiControl.icons.src="images/icons_sheet.png",guiControl.drawPixelText=function(e,a,r,o,i,n){e=e.toString().toUpperCase();var t=pixel(6==n?n-1:n),l=pixel(n),c=Math.floor(OS.camera.width/(t+pixel(1)));o=0>=o||o>c?c:o;var g=guiControl["alpha_"+i+n.toString()],s=e.split(" ");if(s.length>1){for(var u=0,p="",b=[".",",","-","?","!"],h=0;hC;C++)p+=" ";u=p.length,h--}e=p}for(var d=0;d