Recent

Author Topic: Fade animation  (Read 1032 times)

LemonParty

  • Sr. Member
  • ****
  • Posts: 375
Fade animation
« on: October 01, 2025, 09:14:14 pm »
Hello.

You probably know the program AIMP. It has a nice interface. And the thing that especially interest me is a light up / fade effect when you enter / take off cursor of the button. How such effect realized under the hood? Maybe there are already existing components with such effect?
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Fade animation
« Reply #1 on: October 01, 2025, 09:47:21 pm »
Hello.

You probably know the program AIMP. It has a nice interface. And the thing that especially interest me is a light up / fade effect when you enter / take off cursor of the button. How such effect realized under the hood? Maybe there are already existing components with such effect?

Check BGRAControls: TBCImageButton has fade effect.

Thaddy

  • Hero Member
  • *****
  • Posts: 18376
  • Here stood a man who saw the Elbe and jumped it.
Re: Fade animation
« Reply #2 on: October 02, 2025, 09:37:06 am »
Technically, manipulating the transparency byte. Look at AlphaBlend/AlphaBlendValue.
You do not need bgra controls if it is only the form.
« Last Edit: October 02, 2025, 09:58:06 am by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

LemonParty

  • Sr. Member
  • ****
  • Posts: 375
Re: Fade animation
« Reply #3 on: October 02, 2025, 08:09:04 pm »
Check BGRAControls: TBCImageButton has fade effect.
What properties should I change to achieve this effect?
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

TBMan

  • Sr. Member
  • ****
  • Posts: 285
Re: Fade animation
« Reply #4 on: October 03, 2025, 01:37:47 am »
Check BGRAControls: TBCImageButton has fade effect.
What properties should I change to achieve this effect?

I've done it with my own GUI written using PTCGraph. There's a focus color that needs to be changed (and a flag set) when the mouse is over the button, but it reverts to the unfocused state when the mouse is not there, it's probably done the same way.   Another way to fade colors to adjust the palette entry up and down. I've done that in one of my solitaire games to show the card that was selected.
I love programming.

Some things I've done using PTCgraph:

NFL Retro Football (almost finished):
https://www.youtube.com/watch?v=78mTtsd7ppk


Solitaire games:
https://www.youtube.com/watch?v=zmtxI7FdWuQ&list=PLa4BPpFl34iVhFwX1JZwVm3vE5ay_i3R2

lainz

  • Hero Member
  • *****
  • Posts: 4738
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Fade animation
« Reply #5 on: October 03, 2025, 09:54:18 pm »
Check BGRAControls: TBCImageButton has fade effect.
What properties should I change to achieve this effect?

Is enabled by default, the property 'Animation' (Boolean).

You must provide your own images with the desired drawing... check the examples.

LemonParty

  • Sr. Member
  • ****
  • Posts: 375
Re: Fade animation
« Reply #6 on: October 03, 2025, 11:17:06 pm »
check the examples.
Where I can find the examples?
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11


LemonParty

  • Sr. Member
  • ****
  • Posts: 375
Re: Fade animation
« Reply #8 on: October 05, 2025, 03:18:07 pm »
Thank you. It works.
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

jamie

  • Hero Member
  • *****
  • Posts: 7329
Re: Fade animation
« Reply #9 on: October 05, 2025, 04:34:33 pm »
Beware the package has a couple of leaks in it.

I just checked and it looks like the online packager has not been updated nor do I know if a new package has actually been created at the site. I suppose you could build it yourself.

Jamie
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018