How do I detect color?

Get help using Construct 2

Post » Sun Mar 30, 2014 5:48 pm

Is there a way to tell what color my mouse pointer is currently over? Like, if I have hundreds of colors on my layout & I'm moving the pointer around, how can I make a little window that will A) update a preview of the color & B) display a text version the rgb info?
I suspect there's a basic concept I need to read up on that would help me solve this on my own, but I'm not sure what it is....It doesn't help that scirra's search function isn't working.
thanks in advance
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Sun Mar 30, 2014 9:06 pm

I'm not sure about the color.. but what are the colors a part of? The background? A sprite? You could always set up an event for checking what object the mouse is currently highlighting every frame I suppose.
B
3
S
1
Posts: 7
Reputation: 341

Post » Mon Mar 31, 2014 12:00 am

The colors could either be on a tiled background or a sprite...I ha_en't gotten that far yet. I'm mainly concerned with the mouse being able to detect the color of the pixel, if it's possible.
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Mon Mar 31, 2014 5:22 am

The closest you can do is perhaps use the canvas plugin (third party). With it you can get individual pixels from just the object's image. Besides that there isn't a way currently to get the color under the mouse for the whole game area.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Wed Apr 02, 2014 12:12 am

cool, thanks....I'll look into that
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Wed Apr 02, 2014 4:19 am

in the case of a drawing app for you could use the ReplaceColor effect on a solid white sprite; Set RGB source to 255; and RGB replace values to your new color values; from then on in you know the color of said sprite;
But if you need to pick colors from individual pixels then go with R0J0's suggestion.
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Fri Apr 11, 2014 11:56 pm

R0J0hound wrote:The closest you can do is perhaps use the canvas plugin (third party).


Is there a tutorial anywhere, or maybe just a general usage guide for Canvas? I've been kinda experimenting with it, & it seems like a great tool so I'd like to go a little deeper with it, but I can barely find any info....
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Sat Apr 12, 2014 2:52 am

There's just the plugin's forum topic currently.
B
92
S
32
G
106
Posts: 5,272
Reputation: 69,455

Post » Sat Apr 12, 2014 5:24 pm

R0J0hound wrote:There's just the plugin's forum topic currently.


Dear @R0J0Hound , your canvas plugin is both one of the most promising and yet occluded extensions in Construct 2. The possibilities that it opens, game-play and aesthetically speaking, are tremendous, although hidden behind its complexity that lay in understanding what it's actually capable of doing and how to do it. :shock: :?

I really wish there was a way to officially implementing the canvas plugin within construct, with detailed manual entry, tutorials and examples :cry: . Please understand that not all people can play around with math, expressions and a tree of variables (more like a forest :roll: ) like you do, a mindset that obviously make everyday programing challenges seem mandatory to you, but not to (some of) the rest of us. :oops:

Have you thought the possibility for the above? Does Ashley have in mind the official implementation of the canvas plugin?

:)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Sat Apr 12, 2014 9:57 pm

I personally really need to take the time out to study expressions --JUST expressions-- & how to construct them. I love playing around with them, but I'm still at the copy-paste-&-tweak level. Seems like understanding that process is going to be the real key to unlocking the plugin's possibilities.
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, MikaelS, nahima, Yahoo [Bot] and 21 guests