hlebegue's Forum Posts

  • 10 posts
  • Hello Yann,

    Has there been any new development, or syntax cleanups for this plugin ?

    This looks promising

    Hugo

  • Problem Description

    C2 Runtime loadingprogress variable corrupted as NaN on Firefox since the Gecko engine does not report

    e["loaded"] / e["total"]

    Attach a Capx

    ____ Upload a Capx to this post ____

    Description of Capx

    ____ Concise description of what this CapX does ____

    Steps to Reproduce Bug

    • Step 1
    • Step 2
    • Step 3 etc.

    Observed Result

    Loading layout Progress indicator doesn't increase, can not be used to reliably identify loading progress

    Expected Result

    Code in c2runtime, should have a special condition for firefox, as the properties e["loaded"] / e["total"] are not available

    if (typeof window.applicationCache !== "undefined")

    {

    window.applicationCache.addEventListener('updateready', function() {

    self.runtime.loadingprogress = 1;

    self.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnUpdateReady, self);

    });

    window.applicationCache.addEventListener('progress', function(e) {

    self.runtime.loadingprogress = e["loaded"] / e["total"];

    });

    }

    Affected Browsers

    • FireFox: (YES)

    Operating System and Service Pack

    PC

    Construct 2 Version ID

    2r221 and earlier

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Problem Description

    On iPad.iOS9, the call to indexedDB.open("_C2SaveStates"); creates a security exception when a C2 project is embeded in an iFrame that has different domain than its top parent container.

    In order for the IndexedDB_WriteSlot and IndexedDB_ReadSlot to properly handle the security exception and fallback from indexedDB to localStorage, the 2 functions IndexedDB_WriteSlot and IndexedDB_ReadSlot must properly handle the security exception by adding a try/catch block as below:

    function IndexedDB_WriteSlot(slot_, data_, oncomplete_, onerror_)

    {

    try{

    var request = indexedDB.open("_C2SaveStates");

    request.onupgradeneeded = makeSaveDb;

    request.onerror = onerror_;

    request.onsuccess = function (e)

    {

    var db = e.target.result;

    db.onerror = onerror_;

    var transaction = db.transaction(["saves"], "readwrite");

    var objectStore = transaction.objectStore("saves");

    var putReq = objectStore.put({"slot": slot_, "data": data_ });

    putReq.onsuccess = oncomplete_;

    };

    }catch (err){

    onerror_(err);

    }

    };

    function IndexedDB_ReadSlot(slot_, oncomplete_, onerror_)

    {

    try{

    var request = indexedDB.open("_C2SaveStates");

    request.onupgradeneeded = makeSaveDb;

    request.onerror = onerror_;

    request.onsuccess = function (e)

    {

    var db = e.target.result;

    db.onerror = onerror_;

    var transaction = db.transaction(["saves"]);

    var objectStore = transaction.objectStore("saves");

    var readReq = objectStore.get(slot_);

    readReq.onsuccess = function (e)

    {

    if (readReq.result)

    oncomplete_(readReq.result["data"]);

    else

    oncomplete_(null);

    };

    };

    }catch (err){

    onerror_(err);

    }

    };

    Attach a Capx

    ____ Upload a Capx to this post ____

    Description of Capx

    ____ Concise description of what this CapX does ____

    Steps to Reproduce Bug

      Create a frameset and publish on a.domain.com in the frameset create an iframe and point its source to C2 project on b.toolwire.com/index.html in the C2 project, create a button, and on click use system -> Save to save the game state

    Observed Result

    on iPad, at every tick, the Runtime.prototype.handleSaveLoad = function () which does not handle the security exception raised by IndexedDB_WriteSlot()

    Expected Result

    ____ What do you expect to happen? ____

    Affected Browsers

    • Chrome: (YES/NO)
    • Safari: (YES/NO)

    Operating System and Service Pack

    iPad iOS 9, android

    Construct 2 Version ID

    all versions v2.06, v2.12, v2.16

  • Problem Description

    The SetVisible action in the appearance ACES sets the visible property to 1 instead of true (or 0 instead of false) .

    this.visible = v;

    Subsequent check on visibility will fail because the value should be true/false

    This is the correct code (this.visible = (v !== 0);) in line 694 in

    c:\Program Files\Construct 2\exporters\html5\commonaces.js

    acts.SetVisible = function (v)

    {

    if (!v !== !this.visible)

    {

    this.visible = (v !== 0);

    this.runtime.redraw = true;

    }

    };

    Steps to Reproduce Bug

    • Add a video initially invisible
    • Add a button and attach the Set video to visible
    • Notice the visible property of the ACES has changed from false to 1

    Observed Result

    Visible property is set to 0 or 1

    Expected Result

    Visible property should be set to true or false

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 10

    Construct 2 Version ID

    v2.212.2

  • Hello team ,,

    Would you please consider adding the following features to the Construct2 HTML5 export

    1- save in and retrieve from the registry the location of the game was last exported. It always reset to the desktop when you reload Construct

    2- For HTML5 export, add a check-box that offers to ignore exporting images, sounds and other assets. The intent is to only rebuild the Appcache, construct2.js and data.js. This would speed up the build process when I know no changes were made to the assets of the game.

    3- Offer a command line version of the export to HTML5, so games can be built programmatically.

    Thank you for taking the time to read and your consideration.

    Hugo L

  • Have you try defining your audio sounds as music ? the API used is different (WebAudio vs HTML5 Audio )

  • I'm having the same issue here. A command line or ant task would be really useful.

  • This is a great plugin.

    Do you have a way to attach a class attribute ?

    I use the CSS_IMPORT plugin, and could define the text style externally.

    Thanks a lot

    Hugo

  • When writing a plugin, you can access the global variables like this:

    var gb_vars = cr.runtime.all_global_vars;

    var bg_value = gb_vars.getByName("variable_name");

    Array.prototype.getByName = function(name) {

    for (var i=0, len=this.length; i<len; i++) {

    if (typeof this != "object") continue;

    if (this.name === name) return this.getValue();

    }

    };

  • There are 3 small enhancements I'd like to suggest for the Video HTML5 exporter plugin.

    The first one allows to programmatically add the Controls with options: No|When Requires Touch|Always

    The second attaches a VTT file for Close Captioning

    The third one allows you to define a thumbnail, by setting the 'poster" attribute of the HTML5 Video element to a picture

    Changes are very easy. Please consider adding these 2 features in a future release of Construct2

    Hugo

    1- design time JS, add the following properties

    new cr.Property(ept_text, "Track File (*.vtt) ", "", "Standard VTT track file for the video. See "),

    new cr.Property(ept_combo, "Controls", "No", "Add controls to the video.", "No|When Requires Touch|Always"),

    new cr.Property(ept_text, "Poster File (*.png | *.gif) ", "", "Poster file used as thumbnail "),

    2- runtime.js in instanceproto.onCreate= function(){ (Add around line 220)

    if (this.video.hasAttribute("controls") && this.properties[7]==0){

    this.video.removeAttribute("controls");

    }

    if (!this.video.hasAttribute("controls") && this.properties[7]==2){

    this.video.setAttribute("controls", "true");

    }

    if (!this.video.hasAttribute("controls") && this.properties[7]==1 && this.useNextTouchWorkaround){

    this.video.setAttribute("controls", "true");

    }

    if (this.properties[6]){

    var track = document.createElement("track");

    track.src = this.properties[6];

    track.kind="subtitles";

    track.label="English subtitles"

    track.srclang="en"

    //track.default="default";

    this.video.appendChild(track);

    }

    if (this.properties[8]){

    if (this.video.hasAttribute("poster") ){

    this.video.removeAttribute("poster");

    }

    this.video.setAttribute("poster", properties[8]);

    }

  • 10 posts