How do I put the sprite image into the canvas?

0 favourites
  • 10 posts
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • How do I paste the image of a sprite placed off-screen into a canvas inside the screen?

  • Inside a single action

    1. Move the sprite to the position you want it to appear on

    2. Use the canvas action to paste the sprite on the canvas

    3. Move the sprite offscreen again

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, I wanted to try to get around that water effect bug, leaving the canvas with the image of the object on the screen, and the object with the effect off the screen, it was just a test, but if I have to keep it sprite on the canvas doesn't even make sense to try..

  • How about doing the reverse thing?

    1. Move the canvas offscreen

    2. Paste the object

    3. Move the canvas back onscreen

  • My idea was to give the effect to the sprite, and somehow paste it every x seconds to the canvas, so that I would have the sprite animation distorted, in the canvas, doing this in theory that bug would not be there, but if the sprite has to be superimposed on the canvas to paste it, I would have to do something like move every x seconds the canvas to the desired point, I think it would be a mess, I'm not even sure how the animation would have turned out if I had pasted the sprite multiple times..

  • Which water effect are you using actually? I've got curious and tried it and to me it seems they have been updated at some point and the camera position doesn't have too much of an effect anymore (only near the edges). It's so much better than I remember.

  • I created an example that shows the problem, the graphics would be different, but let's say that a sort of flame is formed that I like, it wouldn't make sense that when it is close to the sides it starts to move very quickly.

    mediafire.com/file/7uw1jswqqfwvt9f/effect+prove.c3p/file

    I found this example of the pig reflected in the water

    howtoconstructdemos.com/create-a-reflection-with-water-effect

    Where the sprite is never superimposed on the canvas, but is still on the canvas, I put the effect on the pig instead of the water and I put the camera on it by moving the objects more to the center and giving more pixels of distance for the reflection, thus creating the conditions I wanted to try, the pig never distorts the image, but when it goes out of the screen its reflection in the water speeds up anyway XD

    So maybe there is no way to fix it..

  • Yeah in your example it's quite clear that the effect goes crazy near the edges. It used to do that everywhere tho so at least that's an improvement. Perhaps you'd have to look into a different way of getting the effect you want. Maybe could simply turn it into a sprite animation with some other tool? Or you could create a mesh on the object that you sort of randomly distort to maybe get a similar effect?

  • Hehe yesterday I did something similar, with the Construct video recorder, I made a video of a few seconds of the sprite, even if I didn't know how to make the background transparent, I used a white one to try to remove later, then I passed it to an online site to have the gif and I used it as an animation, even if the loop was seen to skip at a certain point, it didn't seem to have the same fluidity and then repeating the image for a few seconds wasn't as nice as the continuous random.

    I don't know what the result of the random meshes would be, but I'm not able to create the code.

    It almost seems like a bug, I don't understand why the effects behave like this, too bad I can't use them

    Thanks anyway for the ideas suggested!

  • I don't know what the result of the random meshes would be, but I'm not able to create the code.

    But I am. Took me a little while to figure this out I have to admit. Basically I'm distorting a mesh based on the waves of a perlin noise function. You do need quite some meshpoints for it to look good so I have no idea how performant this is, but I'd say use as little of them as possible. I'm pretty sure doing this inside a shader would be more performant but I have no idea about coding shaders.

    wackytoaster.at/parachute/perlindistortion.c3p

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)