The different purposes and what they are used for are described below. This tells Construct what you want to use the icon or image for. The most important property is the Purpose property. When you select an icon in the Project Bar, the Properties Bar updates to show properties for that icon. The specific images used depend on the platform you export to, but where possible Construct will automatically use the images in the Icons folder where appropriate. Update (Apr 2017): a more configurable version of this extension is now available.The Icons folder in the Project Bar holds a set of image files that are used as icons or splash screens for your project. If the above steps were done correctly, the extension' function will now show up in the list in Global Game Settings tab and you'll be able to proceed with it as usual.Īs usual, the post ends with a link to example in question: Set the name and external name to "ImageLoadBar_hook", set it to have 6 arguments (type does not matter) and make sure that "use variable arguments" checkbox is not checked. Right-click the newly added JS file and pick "add function". Right-click your new extension, pick "add file", and pick the JS file provided (containing the earlier shown function). If you cannot import the extension for some reason, it can also be "remade" in a few steps:Ĭreate a new extension by right-clicking "extensions" folder in the IDE and picking "Create new extension". This is done by changing the JS file in /extensions/ImgLoadBar. (optional) Change the parameters to suit your game better. If all above steps were done, the game will now display the newly-obtained loading bar. In this case the extension draws the image "as is" (without scaling) so you may need to experiment a little. Update the "splash screen" to your desired image. Make sure that "use splash screen" checkbox is "checked" (it determines whether the splash image will be sent to the loading bar extension or not). Set the "loading bar extension" to the newly introduced function. There are a couple of things worth attention here: Setup the loading bar via the "HTML5" tab of global game settings: extension.gmx file from the project' directory onto GameMaker: Studio window with your project open. The easiest way to go about this is to simply drag the. Import the attached GMZ into GameMaker: Studio.Īlternatively, if you have 7-zip installed, you can "unpack" the GMZ file somewhere using it.Īdd the "ImgLoadBar" extension to your project. fillRect (barInnerLeft, barInnerTop, barLoadedWidth, barInnerHeight ) Īs you can see, it's all about drawing a bunch of rectangles, an image, and having descriptive variable names so that the end user (you) can customize colors and other things easily. round (barInnerWidth * current / total ) Ĭtx. bar foreground: var barLoadedWidth = Math. fillRect (barInnerLeft, barInnerTop, barInnerWidth, barInnerHeight ) Var barInnerHeight = barHeight - barBorderWidth * 2 Ĭtx. Var barInnerWidth = barWidth - barBorderWidth * 2 Var barInnerTop = barTop + barBorderWidth var barInnerLeft = barLeft + barBorderWidth fillRect (barLeft, barTop, barWidth, barHeight ) bar border: var barLeft = (width - barWidth ) > 1 Ĭtx. JavaScript extension code in this case looks like this:įunction ImageLoadBar_hook (ctx, width, height, total, current, image ) else barTop = (height - barHeight ) > 1 It's not uncommon to wish to display a company/game logo along with the loading bar in games.Īlas, the default loading bar either displays the bar, or the image, which can be slightly inconvenient.īut, fortunately, loading bar extensions for GameMaker: Studio are easy enough to make, so with a bit of JavaScript and patience you can have pretty much any kind of loading bar. Someone on forums has asked if there's an example/extension that would allow to display a logo or image alongside with the loading bar in HTML5 module of GameMaker: Studio, and I did just that.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |