Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Need a bit of help  (Read 1639 times)

0 Members and 1 Guest are viewing this topic.

Ryuza

That one guy
Need a bit of help
« on: January 01, 2011, 03:32:30 am »
  • RyuKage2007
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 290
So I'm trying to work something out in GM8 and need a bit of help. Basically I want to have a full black screen with a circle around the player that is subtracted from the background, kind of like a light in a dark room, but what I want to do differently is have the circle permanently reveal anything its passed over. I should be able to use draw_set_blend_mode(bm_subtract) to do the subtracting but I'm not sure if theres a way to permanently subtract with it.

Anyone have any idea how I might achieve this?
« Last Edit: January 02, 2011, 07:22:18 pm by Ryuza »
Logged
<- Koholint Island - MC Style  <- Link's Awakening Photo Recolors  <- Wind Waker 3D Resources <- Super Mario Bros Crossover
  • RyuKage2007's Youtube
Re: Need a bit of help
« Reply #1 on: January 01, 2011, 07:15:43 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Posts: 61
Try the gmk I attached. It's in GM7, but it should work in GM8. If not, then you can at least try out the exe and read the code (fully commented; maybe a bit too much). I've done it with surfaces and blend mode bm_subtract.

I hope this is what you wanted. ;)
Logged
Re: Need a bit of help
« Reply #2 on: January 02, 2011, 04:16:49 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 160
An easier way i think would be to create a surface , draw it black then NOT keep drawing it every step.

Create
Code: [Select]
r = 50
s = surface_create(room_width,room_height)
surface_set_target(s)
draw_clear(c_black)
surface_reset_target()

Step
Code: [Select]
surface_set_target(s)
draw_set_blend_mode(bm_subtract)
draw_circle(mouse_x,mouse_y,r,0)
draw_set_blend_mode(bm_normal)
surface_reset_target()

Draw
Code: [Select]
draw_surface(s,0,0)
Logged
Nubcake now uses Purebasic!

Ryuza

That one guy
Re: Need a bit of help
« Reply #3 on: January 02, 2011, 07:22:08 pm »
  • RyuKage2007
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 290
I think I got it figured out, thanks.
Logged
<- Koholint Island - MC Style  <- Link's Awakening Photo Recolors  <- Wind Waker 3D Resources <- Super Mario Bros Crossover
  • RyuKage2007's Youtube
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.132 seconds with 45 queries.