Advice on mask creation

Not favoritedFavorited Favorited 0 favourites
  • 7 posts
From the Asset Store
Basic template for drawing game with masks and easy customization
  • Hi!

    I was looking to achieve something with a mask and wondered if someone could please advise the best way forward.

    Essentially, i'm trying to create a hidden layer, which is "revealed" when the user adds to the mask with a brush-like tool. I've been experimenting with different blend modes and can't seem to get an option which handles transparency in the way that I need. The effect should be it looks like there is nothing on screen until the user mouse passes over it, effectively "painting" in the mask.

    Hope this makes sense, please let me know if any more detail is needed. Thanks in advance for any assistance.

    Neil

  • Hi,

    Do you mean you want the player to be able to create a colour or "rub" off the sprite - a bit like when you use the rubber in paint?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Or did you mean for the hidden object to immediately appear as soon as the player passes the mouse over the background?

    If this is what you wanted →

    Mouse on collisions with BG → set HiddenSprite Z order to top(or you could set visibility or destroy an object that will be over the hidden mask)

    Tell me if this works,

    Radkampfwagen

  • Or did you mean for the hidden object to immediately appear as soon as the player passes the mouse over the background?

    If this is what you wanted →

    Mouse on collisions with BG → set HiddenSprite Z order to top(or you could set visibility or destroy an object that will be over the hidden mask)

    Tell me if this works,

    Radkampfwagen

    Hi xRadkampfwagen

    Thanks for the reply! So I've made a gif which should better explain. Essentially I want to be able to paint a mask which reveals a hidden layer. The "painting" mechanic is straightforward as I can spawn some sprites on a layer to act as the mask. However the bit I can't figure out is how to have a transparent layer reveal (i.e. the smiley face in the gif below) reveal as I paint the mask.

    	<html>
    		<body>
    <div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe id="js_video_iframe" src="https://jumpshare.com/embed/1Dr58jurTt5IUtGoImQg" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>
    		</body>
    	</html>
    
  • Sorry thought I was embedding a GIF there. link below!

    jumpshare.com/s/1Dr58jurTt5IUtGoImQg

  • i dont know

    this might be a noob idea

    but

    if there are big blocks and the cursor is not small

    then you could destroy the bg blocks that are the same size as the cursor when you touch the bg

    remember i mean that that the bg will be in small blocks that are on the top layer

    or you could:

    have different pieces of the smiley face as different sprites, set there places next to each other like a puzzle then, set their z order to the bottom

    then when the player touches the right places

    mouse on click/hover over smileyfacepiece set z order to the top.

    remember even though the smileypieces are not visible from the top a mouse hovering over them whilst they are under another object will still be detected.

    yea so this would work if the cursor is big-if it is small then it will take ages to make-you could try making the smiley face into 4 pieces or less or more

    so tell me if this is what you want

    but i bet there is a better way

    Radkampfwagen

  • Thanks Radkampfwagen,

    That's given me a couple of ideas - I hadn't thought about using the Z-Order to just "hide" some fragments of the sprite on a lower layer which might be an interesting workaround.

    It feels like there should be a way to do it using the combination of blend modes available. However what I have tried so far seems to not allow for transparency on the layer being masked.

    Neil

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)