Jump to content


Photo

Surfaces in GM Studio !


  • Please log in to reply
4 replies to this topic

#1 fhd

fhd

    GMC Member

  • GMC Member
  • 126 posts
  • Version:GM:Studio

Posted 22 June 2012 - 07:57 AM

Hi every one !
I think we need experts to look to this problem,
Please go to this post :
http://gmc.yoyogames.com/index.php?showtopic=475556&st=0&gopid=4001451&#entry4001451

this is one of the best blur effects which uses surfaces in GM, and if you open it
in GMS, nothing happen.because screen_redraw() function in obsolete now in GMS.

is there any way to get the same result in GMS ?


FHD
  • 0

#2 paul23

paul23

    GMC Member

  • Global Moderators
  • 3368 posts
  • Version:GM8

Posted 22 June 2012 - 08:33 AM

Hi every one !
I think we need experts to look to this problem,
Please go to this post :
http://gmc.yoyogames.com/index.php?showtopic=475556&st=0&gopid=4001451&#entry4001451

this is one of the best blur effects which uses surfaces in GM, and if you open it
in GMS, nothing happen.because screen_redraw() function in obsolete now in GMS.

is there any way to get the same result in GMS ?


FHD

yes, use a draw-event for this. You'll have to manage the draw events more closely though (as you wouldn't wish to draw over something else etc).
  • 0

#3 Lune

Lune

    hic quoque transibit

  • GMC Member
  • 526 posts
  • Version:GM:Studio

Posted 22 June 2012 - 06:35 PM

There's no easy way to replicate screen_redraw() if you're relying on depth order. If you're not, it's as easy as 'with (all) {event_perform(ev_draw, 0)}' for the objects, and something similar for the backgrounds and tiles.

So the better thing to do would be to have everything drawn to a surface in the first place. You can set the surface as the draw target using surface_set_target(id), or you can have the view's contents copied to the surface by assigning view_surface_id[0] to a surface's id.

Edited by Lune, 22 June 2012 - 06:36 PM.

  • 0

#4 Manuel777

Manuel777

    InvaderGames

  • GMC Member
  • 2865 posts
  • Version:GM:Studio

Posted 22 June 2012 - 07:03 PM

with (all) {event_perform(ev_draw, 0)} wont work.. at least it didnt when i tried (that was.. on the beta i think)

What I do is just with (object) {draw whatever you need here}, it should be faster than screen_redraw(), the only problem is that you need to remember to change both the with()'s and the draw event from the objects whenever you change them..
  • 0

#5 Lune

Lune

    hic quoque transibit

  • GMC Member
  • 526 posts
  • Version:GM:Studio

Posted 23 June 2012 - 06:54 AM

Strange. I hadn't tried it with GM:S yet, but didn't think enough had changed for it to be invalid.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users