Jump to content

Recommended Posts

Posted

I believe I asked this before but didn't get an answer, or the answer from Lum didn't seem to work. Does anyone know if you can do 2D masking with LE drawing commands?

Posted

I tested it, and it worked, you remember the MOD2X trick. Maybe you did the textures wrong, but I could make a demo, since the old demo is on my old PC, and it's not ready yet.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

Ah bugger. Yeah if you don't have mind showing a really short demo that would be cool. I must have gotten the order wrong or something. I was trying to use pure pink as the mask color.

Posted

What do you mean by 2D masks? Do you mean color-keying (not drawing pixels of specific color), or actual grayscale masks (like in photoshop etc) ?

 

What are you trying to do with the masks ?

Posted

I believe it's more like color-keying. I'm specifically trying to create a circle health bar like in diablo. To do so the red health would actually be a rectangle image with the areas that aren't the circle aren't drawn.

Posted

Got it to work again:

2docclusion.zip

 

You need to draw to a temporary buffer, which doesn't need to be bigger than your image (64x64 in this demo).

Then you draw the occlusion image, which has transparent areas, with BLEND_ALPHA.

Then you draw the actual image with BLEND_MOD2X.

Then you draw the temporary buffer to your real background buffer.

  • Upvote 1

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...