Qushy's Recent Forum Activity

  • Hello, I have kind of a weird question. Is there a way to dynamically create a line in Construct with CSS? And if not should I use a Drawing Canvas or is there a better way?

  • You need to place one instance of this object on any layout (it can be an unused "Storage" layout) in editor, and set this object as Global.

    After that you will be able to create it in runtime. Also, I don't know if it matters, but make sure that you create it on a layer which exists in all layouts.

    Thank you SO, so much! :D

  • You can test this yourself in like 30 seconds :)

    I don't think I've made my question clear, I'm so sorry. I would like to create a persisted object through some action or scripting (dynamically not through the editor), meaning I would like to create it in the first layout and the object to exist through all the following layouts I'm using. I've tried it and the objects I create go away in subsequent layouts. :D

  • 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

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