Problem with the Canvas plugin?

Get help using Construct 2

Post » Tue Aug 25, 2015 2:53 am

If I paste an image onto the canvas, I cant detect colours from it. as in if I try to compare the rgbat(x,y) to a certain colour, it doesnt work. This is only with images pasted onto the canvas. Everything else works. any way to get the rgb of a point off an image?
B
5
S
1
Posts: 54
Reputation: 508

Post » Tue Aug 25, 2015 3:39 am

If the comparison doesn't work, what is the value of rgbaAt()? What are the x and y values you're using? They do need to be integers as I recall.
B
94
S
33
G
113
Posts: 5,357
Reputation: 73,275

Post » Tue Aug 25, 2015 5:58 am

Sorry for late reply. Currently I have:

Canvas.RgbaAt(350,120) = "rgba(0,103,255,1)"

but it doesnt work.

For reference, I have

System > On start of Layout > Paste Object "Sprite" into canvas
Destroy "Sprite"

System > (see above) > Playerbase destroy.

The location is definately the color specified, yet playerbase does not get destroyed.
B
5
S
1
Posts: 54
Reputation: 508

Post » Tue Aug 25, 2015 6:35 pm

Set some text to Canvas.RgbaAt(350,120) and see what the color is at that spot.
B
94
S
33
G
113
Posts: 5,357
Reputation: 73,275

Post » Tue Aug 25, 2015 6:52 pm

I'm stupid. I did what you said, turns out the colour must've changed somewhere along the line somehow, because the text displayed "rgba(0,102,255,1)" when the colour I was using was rgba(0,103,255,1) :P

Sorry for this, thanks man!
B
5
S
1
Posts: 54
Reputation: 508


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests