GetRGBAt?

New releases and general discussions.

Post » Fri Dec 17, 2010 10:46 am

Would it possible to do this or something that read back colors on a certain point on a sprite?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Fri Dec 17, 2010 11:15 am

Yes, the image manipulator, but its kind of slow, but anything that reads from the gpu will be.
I just posted a cap in the examples forum that uses it if your interested.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Fri Dec 17, 2010 1:25 pm

The Slime thing?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Fri Dec 17, 2010 9:48 pm

Yeah, it uses the image manipulator, but there's no calls to get r, g, or b used.
Depending on what you need it for you just copy from the sprite, and get r,g,and b separately, or use the system expression RGB(ImageManipulator.GetR(X, Y), ImageManipulator.GetG(X, Y), ImageManipulator.GetB(X, Y)) to combine it
Same goes for alpha, but that's separate from all the set options.

Keep in mind you may have to wait a tick between reading and setting.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sat Dec 18, 2010 12:08 am

I need RGB to story separately. Thanks a lot!

*gives Newt a rep point* =P

Is it actual tick, do you tick in the slang sense?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Sat Dec 18, 2010 12:20 am

Tick= Frame.
You shouldn't have to worry about it if your just reading, once the image is copied to the image manipulator.
Its when you change the image, or read another image that you need a tick.
I'd suggest the function object, "call function after delay" 23 milliseconds to be safe.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sat Dec 18, 2010 2:20 am

Hmm. dunno. What about flashing colors?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Sat Dec 18, 2010 4:42 am

If your talking about frames, you'll have to stop it on the frame you want to copy.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 1 guest