Mikal's Recent Forum Activity

  • Updated with fix, version 1.0.1, the test project now plays the GIF on start of layout without resizing or any other C3 objects. Thanks for the bug report and test project.

    kindeyegames.itch.io/gifplayer-construct-3-addon

  • Thanks!

    I think I know why you are seeing that issue, I should be able to fix it in the plugin. Thanks for the bug report and supplying an example project, which is always very helpful for debug.

    Meanwhile for further testing in your project add a rotating sprite in your layout. This will make sure the GIF render to C3 happens every frame, including at the start.

    On the memory side, the GIF is not storing much data in the GPU memory, but a lot in CPU memory (each decoded frame.) So the memory usage may show up in another way, just something to be aware of.

  • From latest beta:

    JSON plugin: script interface to access JSON data

    Thank you Scirra, will try it out!

  • Here's an idea, create an object that includes a1 and a2 and then use currentbox to access them in the object using the 'key' currentbox. To make my example work, I also added a2 to the family.

  • New plugin to play GIFs (with control on a per frame basis, speed, pause, play, etc.) You can also apply effects and the usual general object ACEs.

    kindeyegames.itch.io/gifplayer-construct-3-addon

    If you try it out, please leave feedback here or in the addon comments.

  • Added TextureWrap to my Construct Effects Itch page.

    kindeyegames.itch.io/effects-for-construct

    Use with 'nearest' filtering. Create a texture offset and texture wrap on objects such as animated sprites. Similar behavior to the Tiled Background object, but also allows for animations. Also includes scaling texture up and down with wrapping / tiling. Bilinear or Trilinear filtering will have a seam on the texture edges.

  • Agree, this would be really great! I also am always doing stringify and parse for scripting and C3 functions / events.

    Right now I pass into C3 Functions that call scripting JSON.GetAsCompactString and then in the scripting I must parse, then for output from scripting back as a C3 return value meant for a C3 JSON object, I must again do JSON.stringify and then on C3 side, must do a JSON -> parse.

    If we had the scripting control for the C3 JSON object. Instead we could pass in JSON.UIDs as parameters for the function, in scripting we can select the object and read the JSON values and then we can also update another JSON object (or the same JSON object) as an 'output' of the function.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
    • Post link icon

    Yay! Local project folder is back after I updated to Chrome 83. Thanks to Ashley and the Chrome team. This is a great feature for Git / version control.

  • There are a lot of tutorials and examples for Babylon and three.js by themselves.

    With C3 scripting in events, the integration is pretty good, you can call Babylon functions and scripting can call C3 functions.

    Try it out...

    Another example. Adding C3 Warp Object effect on the Babylon render:

  • Nice work, I see a lot of demand for this in the forum and discord, video tutorials and example projects will really help folks trying to use it (easy for me to say, I've only done example projects for my own plugin :) ) Good luck!

  • Yes, I know about Spritesheets and their complications.

    I think my solution may be to use rcTex coordinates for the subset of the spritesheet texture, place the full texture on an offscreen canvas and use that canvas as the 'data' for UpdateTexture.

    Here's an example. I will do a couple of changes:

    - gl.readPixels needs to read from the rectangle subset based on rcTex subset of the spritesheet

    - UpdateTexture() can use a Canvas directly, so we don't need to create the img from it, can return the canvas instead.

    function createImageFromTexture(gl, texture, width, height) {
     // Create a framebuffer backed by the texture
     var framebuffer = gl.createFramebuffer();
     gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
     gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
    
     // Read the contents of the framebuffer
     var data = new Uint8Array(width * height * 4);
     gl.readPixels(<change based on rcTex and texture width to get lower x>, <change based on rcTex and texture height to get get lower y>, <change based on rcTex width and texel width>, <change based on rcTex height and texel height>, gl.RGBA, gl.UNSIGNED_BYTE, data);
    
     gl.deleteFramebuffer(framebuffer);
    
     // Create a 2D canvas to store the result 
     var canvas = document.createElement('canvas');
     canvas.width = width;
     canvas.height = height;
     var context = canvas.getContext('2d');
    
     // Copy the pixels to a 2D canvas
     var imageData = context.createImageData(width, height);
     imageData.data.set(data);
     context.putImageData(imageData, 0, 0);
    
     var img = new Image();
     img.src = canvas.toDataURL();
     return img;
    }
  • In the context of a plugin with an animation:

    Is it possible to enable wrapping of a texture, instead of edge clamp?

    With spritesheets, it represents a little more difficult (though it may be possible with an effect and manual wrapping of srcOriginStart to/from srcOriginEnd.)

    With CreateDynamicTexture() it seems possible with using opts of isTiled:true and tileType:repeat. The question I have is it possible to use an existing texture (imageInfo.GetTexture()) to UpdateTexture(data, texture, opts)? imageInfo.GetTexture does not seem to be directly one of the 'data' types for UpdateTexture(), is there another way to get a compatible data type from an existing animation frame / texture?

Mikal's avatar

Mikal

Early Adopter

Member since 22 Apr, 2016

Twitter
Mikal has 112 followers

Trophy Case

  • 9-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x10
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

21/44
How to earn trophies