Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Latest commit

 

History

History
50 lines (39 loc) · 2.62 KB

README.md

File metadata and controls

50 lines (39 loc) · 2.62 KB

:octocat: Node Downloader

In the name of God, the Beneficent the Merciful.

Node Downloader is a plugin for Construct 2 game engine that allows you to download a file from a URL and save it in the player's PC.

❗ Node Downloader only works with NW.js (and Electron).

Download

Download this plugin and sample (.capx) files.

Or if you don't want the sample (.capx) files, download only .c2addon file from here.

Actions

Actions

Start download a file

Starts download a file.

Parameter Explanation
Tag An optional name to distinguish between downloads
URL URL of file that is to be downloaded
Path Location that downloaded file will be saved to it

start download

Conditions

events

On completed

This event occurs once while the file downloaded and saved on the disk.


On error

If the file couldn't be downloaded for any reason this event will trigger and the reason of error logs in to the console.


On progress

Each file should be fragmented for downloading. After each slice of the file received, this event triggers and Percent expression will be accessible.

Expressions

expressions

Percent

Get the progress of downloading, from 0 to 100. This expression will be updated when a slice of the file received. So use it only in On progress event.


TotalSize(tag)

Get the total size of the file, in bytes. This expression is only accessible when downloading is in progress. So you can use it in On progress or On completed events. After that, it returns -1.

To do

  • Compatibility with google closure compiler.
  • Adding more ACEs.
Credits
Plugin icon made by Freepik from www.flaticon.com is licensed by CC BY 3.0