Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Anyone know how to do a decent fog effect in GM?, Fixed.
United Kingdom
Thingy
Posted: Oct 30 2009, 04:02 PM
Quote Post


So long MFGG 2.0~
[*][*][*][*]

Group Icon
Group: Members
Posts: 1824
Member No.: 4642
Joined: 30-October 07

Status: (0d) [--]


For a platformer, it's foggy, and there's a circle around the player that becomes opaque the further away from him it is.

Unfortunately I don't know how to achieve this.

Any suggestions?

This post has been edited by Thingy on Oct 31 2009, 01:36 PM


--------------------
user posted image
Old ref, Current ref
Click to see the rest. (opens sig on top post)

user posted image
Hey, MFGG 3.0, it's me from the past.
PMEmail PosterMSN
Top
United States
orange452
Posted: Oct 30 2009, 05:30 PM
Quote Post


...and brotha, I hurt people...
[*]

Group Icon
Group: Members
Posts: 519
Member No.: 3337
Joined: 21-February 07

Status: (0d) [--]


Can you show a pic of what you want? I'll try to make it.


--------------------
user posted image
************************************************************
PMEmail PosterUsers Website
Top
United States
RetroXYZ
Posted: Oct 30 2009, 06:25 PM
Quote Post


Standard Member
[*][*]

Group Icon
Group: Members
Posts: 2714
Member No.: 4325
Joined: 27-August 07

Status: (0d) [--]


sprite_set_alpha_from_sprite(sprite,mask)

sprite is the sprite to use
mask is a grayscale mask to use (white is fully transparent, black is no transparency)

Take the mask and make a gradient circle (going from white in the middle to black on the outside) and use that on a whatever color box for a sprite and then draw that centered over the character. Then, use draw_rectangle to draw a solid color all around it. Alternatively, you can just make a sprite the size of the view, although I wouldn't recommend it.
PMEmail PosterMSN
Top
United Kingdom
Thingy
Posted: Oct 31 2009, 03:18 AM
Quote Post


So long MFGG 2.0~
[*][*][*][*]

Group Icon
Group: Members
Posts: 1824
Member No.: 4642
Joined: 30-October 07

Status: (0d) [--]


QUOTE (RetroXYZ @ Oct 31 2009, 12:25 AM)
sprite_set_alpha_from_sprite(sprite,mask)

sprite is the sprite to use
mask is a grayscale mask to use (white is fully transparent, black is no transparency)

Take the mask and make a gradient circle (going from white in the middle to black on the outside) and use that on a whatever color box for a sprite and then draw that centered over the character.  Then, use draw_rectangle to draw a solid color all around it.  Alternatively, you can just make a sprite the size of the view, although I wouldn't recommend it.

Can you elaborate on this please?

I tried the doing a sprite the size of the view first (since I originally had just a placeholder circle following the player around) but that didn't work (I had it draw the sprite, then use the alpha, is that right?) so I tried the rectangle thing, but I don't know what to do for colors 1, 2 and 3.


EDIT: also, while I have a topic, what's wrong with this code?
CODE
if x < view_xview + 104
if x > view_xview
if y < view_yview + 104
if y > view_yview
var = distance_to_object(object0)
sound_play(Step)
sound_volume(Step,100-var) //this is placeholder until I work out what min and max volumes are


This post has been edited by Thingy on Oct 31 2009, 03:37 AM


--------------------
user posted image
Old ref, Current ref
Click to see the rest. (opens sig on top post)

user posted image
Hey, MFGG 3.0, it's me from the past.
PMEmail PosterMSN
Top
United States
orange452
Posted: Oct 31 2009, 10:05 AM
Quote Post


...and brotha, I hurt people...
[*]

Group Icon
Group: Members
Posts: 519
Member No.: 3337
Joined: 21-February 07

Status: (0d) [--]


QUOTE (Thingy @ Oct 31 2009, 03:18 AM)
Can you elaborate on this please?

I tried the doing a sprite the size of the view first (since I originally had just a placeholder circle following the player around) but that didn't work (I had it draw the sprite, then use the alpha, is that right?) so I tried the rectangle thing, but I don't know what to do for colors 1, 2 and 3.


EDIT: also, while I have a topic, what's wrong with this code?
CODE
if x < view_xview + 104
if x > view_xview
if y < view_yview + 104
if y > view_yview
var = distance_to_object(object0)
sound_play(Step)
sound_volume(Step,100-var) //this is placeholder until I work out what min and max volumes are

if x < view_wview and x > view_xview and y < view_hview and y > view_yview then {
var = distance_to_object(object0)
sound_play(Step)
sound_volume(Step,100-var)
}


--------------------
user posted image
************************************************************
PMEmail PosterUsers Website
Top
United Kingdom
Thingy
Posted: Oct 31 2009, 01:34 PM
Quote Post


So long MFGG 2.0~
[*][*][*][*]

Group Icon
Group: Members
Posts: 1824
Member No.: 4642
Joined: 30-October 07

Status: (0d) [--]


Whoops, sorry, I fixed it ages ago.


--------------------
user posted image
Old ref, Current ref
Click to see the rest. (opens sig on top post)

user posted image
Hey, MFGG 3.0, it's me from the past.
PMEmail PosterMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0652 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 1.11 ]