Qushy's Forum Posts

  • Yes, create it as any other object.

    Haha, ok but does that mean it's persistent if I load another layout? How do i do that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello, I would like to create an object that is global but through events is that possible?

    Tagged:

  • Hello,I have many games and I want to load a random (second) game after a point in the first game where I set a timer. After the second game is complete I want to return to the first game and the timer mustn't have stopped. Is there a way to do that?

    Tagged:

  • Please post your events or project file.

    I'm afraid I can't do that cause the project is work related. I just load some images from a URL, maybe it's the heroku app that doesn't allow me to load above a number of images in a certain amount of time?

  • Hello, I'm making a simple game where I load the images from URL with the help of the heroku app. After I finish the first turn and I need to reload the necessary images I get this error:

    	Uncaught (in promise) TypeError: Cannot read property 'GetSampling' of null
     at C3.Plugins.Sprite.Instance.LoadURL (actions.js:1)
     at async Promise.all (index 0)
    
  • Drawing Canvas doesn't like scaling. You need to move the image to a temporary sprite, then change the size of canvas, then paste the sprite back.

    Try this:

    Thank you SO much! :D Is there a way to do this in a loop cause I seem to be getting the last image loaded only.

  • Ok I have a really weird request, I want to make my Drawing Canvas from 468x468 to 100 x 100 while keeping the scale of the image that is within. I know this is VERY weird but I would like to know if it's possible. :D

  • Hi, could you provide some sort of visual aid like a screen capture of the code and layout?

    It's easier to help if we can actually see the moving parts.

    For some reason the `-OriginalWidth` value works while the `OriginalWidth` value should work. I essentially mirror the object at all times and it works. XD I think this is bug or I might have missed something but `-OriginalWidth` should mirror the object right?

  • Each pixel uses 4 bytes in the imageData array (r, g, b, a). So here is how to get pixel data at row:x, column:y

    > function getColorAtPixel(imageData, x, y) {
    const {width, data} = imageData
    
    return {
    r: data[4 * (width * y + x) + 0],
    g: data[4 * (width * y + x) + 1],
    b: data[4 * (width * y + x) + 2],
    a: data[4 * (width * y + x) + 3]
    }
    }

    Thank you so much! :D

    Here's is my code but it won't get a rectangular area that I want for some reason:

    	function getMainPartCoordinates (i, runtime, maskData, referenceData, pieceData) {
    
    	var mData = maskData.data;
    	var pData = pieceData.data;
    	var rData = referenceData.data;
    	
    	var rowsAndColumns = Math.sqrt (runtime.globalVars.NumberOfPieces);
    	
    	for (var j = i % rowsAndColumns * 117; j < i % rowsAndColumns * 117 + 117; j++){
    		for (var k= i % rowsAndColumns * 117; k < i % rowsAndColumns * 117 + 117; k++) {
    			if (getColorAtPixel (mData, k, j).a == 0)
    				setColorAtPixel (pData, rData, k, j);
    			else
    				break;
    		}
    	}
    	
    	
    	piecesDC[i].loadImagePixelData(pieceData);
    }
    

    Is there something wrong with this cause I get whole rows and I just want a rectangular area. :D

  • Hello, I'm trying to mirror an object in any way possible and it doesn't seem to work. I have tried the mirrored actions and also multiplying the width * -1. Nothing seems to work. Is there a way to set the rotation of an object?

    Tagged:

  • You should be able to alter a few parts of the returned ImageData and then load it back in to the canvas with loadImagePixelData().

    Oh yeah I'm already doing that, but I want to keep a puzzle piece in each Canvas (I have 16 pieces). So I need to know exactly when a row of the image ends in the buffer if that's possible, thanx! :D

  • Hello, I'm using getImagePixelData to modify the pixels of a Drawing Canvas. I would like to modify some pixels in some rows and columns but not all. Is there a way to do that somehow?

  • Hello, I'm loading images dynamically in a game and I would like the new origin to be on the center of the image. Is it possible to do that somehow?

  • Is there a solution to that? I have another project where I'm trying to load images from within the project and I'm getting the same error and we have no images on the server.

  • Hello,I'm having a really weird issue. I play my game and then I restart and go to the first layout with a button. After that I try to load the Game Layout again and I get the following error:

    imageInfo.js:1 Uncaught (in promise) Error: already loaded texture

    What am I supposed to do to avoid that?

    Tagged: