The Daily Click ::. Forums ::. Klik Coding Help ::. flash light
 

Post Reply  Post Oekaki 
 

Posted By Message

SculptureOfSoul



Registered
  14/03/2005
Points
  52
27th March, 2005 at 02:31:01 -

Well my idea was merely speculation, but I thought that the overlay redux was capable of getting and setting any pixel on the screen. I'll have to check and see if it is indeed capable of modifying pixels "belonging to" active objects.

After thinking about what I'd posted for a bit I realized that there would need to be some way of storing the original color of the pixel as well, otherwise the flashlight would "lighten" the area, but when you turned or whatever the area would not go back to being dark. Eventually the whole screen would be pure white. Anyways, what would be needed is a 2 dimensional array that stores the original pixel color of every pixel it will be "lightening". During the drawing routine, before each pixel is lightened, it's original RGB value would need to be stored in the 2D array at ArrayPosition(X,Y), where the X and Y are the value of the pixel. Otherwise you could use a 3D array and just store each pixel sequentially, first pixel modified would be in array index 1, 2nd pixel at 2, etc. The RGB could be stored as a string that needs to get parsed, and the X and Y could be stored in the other 2 dimensions.

Anyhow, whenever the drawing routine is called it would first redraw every pixel stored in the "Modified" array, therefore returning them to their original color. It would then continue on with the drawing routine and modify whatever pixels were currently in it's path.

If this isn't possible with the overlay redux object, i'm pretty sure it'd be possible with a different object. I could have sworn that there was another object that allows you to get and set pixels, although I can't think of it off the top of my head.

Sooner or later I'll probably be making an example of this, as I intend to use similar effects in my RPG.

~SoS

 
Current Project: Undertaking the design of my mammoth RPG. Utilizing all of the knowledge gained while coding the now defunct "Shadow Reign".

DistantJ [FZ Games]



Registered
  02/08/2004
Points
  855
27th March, 2005 at 13:36:17 -

I'm still very interested. I'd like to be able to redraw my backgrounds like that at runtime. Sine wave effects for underwater and such. I might have to take a look at this object in more detail.

 
http://www.fzgames.com
   

Post Reply



 



Advertisement

Worth A Click