Qushy's Recent Forum Activity

  • Hello,I have a rather simple question to ask. I would like to store the value of a URL parameter in an integer, how do I go on about doing that?Here's my current situation:

    Thank you in advance for any help. :D

  • Try asking in the scripting forum:

    https://www.construct.net/en/forum/construct-3/scripting-51

    Apparently I was "painting" with black lines oin the DrawingCanvas so for some reason all values were zero (even the drawn ones), I changed color and now it works fine. :D

  • Heeey thanks for the help! :D

    I almost got it working but for some reason the playerPixels varaiable is giving me an array of zeros even when I draw on the Drawing canvas so I can't compare between the two DrawingCanvases.

    Here's how I call the getImagePixelData() of the two DrawingCanvases:

    	function load(playerImage, computerImage)
    {
    	playerImage.getImagePixelData().then(playerData=>loadComputerData (playerData,computerImage));
    }
    
    function loadComputerData (playerData, computerImage) {
    
    	computerImage.getImagePixelData().then (computerData=>compare(playerData, computerData));
    }
    
    
  • You need to execute "DrawingCanvas Save snapshot" action, wait for it to complete, and then you can read pixels with expressions, for example:

    DrawingCanvas.SnapshotRedAt(10,20)

    DrawingCanvas.SnapshotGreenAt(10,20)

    DrawingCanvas.SnapshotBlueAt(10,20)

    DrawingCanvas.SnapshotAlphaAt(10,20)

    While this works just fine for a single pixel, when I try to access all pixels of the snapshot it takes some serious time. Is there any way to do it through code?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You need to execute "DrawingCanvas Save snapshot" action, wait for it to complete, and then you can read pixels with expressions, for example:

    DrawingCanvas.SnapshotRedAt(10,20)

    DrawingCanvas.SnapshotGreenAt(10,20)

    DrawingCanvas.SnapshotBlueAt(10,20)

    DrawingCanvas.SnapshotAlphaAt(10,20)

    Thank you so much for the answer! :D

    While this works just fine for a single pixel, when I try to access all pixels of the snapshot it takes some serious time. Is there any way to do it through code?

  • Hello, I have a DrawingCanvas instance which I use to let the player draw on it. I would like to manipulate the individual pixels of the DrawingCanvas instance through code. How do I access these pixels? getImagePixelData() seems to return something but I don't know how to access an individual pixel on it. In the documentation it says that it resolves an ImageData object but the data property doesn't exist when I try to access it. :/

    Thanks in advance for any help, this is really important to me. :D

  • Looks like there is a plugin here that will convert an image into a base64 string, where you can then run comparisons. See this thread for info and the link. https://www.construct.net/en/forum/construct-3/how-do-i-8/drawing-canvas-base64-string-141689

    Thank you so much for all the help! :D

    I am at the point where I've gotten the Canvas Snapshot but I don't know how to access the pixel information. I would like to compare the pixels, so if I find to access the pixels values I'm pretty much done. :D

  • Oh sorry I misunderstood what you were wanting. Are you doing a drawing game, where accuracy to the original is the goal?

    Yeah exactly, I want to get the drawn pixels on the right half of the Canvas Snapshot and compare them to the pixels on the left.

  • https://www.construct.net/en/tutorials/saving-a-snapshot-381

    Thank you so much. :D

    However I would like to take the pixel data of the snapshot and manipulate them without saving them, if anyone knows of such a way please let me know. :D

  • Hello, I would like to compare the pixels similarity between two halves of the current frame for a game I'm making. Is there any way I could do that with construct?

    Tagged:

  • take a look at this thread: in the middle of the second page it has a demo of how to draw a path and have an object follow it.

    https://www.construct.net/en/forum/construct-3/general-discussion-7/collection-demo-projects-149701/page-2

    Thank you so much for the answer. It really helped.

    Now, are there any ideas on how I can compare the shape the player draws to a predefined shape I'm showing to him? I will work on this today and try to figure it out but any help, again, would be much appreciated. :D

  • Hello, I'm making a game where the player needs to draw a shape presented to him and I would like to know how to go on about it. any kind of help will be useful as I have literally no idea how to make this work. Thanks in advance. :D

    Tagged:

Qushy's avatar

Qushy

Member since 2 Jul, 2020

None one is following Qushy yet!

Trophy Case

  • 4-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies