Page 1 of 1

getpixel() timeframe

PostPosted: Mon Jul 21, 2008 7:05 am
by feral
sorry, i know this has been asked before, but i was hoping makslane could let me know if getpixel() is on the list for a new feature, (is it possible with this engine ? .... and/or, if so, when it may be available..

sorry to repeat posts, but the possibility and/or time frame is critical to my future plans for my spritemaker program...

many thanks
feral

Re: getpixel() timeframe

PostPosted: Mon Jul 21, 2008 12:09 pm
by makslane
What kind of value a getPixel function should return in Game Editor?
A struct with a RGB value like this?

Code: Select all
color = getPixel(int x, int y);
somevariable1 = color.r;
somevariable2 = color.g;
somevariable3 = color.b;

Re: getpixel() timeframe

PostPosted: Mon Jul 21, 2008 1:08 pm
by feral
makslane wrote:What kind of value a getPixel function should return in Game Editor?


color = getPixel(int x, int y);
somevariable1 = color.r;
somevariable2 = color.g;
somevariable3 = color.b;


yes , almost exactly that :D , tho , I realize that it will most likely only work on a "canvas", ....which would work for what I need.

Ideally, I would also love to be able to do a getpixel on the "screen' or "view" ...As, I imagine there would be a lot of use for that in games as well...

but, yes please, even a canvas getpixel() would work..

Ideally, I would like to use the GE engine to move sprites around the screen ( and/or draw them to a canvas) and then use getpixel() on each frame redraw (draw event ) to create an array of pixel data, ready to save as a bitmap.

eg: check what is on screen/canvas using a loop, and fill an array of pixel data..

I can create arrays to do this, but it would be a lot easier simply to be able to capture what is on screen..

if that makes sense...

thanks

Re: getpixel() timeframe

PostPosted: Tue Jul 22, 2008 4:21 pm
by summer_goth
Oooo I'd love this function. getPixel() would enable me to use hotspots in our games.

Re: getpixel() timeframe

PostPosted: Fri Jul 25, 2008 2:24 am
by feral
If possible, I would also like to see the getpixel function include a variable for transparency/alpha value :)

thanks
feral