A large black active object with a hole in the middle, the size of the frame, position the hotspot to the top left corner, then: ALWAYS: set position of object to x left frame, y top frame? Then maybe create another circular active, give it some transparency and position it where the hole would be? Is that what you mean?
Seems quite easy, just do what circy suggests but take out a triangle and give it two (or more) directions and get it to follow the characters direction (rather than the top left. You may have to make it a lot larger than the screen size if it follows the character.
no, really no! it has to be square, with a side length of max(screenWidth, screenHeight). But if you give it one animation for each direction it would never need to be BIGGER than the screen! that is absurd. Why hide something that is OUTSIDE the visible screen?
btw, I mean if the hotspot is centered and you always place the big black thing at (0,0) from character
or you could set it to follow the playfield and just make sure you always center display on the guy. Change it's direction as the character changes its. Then it could be the exact size, otherwise it does need to be a bit biger so that the edges don't peek out during the game during movement.
there is one problem though. Moving close to the edge of the frame will make it not scroll you know... (as there is nothing more to show) so it has to follow the character and has to be twice the screen size... if you know what I mean.
actually three times the screen size if you want it to work close to both left and right edge of the frame
I think the ideal method would be to utilize an overlay redux object, and draw an invisible "custom" triangle utilizing fastloops. During the loop, while it's plotting every point, it would also Grab the pixel color at that location and then add a predetermined value to it maybe RGB(25,25,25) or something. You could even use different values to simulate getting a better flashlight. The Custom Ultra Eye of the Sun flashlight could add RGB(75,75,75) to each pixel...3 times the lighting effect. On the same note, you could change the drawing algorithm to plot a bigger triangle when using a "more powerful" flashlight.
This would take up much less memory and CPU power than using a huge active object, and it would offer the benefits of easy customization. If you really wanted to make it badass, you could make a separate overlay that lies "underneath" the frame graphics...make this overlay clear or white or something and then draw all of the "walls" or "obstacles" in black(anything that the light won't shine through). During the fastloop triangle drawing routine, first check the invisible wall overlay. If the current point that the algorithm is plotting is black on the invisible overlay, don't change the color on the active frame.
The downside to this approach is that requires quite a bit of trig and the overlay redux object or some other object that can get and set the color of individual pixels, which means that doing this in TGF is out of the question.
Current Project: Undertaking the design of my mammoth RPG. Utilizing all of the knowledge gained while coding the now defunct "Shadow Reign".
SculptureOfSoul, your method sounds interesting, but I don't quite understand it. I haven't used Overlay Redux before, but it sounds like i could benifit from this.
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".
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.