Erase with alphaChannel

Find quick help here to get you started with Hollywood
Post Reply
sinisrus
Posts: 214
Joined: Tue Apr 21, 2015 5:43 pm

Erase with alphaChannel

Post by sinisrus » Mon Dec 05, 2016 6:27 pm

Hello,

I can not erase with a fade of brush 1

Thank for your help

Code: Select all

/* Nouveau projet Hollywood */

SetFillStyle(#FILLCOLOR)
CreateBrush(1, 100, 100, #BLACK, {AlphaChannel = True, Clear=True})
SelectBrush(1,#SELMODE_COMBO,2)
Circle(#CENTER,#CENTER,30,#WHITE)
EndSelect

BlurBrush(1,30)

W=GetAttribute(#BRUSH,1,#ATTRWIDTH)
H=GetAttribute(#BRUSH,1,#ATTRHEIGHT)

/*****************************************/  

Function p_Move(msg)

  ShowLayer(2,MouseX()-(W*0.51),MouseY()-(H*0.51))

  IF IsLeftMouse()
    SelectAlphaChannel(Temp)
    SetAlphaIntensity(0)
    DisplayBrush(1,mouseX()-(W*0.51),mouseY()-(H*0.51))
    EndSelect

        SelectLayer(1,#SELMODE_COMBO)
        DisplayBrush(TEMP,0,0)
        EndSelect
  EndIf

  IF (msg.action="OnRightMouseDown")
    SelectAlphaChannel(TEMP)
    SetAlphaIntensity(255)
    Cls
    EndSelect

    SelectLayer(1,#SELMODE_COMBO)
    DisplayBrush(TEMP,0,0)
    EndSelect
  EndIF

EndFunction

/*****************************************/ 

SetInterval(1, p_Move, 1000/50) ; 50fps
InstallEventHandler({OnMouseDown = p_Move, OnRightMouseDown = p_Move})

EnableLayers()

TEMP=CreateBrush(Nil, 640, 480, #BLUE, {AlphaChannel = True, Clear=0})
InsertLayer(1,#BRUSH,TEMP,0,0)

InsertLayer(2,#BRUSH,1,MouseX()-(W*0.51),MouseY()-(H*0.51))


EscapeQuit(True)

/* Boucle infinie */
Repeat
        WaitEvent
Forever

User avatar
airsoftsoftwair
Posts: 2448
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Erase with alphaChannel

Post by airsoftsoftwair » Wed Dec 07, 2016 11:01 pm

I'm not a thought reader... what do you want to do? :)

sinisrus
Posts: 214
Joined: Tue Apr 21, 2015 5:43 pm

Re: Erase with alphaChannel

Post by sinisrus » Thu Dec 08, 2016 12:05 am

I am sorry my english is vert bad

If i paint with brush smooth border work OK
If i erase with brush smooth border not correct work (border not smooth for erase is not correct my brush have smooth border)

Use my exemple for see

Is ok for you?

sinisrus
Posts: 214
Joined: Tue Apr 21, 2015 5:43 pm

Re: Erase with alphaChannel

Post by sinisrus » Thu Dec 08, 2016 3:32 pm

Look link picture make with photoshop
- UP paint with smooth brush
- Down erase with smooth brush

Hollywood erase with smooth brush just flat
I tested with SetAlphaIntensity(#VANILLACOPY) => (not good work) :-/

http://www.hostingpics.net/viewer.php?i ... terase.jpg

User avatar
airsoftsoftwair
Posts: 2448
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: Erase with alphaChannel

Post by airsoftsoftwair » Sun Dec 11, 2016 1:11 pm

This is certainly possible with Hollywood but from the top of my head I can't tell what would be the best way to do it. I think you should experiment with SelectBrush() using #SELMODE_COMBO and combomode 2.

sinisrus
Posts: 214
Joined: Tue Apr 21, 2015 5:43 pm

Re: Erase with alphaChannel

Post by sinisrus » Sun Dec 11, 2016 5:45 pm

No SelectBrush (MyBrush, # SELMODE_COMBO, 2) is for drawing with a brush that has smooth

I want to make a hole with smooth border (erase) in a brush

Normally with

SelectAlphaChannel (Temp)
SetAlphaIntensity (#VANILLACOPY)
DisplayBrush (1, MouseX (), MouseY ())
EndSelect
  
But it does not work properly

sinisrus
Posts: 214
Joined: Tue Apr 21, 2015 5:43 pm

Re: Erase with alphaChannel

Post by sinisrus » Wed Apr 19, 2017 11:55 am

My brush has several levels of transparencies, I would like to erase with its levels of transparencies (currently hollywood erases with just 1 level only And not several at the same time)

Post Reply