Ashley's Forum Posts

  • Nothing else in Construct uses this, so there is not currently any mechanism for it. Further it's complicated because to balance memory usage and rendering performance, the sprite image data is either in storage in compressed format (therefore requiring loading and decompressing to access the image data), or uploaded to the GPU as a WebGL texture (where it can only be rendered, or if you are willing to kill GPU performance, read back to the CPU, in which case it will have also gone through a lossy alpha premultiplication). So I have to ask what do you need to use this for, and is it really the best/only way to do that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's just an oversight. I've added it to the todo list.

  • I just updated the WebGLRenderer docs to cover new methods CreateDynamicTexture(), UpdateTexture() and DeleteTexture(). These should be enough to implement the approach I outlined above. If not let me know and I can look in to covering more of the API surface. These methods should already be supported in the runtime, but note if you want to use them in the editor they won't be supported until the next release.

  • It seems to work for me. As usual if you think there is a bug please file an issue following all the guidelines; we need all that information to be able to help.

  • Updated the original post with new downloads based on Chrome 76 (NW.js 0.40.1). This should have a fix for a crash issue involving popup windows.

  • I think the best approach would be to use the same approach as the Text plugin, which similarly renders via a canvas. The steps are roughly:

    1. Draw content to a 2D canvas (text for the Text plugin, or in your case a Spine rendering)
    2. Create a new empty texture managed by the plugin
    3. Whenever the canvas size changes, destroy the texture and create a new one to match the new size
    4. Whenever the canvas content changes, upload it to the texture
    5. Finally draw the texture normally with a quad

    The key points are the texture is owned and managed by the plugin itself, so it's not trying to overwrite existing content used by other parts of the engine; it uses a direct WebGL texture upload so there's no unnecessary compress/decompress cycle; and there is support in the engine for this approach already (as Text uses it already). I also must point out that you cannot safely mix raw WebGL calls and Construct renderer calls, as Construct's renderer queues WebGL commands using a batching system (meaning WebGL calls will happen in an unexpected order) and heavily relies on caching and ignoring redundant changes (and changing WebGL state outside of the renderer with calls like bindTexture will corrupt the internal state of the renderer and probably break the game). This is why there is no documented/supported way to get the WebGL context directly - it's for good reason! I've added to my todo list to document the necessary renderer calls to support that approach.

  • Have you got objects correctly placed in your layouts? The way memory management works is it expects all objects that will be used on a layout to be placed on that layout in the editor. Then if you don't want them to be used on startup, add an event to destroy them on start of layout. This informs both the way objects are grouped on to spritesheets, and which objects are loaded in to memory at runtime when switching layouts.

    Also if you switch the spritesheet size down to 512, then even if that same problem happens, it's only 1/4 as bad.

  • No. It's only greyed out if you use script anywhere in the project. If you use only events, it's still enabled.

  • It tells you in the export dialog why:

    NOTE: this is not yet supported for projects that use JavaScript code.

    It's on the todo list to add support for that.

  • It should be possible if you use the Game Recorder object to record User Media.

  • That doesn't make any sense... reducing the spritesheet size increases memory management granularity ensuring it can avoid loading content it doesn't need. But yes, it can decrease performance as many more texture swaps are necessary. If this is what you get from reducing the spritesheet size, then the logical conclusion of that is that if spritesheets were disabled completely (effectively a spritesheet size of 0), then memory use will increase further (although this makes no sense...) and performance will reduce further. So that doesn't seem to solve the stated problem.

  • 50 translation problems were recently introduced to the Polish translation. These are listed below and will need to be fixed before the in-progress translation in Construct 3 can be updated again. Please see the translation guidelines to ensure your translations are correct.

    Key text.ui.editors.event-sheet-view.errors.invalid-else.message: BBcode tag [b] occurs 3 times in English but 0 times in translation
    English: Oops! There is a mistake in your events. It must be fixed before you preview or export the project.
    
    [b]{0}[/b], number [b]{1}[/b]: An [b]Else[/b] condition cannot be placed here. Make sure the event follows a non-triggered event, and is the first condition.
    Translation: Ups! Wygląda na to, że najpierw musisz poprawić pomyłkę w swoich wydarzeniach:
    
    Arkusz wydarzeń: {0}
    Numer: {1}
    Problem: Warunek 'Inaczej' nie może się tutaj znajdować. Upewnij się, że to wydarzenie występuje jako pierwsze po wydarzeniu bez wyzwalacza.
    
    Key text.ui.editors.event-sheet-view.errors.invalid-else.message: BBcode tag [/b] occurs 3 times in English but 0 times in translation
    English: Oops! There is a mistake in your events. It must be fixed before you preview or export the project.
    
    [b]{0}[/b], number [b]{1}[/b]: An [b]Else[/b] condition cannot be placed here. Make sure the event follows a non-triggered event, and is the first condition.
    Translation: Ups! Wygląda na to, że najpierw musisz poprawić pomyłkę w swoich wydarzeniach:
    
    Arkusz wydarzeń: {0}
    Numer: {1}
    Problem: Warunek 'Inaczej' nie może się tutaj znajdować. Upewnij się, że to wydarzenie występuje jako pierwsze po wydarzeniu bez wyzwalacza.
    
    Key text.ui.dialogs.kongregateExportReport.developer-docs-link: BBcode tag [a1] occurs 1 times in English but 0 times in translation
    English: Check out Kongregate's documentation on [a1]Uploading games[/a1]
    Translation: Dokumentacja deweloperów Kongregate
    
    Key text.ui.dialogs.kongregateExportReport.developer-docs-link: BBcode tag [/a1] occurs 1 times in English but 0 times in translation
    English: Check out Kongregate's documentation on [a1]Uploading games[/a1]
    Translation: Dokumentacja deweloperów Kongregate
    
    Key text.exporters.cordova.android.description: BBcode tag [a1] occurs 1 times in English but 0 times in translation
    English: Publish Android apps via Cordova. [a1]Learn more[/a1]
    Translation: Publikuj aplikacje na Androida przez Cordova.
    
    Key text.exporters.cordova.android.description: BBcode tag [/a1] occurs 1 times in English but 0 times in translation
    English: Publish Android apps via Cordova. [a1]Learn more[/a1]
    Translation: Publikuj aplikacje na Androida przez Cordova.
    
    Key text.exporters.cordova.ios.description: BBcode tag [a1] occurs 1 times in English but 0 times in translation
    English: Publish iOS apps via Cordova. [a1]Learn more[/a1]
    Translation: Upublikuj iOS aplikacje przez Cordova.
    
    Key text.exporters.cordova.ios.description: BBcode tag [/a1] occurs 1 times in English but 0 times in translation
    English: Publish iOS apps via Cordova. [a1]Learn more[/a1]
    Translation: Upublikuj iOS aplikacje przez Cordova.
    
    Key text.exporters.html5.description: BBcode tag [a1] occurs 1 times in English but 0 times in translation
    English: Publish to the web to be run in a browser. [a1]Learn more[/a1]
    Translation: Opublikuj w Internecie, aby działał w przeglądarce.
    
    Key text.exporters.html5.description: BBcode tag [/a1] occurs 1 times in English but 0 times in translation
    English: Publish to the web to be run in a browser. [a1]Learn more[/a1]
    Translation: Opublikuj w Internecie, aby działał w przeglądarce.
    
    Key text.exporters.nwjs.description: BBcode tag [a1] occurs 1 times in English but 0 times in translation
    English: Publish Windows, MacOS and Linux desktop apps via NW.js. [a1]Learn more[/a1]
    Translation: Opublikuj aplikacje pulpitu Windows, MacOS i Linux za pośrednictwem NW.js.
    
    Key text.exporters.nwjs.description: BBcode tag [/a1] occurs 1 times in English but 0 times in translation
    English: Publish Windows, MacOS and Linux desktop apps via NW.js. [a1]Learn more[/a1]
    Translation: Opublikuj aplikacje pulpitu Windows, MacOS i Linux za pośrednictwem NW.js.
    
    Key text.exporters.preview.debugger.system.performance.image-mem-value: placeholder {0} in English string but missing in translation
    English: {0} mb
    Translation: MB
    
    Key text.exporters.windows-uwp.description: BBcode tag [a1] occurs 1 times in English but 0 times in translation
    English: Publish to the Windows Store and Xbox One with a UWP app. [a1]Learn more[/a1]
    Translation: Upublicznij do Windows Store, oraz Xbox One przez aplikację UWP.
    
    Key text.exporters.windows-uwp.description: BBcode tag [/a1] occurs 1 times in English but 0 times in translation
    English: Publish to the Windows Store and Xbox One with a UWP app. [a1]Learn more[/a1]
    Translation: Upublicznij do Windows Store, oraz Xbox One przez aplikację UWP.
    
    Key text.plugins.arr.actions.clear.display-text: placeholder {0} in English string but missing in translation
    English: Clear to [i]{0}[/i]
    Translation: Wyczyść
    
    Key text.plugins.arr.actions.clear.display-text: BBcode tag [i] occurs 1 times in English but 0 times in translation
    English: Clear to [i]{0}[/i]
    Translation: Wyczyść
    
    Key text.plugins.arr.actions.clear.display-text: BBcode tag [/i] occurs 1 times in English but 0 times in translation
    English: Clear to [i]{0}[/i]
    Translation: Wyczyść
    
    Key text.plugins.touch.expressions.accelerationxwithg.translated-name: English string has no whitespace padding but translated string does
    English: 'AccelerationXWithG'
    Translation: 'PrzyspieszenieXzGrawitacja
    '
    
    Key text.plugins.touch.expressions.accelerationxwithg.translated-name: Expression translated name is not a valid expression
    English: 'AccelerationXWithG'
    Translation: 'PrzyspieszenieXzGrawitacja
    '
    
    Key text.plugins.touch.expressions.xat.translated-name: Expression translated name is not a valid expression
    English: 'XAt'
    Translation: 'X na'
    
    Key text.plugins.touch.expressions.yat.translated-name: Expression translated name is not a valid expression
    English: 'YAt'
    Translation: 'Y na'
    
    Key text.plugins.touch.expressions.speedat.translated-name: Expression translated name is not a valid expression
    English: 'SpeedAt'
    Translation: 'Prędkość na'
    
    Key text.plugins.touch.expressions.angleat.translated-name: Expression translated name is not a valid expression
    English: 'AngleAt'
    Translation: 'Kąt na'
    
    Key text.plugins.touch.expressions.touchid.translated-name: Expression translated name is not a valid expression
    English: 'TouchID'
    Translation: 'ID Dotknięcia'
    
    Key text.plugins.touch.expressions.xforid.translated-name: Expression translated name is not a valid expression
    English: 'XForID'
    Translation: 'X dla ID'
    
    Key text.plugins.touch.expressions.yforid.translated-name: Expression translated name is not a valid expression
    English: 'YForID'
    Translation: 'Y dla ID'
    
    Key text.plugins.c2websocket.expressions.messagetext.translated-name: Expression translated name is not a valid expression
    English: 'MessageText'
    Translation: 'Tekst Wiadomości'
    
    Key text.plugins._common.actions.set-visible.display-text: BBcode tag [b] occurs 1 times in English but 0 times in translation
    English: Set visibility [b]{0}[/b]
    Translation: Ustaw {0}
    
    Key text.plugins._common.actions.set-visible.display-text: BBcode tag [/b] occurs 1 times in English but 0 times in translation
    English: Set visibility [b]{0}[/b]
    Translation: Ustaw {0}
    
    Key text.plugins.instantgames.conditions.on-load-ad-success.display-text: placeholder {0} in English string but missing in translation
    English: On load [i]{0}[/i] ad success
    Translation: Po pomyślnym wyświetleniu reklamy
    
    Key text.plugins.instantgames.conditions.on-load-ad-success.display-text: BBcode tag [i] occurs 1 times in English but 0 times in translation
    English: On load [i]{0}[/i] ad success
    Translation: Po pomyślnym wyświetleniu reklamy
    
    Key text.plugins.instantgames.conditions.on-load-ad-success.display-text: BBcode tag [/i] occurs 1 times in English but 0 times in translation
    English: On load [i]{0}[/i] ad success
    Translation: Po pomyślnym wyświetleniu reklamy
    
    Key text.plugins.instantgames.conditions.on-load-ad-error.display-text: placeholder {0} in English string but missing in translation
    English: On load [i]{0}[/i] ad error
    Translation: Błąd ładowania ładunku
    
    Key text.plugins.instantgames.conditions.on-load-ad-error.display-text: BBcode tag [i] occurs 1 times in English but 0 times in translation
    English: On load [i]{0}[/i] ad error
    Translation: Błąd ładowania ładunku
    
    Key text.plugins.instantgames.conditions.on-load-ad-error.display-text: BBcode tag [/i] occurs 1 times in English but 0 times in translation
    English: On load [i]{0}[/i] ad error
    Translation: Błąd ładowania ładunku
    
    Key text.plugins.instantgames.conditions.on-show-ad-success.display-text: placeholder {0} in English string but missing in translation
    English: On show [i]{0}[/i] ad success
    Translation: Pokaż sukces reklamy
    
    Key text.plugins.instantgames.conditions.on-show-ad-success.display-text: BBcode tag [i] occurs 1 times in English but 0 times in translation
    English: On show [i]{0}[/i] ad success
    Translation: Pokaż sukces reklamy
    
    Key text.plugins.instantgames.conditions.on-show-ad-success.display-text: BBcode tag [/i] occurs 1 times in English but 0 times in translation
    English: On show [i]{0}[/i] ad success
    Translation: Pokaż sukces reklamy
    
    Key text.plugins.instantgames.conditions.on-show-ad-error.display-text: placeholder {0} in English string but missing in translation
    English: On show [i]{0}[/i] ad error
    Translation: Błąd wyświetlania reklamy
    
    Key text.plugins.instantgames.conditions.on-show-ad-error.display-text: BBcode tag [i] occurs 1 times in English but 0 times in translation
    English: On show [i]{0}[/i] ad error
    Translation: Błąd wyświetlania reklamy
    
    Key text.plugins.instantgames.conditions.on-show-ad-error.display-text: BBcode tag [/i] occurs 1 times in English but 0 times in translation
    English: On show [i]{0}[/i] ad error
    Translation: Błąd wyświetlania reklamy
    
    Key text.plugins.instantgames.actions.show-ad.display-text: placeholder {0} in English string but missing in translation
    English: Show [b]{0}[/b] ad
    Translation: Pokaż reklamę
    
    Key text.plugins.instantgames.actions.show-ad.display-text: BBcode tag [b] occurs 1 times in English but 0 times in translation
    English: Show [b]{0}[/b] ad
    Translation: Pokaż reklamę
    
    Key text.plugins.instantgames.actions.show-ad.display-text: BBcode tag [/b] occurs 1 times in English but 0 times in translation
    English: Show [b]{0}[/b] ad
    Translation: Pokaż reklamę
    
    Key text.plugins.instantgames.expressions.leaderboard-player-photo-at.translated-name: Expression translated name is not a valid expression
    English: 'LeaderboardPlayerPhotoURLAt'
    Translation: 'Gracz w tabeli liderów'
    
    Key text.plugins.timeline.actions.play-timeline-by-name.display-text: BBcode tag [b] occurs 1 times in English but 0 times in translation
    English: Play [b]{0}[/b]
    Translation: Odtwarzaj {0}
    
    Key text.plugins.timeline.actions.play-timeline-by-name.display-text: BBcode tag [/b] occurs 1 times in English but 0 times in translation
    English: Play [b]{0}[/b]
    Translation: Odtwarzaj {0}
    
    Key text.plugins.bluetooth.expressions.device-id.translated-name: Expression translated name is not a valid expression
    English: 'DeviceID'
    Translation: 'ID Urządzenia'
    
    Key text.plugins.bluetooth.expressions.device-name.translated-name: Expression translated name is not a valid expression
    English: 'DeviceName'
    Translation: 'Nazwa urządzenia'
    
  • That example doesn't seem to make sense. Why would you pass RGBA parameters as CMYK? That's passing them as a different format.

  • 1) how do I get blend modes to work?

    The runtime sets the right blend mode before calling the Draw() method, so it should work automatically. If you change the blend mode in the draw method, you'll need to re-apply the one you want, or save the existing one at the start of the draw method and re-apply it at the end,

    2) how can I find out when an an object is destroyed? In C2 I had this:

    this.myDestroyCallback = (function (self){

    return function(inst){

    self.onInstanceDestroyed(inst);

    };

    })(this);

    this.runtime.addDestroyCallback(this.myDestroyCallback);

    I can't find an equivalent.

    There's an "instancedestroy" event in the runtime. I added it to the docs here: https://www.construct.net/en/make-games/manuals/addon-sdk/runtime-reference/runtime

  • If it's not documented or in the plugin SDK template, it's private code and not supported.