How do I get the RGB values for an object out of canvas?

Get help using Construct 2

Post » Mon Sep 05, 2016 5:53 pm

Using the canvas plugin i can get the RGB values of a pixel.

But how do the same for an image out of canvas? Is there any behaviour/plugin or expression to do that?
B
27
S
10
G
3
Posts: 610
Reputation: 4,672

Post » Mon Sep 05, 2016 6:02 pm

I think this is your answer. :mrgreen:

rgb-color-picker_t149071
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Mon Sep 05, 2016 6:10 pm

Gmoney wrote:I think this is your answer. :mrgreen:

rgb-color-picker_t149071


@Gmoney But is using canvas: "(requires rojohound's canvas plugin) " :P

I already can do this, the questions is, how do the same for sprites, colors out of the canvas plugin?
B
27
S
10
G
3
Posts: 610
Reputation: 4,672

Post » Mon Sep 05, 2016 6:38 pm

I'm sorry, matriax.

I should have fully explained.

What I've meant was to load your image to that color picker, and get the RGB values from there.

Please replace the existing palette with your own image file -- like this.

https://www.dropbox.com/s/umi986fsn5avq ... .capx?dl=0
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Mon Sep 05, 2016 6:49 pm

Ah i see, but the problem is that i will have to add every image selected in that canvas to pick the color.

So, without using the canvas plugin there is no way, other behaviour or plugin to get the rgb values of a sprite? C2 not any native expresion to get the RGB color values at X/Y point?
B
27
S
10
G
3
Posts: 610
Reputation: 4,672

Post » Mon Sep 05, 2016 7:32 pm

No, I don't think there's an automated solution for that yet. :(

According to R0J0hound, there's an expression that can get the red of a pixel under the mouse, but user needs to manually change pixel.data[0] setting to 1 and 2 for green and blue.

color-of-a-pixel_t149066
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Mon Sep 05, 2016 7:44 pm

Thanks for the info! . Will be great have some native/system expresion that do that for RGBA.
B
27
S
10
G
3
Posts: 610
Reputation: 4,672

Post » Mon Sep 05, 2016 11:06 pm

You're welcome, matriax. :mrgreen:

Yeah, I know.. :( Hopefully, we'll have the plugin someday. :mrgreen:
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Tue Sep 06, 2016 1:21 pm

@matriax
@Gmoney

'How do I get the RGB values for an object out of canvas? '
-------------------------------------------------------------------------------------
RgbChecker.capx-
https://drive.google.com/open?id=0B4jH2 ... nY3WEliM1E

You will need Rojohounds Canvas plugin.
Might not work correctly on pictures that have Shader effects applied to them.

Its quite an old project but it should run ok.
B
21
S
5
G
8
Posts: 1,215
Reputation: 7,834

Post » Tue Sep 06, 2016 9:13 pm

Go to Construct 2, select the object and in effects select "Set Color", thats effect change the object without plugins,behaviours just using a effect and that can be edited on the Event Sheet
Good bye :D
B
4
S
2
Posts: 4
Reputation: 489


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests