Legacy GM Q: Clearing a part of a surface?

Z

zendraw

Guest
Is there anyway to clear a certain part on a surface except drawing over it with a black image?
 
Z

zendraw

Guest
that doesnt erase it from the surface. i want to erase a part completely from the surface.
 
D

dannyjenn

Guest
What do you mean "erase a part"? As mentioned, if you use the correct blend mode (set the target to alpha subtract I think...) and you draw the right color over it (anything with 100% alpha should do), you'll basically be punching a hole in the surface, i.e. "erasing" that part. Maybe we're not understanding your question?
 
Z

zendraw

Guest
what im trying to do is simply erase a part from a surface, as if the final resault of the surface has that part erased, you dont constantly subtract it with code. like you draw somthing with a pencil, then you erase it with the eraaser. thats all. im not making a lighting engine or anything like that. can you provide some code with the correct blendmodes and setup? as i sayd i tryed with bm_subtract and nothing happened.
 

Dupletor

Member
I don't know in GMS 1.4, but this post is about a similar project for an object instead of a surface in GMS 2. (You probably want the Rayman example)
https://forum.yoyogames.com/index.p...-to-make-part-of-an-object-transparent.53006/

It's probably the same thing, as you can set the same shader when drawing a surface. Just put whatever property you want to the uniform (he uses distance to object), and set alpha to 0 when your property is set. Boom. To every pixel in which the property is true, it will have alpha 0. (In my success example it was 0.3)
 
Last edited:
Top