Alpha not seeming to work for a label

2 views
Skip to first unread message

xavram

unread,
Jan 7, 2009, 11:04:09 AM1/7/09
to EEGUI
I'm using a label control as a kind of highlighter; it sits on top of
a texture of a chart and I want a transparent red bar to show the
relevant row. However, even after I set the background to RGBA
(1,0,0,.2), the bar is fully opaque red.

Any ideas?

xavram

unread,
Jan 11, 2009, 1:19:45 PM1/11/09
to EEGUI
Wow, just realized the last post on this forum was clear back in early
December....are people still checking/posting here?

EagleEye

unread,
Jan 11, 2009, 4:06:09 PM1/11/09
to EEGUI
Yup, occasionally... been really busy with school lately.

EagleEye

unread,
Jan 11, 2009, 4:07:23 PM1/11/09
to EEGUI
Don't use the alpha value of the background color. The A part of the
RGBA color for backgrounds is ignored in lieu of the control's overall
alpha setting.

Set the alpha for the entire control and you'll get the desired
effect.

xavram

unread,
Jan 12, 2009, 11:47:17 AM1/12/09
to EEGUI
Hmmm, nope, still not working. This form the control is on is brought
up via a FadeEffect(1000,.9) call and then I'm trying to trying to set
the alpha of the control but it's not "taking". If I just show the
form without a fade effect and set the alpha, then it's okay. So how
can i get this to work while still keeping the fade effect?
> > Any ideas?- Hide quoted text -
>
> - Show quoted text -

Jared Mark

unread,
Jan 12, 2009, 2:45:54 PM1/12/09
to ee...@googlegroups.com
Hmmmm... you may have an old version of the DLL... I renamed the effects so
it's "EffectFade" now.

Also, you have the time first and alpha second... it should be
EffectFade(TargetAlpha, Time)

xavram

unread,
Jan 16, 2009, 2:37:01 PM1/16/09
to EEGUI
Oh sorry, I misquoted. I am using the current DLL (just downloaded
the current to double check and its the same) and it's EffectFade.

The problem seems to be that, even though the label's Alpha is set to .
2 when i initialize the form, it adopts the alpha of the window after
the effect fade.
> > - Show quoted text -- Hide quoted text -

Jared Mark

unread,
Jan 17, 2009, 2:11:04 AM1/17/09
to ee...@googlegroups.com
Uh... alpha is from 0 to 1.

Jared Mark

unread,
Jan 17, 2009, 2:12:18 AM1/17/09
to ee...@googlegroups.com
Oh, also... children adopt the alpha of the parent when alpha is changed...
if you want the child of a form to have a different alpha value, you have to
change it after you change the value of the parent.


-----Original Message-----
From: ee...@googlegroups.com [mailto:ee...@googlegroups.com] On Behalf Of
xavram
Sent: Friday, January 16, 2009 1:37 PM

Jared Mark

unread,
Jan 17, 2009, 4:15:22 AM1/17/09
to ee...@googlegroups.com
Sorry... adding more to this...

What you can do is capture the "FadeStepExecuted" event... this event
triggers every time a fade effect step happens... so let's say you have 10
FPS and you do a fade that is from 0 to 1 over 1000ms (1sec)... that's 10
distinct changes. .1, .2, .3, .4, etc...

OR, you can capture and react to the "FadeComplete" event, which is raised
when the fade is complete.... (duh. :))

Either way, you could possibly, in that event handler, take the child object
and re-alpha it... For example...

Private Sub MyFadeComplete() handles MyBase.FadeComplete
ChildLabel.Alpha = Me.Alpha * 0.5
End Sub

Thus setting the child label's alpha to half of the alpha of the parent at
the END of the fade-up... or:

Private Sub MyFadeStepComplete() handles MyBase.FadeStepExecuted
ChildLabel.Alpha = Me.Alpha * 0.5
End Sub

This one would keep the child's alpha at 1/2 the parent's alpha, all the way
throughout the fade action.
Reply all
Reply to author
Forward
0 new messages