Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411478 Posts in 69369 Topics- by 58424 Members - Latest Member: FlyingFreeStudios

April 23, 2024, 07:52:45 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsScan Lines
Pages: [1]
Print
Author Topic: Scan Lines  (Read 3617 times)
Trystin
Level 4
****


Nyoom


View Profile WWW
« on: April 23, 2013, 02:19:41 AM »

Curious as to how you would go about getting scan lines in gm studio correctly?

Such as in Maldita Castilla



Or Lone Survivor



Im thinking its probably just a nifty transparent png file that you apply to a surface with a blend mode or something. Not completely sure how to go about it the right way so it doesn't obscure the image below too much.

Thanks
Logged

Trystin
Level 4
****


Nyoom


View Profile WWW
« Reply #1 on: April 25, 2013, 05:21:29 PM »

any takers?
Logged

indie11
Level 2
**


View Profile
« Reply #2 on: April 26, 2013, 08:29:55 AM »

You are right! it actually is a transparent image with effects(for example a gradient)
I am not sure how its done in GM but normally you can put it on the HUD or the top layer of entities and move it with respect to the camera

Logged

Trystin
Level 4
****


Nyoom


View Profile WWW
« Reply #3 on: May 01, 2013, 01:48:55 AM »

Thanks! Although I'm still fishing for a game maker based answer this points me in the right direction.
Logged

fraxcell
Level 5
*****



View Profile
« Reply #4 on: May 04, 2013, 03:16:47 PM »

My preferred method would be using surfaces (much more flexible), although you could also use sprites.
In the create event of some object, you can use a script like this to create a surface consisting of horizontal lines.

Code:
//create scan lines surface
surf_scanlines = surface_create(view_wview[0],view_hview[0]);
surface_set_target(surf_scanlines);
draw_clear_alpha(c_white, 0);
   
for(i=0; i<view_hview[0]; i+=2)
     draw_line(0, i, view_wview[0], i);

Then to draw the surface, just use this:
Code:
draw_surface_ext(surf_scanlines, 0, 0, 1, 1, 0, -1, 0.4);

For best results, combine the scanlines with a noise effect. This can be created in a similar manner, this time drawing dots rather than lines.

Code:
//create noise surface 
surf_noise = surface_create(view_wview[0],view_hview[0]);
surface_set_target(surf_noise);
draw_clear_alpha(c_white, 0);
   
for(i=0; i<view_wview[0]; i+=1)
    for(j=0; j<view_hview[0]; j+=1)
        if floor(random(3))=0
            draw_point(i,j);
And then draw the noise with this:
Code:
draw_surface_ext(surf_noise, 0, 0, choose(0,1), choose(0,1), 0, -1, 0.3);


 
Logged

Trystin
Level 4
****


Nyoom


View Profile WWW
« Reply #5 on: May 04, 2013, 03:26:33 PM »

Thanks so much! I will try this right now.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic