Aluna's Forum Posts

  • 6 posts
  • Hi,

    I am working in Construct 3 with JavaScript and jsPDF to generate a PDF from my project.

    I have a Sprite with many animation frames, where each frame represents a graphic symbol. In the project I normally use this Sprite by changing its animation frame, for example:

    const key = runtime.objects.KEY_CHART.getFirstInstance();

    key.animationFrame = frameIndex;

    My question is:

    Is there any way, from JavaScript, to directly read the image of the current Sprite frame and convert it into something usable, such as an ImageBitmap, Blob, base64, dataURL, or similar?

    The idea would be to use that frame, draw it to a canvas, recolor it, and then insert it into a PDF using jsPDF.

    At the moment, I solved it by using an external 768x768 PNG atlas, with 64x64 symbols. I load it with fetch() and createImageBitmap(), then crop each symbol with OffscreenCanvas and insert it into the PDF.

    This works, but it means I need to keep the symbols duplicated:

    once as Sprite frames inside Construct 3;

    and again as an external PNG atlas for the PDF.

    I would like to know if there is a more direct way to use the existing Sprite frames from Construct 3, to avoid duplicated resources and reduce project size/maintenance effort.

    Thanks.

  • Greetings, I think I'm missing something. I send it through multiplayer, but I can't seem to visualize the image I receive. I believe all the binary data is arriving. Any ideas on how to visualize the image, photo in the sprite?

  • Greetings,

    You are right, my gridded mind did not allow me to see ... DrawingCanvas.PixelScale

    Thanks

  • Hello,

    I have a DRAWING CANVAS of 500x500 pixels with an image that I generate but when invoking that the gurade in PNG saves the complete file image but with larger measurements (579x579) some idea of ​​how to make it 1: 1 like the original size of the generated canvas?

    Thank to all

    Tagged:

  • Regards,

    I have not succeeded with Android from the browser it is possible but when creating APK it is not compatible

    Thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Greetings, do we have a solution for TTS, which only works on the web?

  • 6 posts