View Single Post
  #3  
Old 19-01-2023, 09:33
hitman797's Avatar
hitman797 hitman797 is offline
Registered User
 
Join Date: Feb 2013
Location: Algeria
Posts: 168
Thanks: 486
Thanked 202 Times in 122 Posts
hitman797 is on a distinguished road
FloatAnimation
Code:
var
    Layout1: TLayout;
    Rectangle1: TRectangle;
    FloatAnimation1: TFloatAnimation;
    FloatAnimation2: TFloatAnimation;
Code:
procedure TForm2.Rectangle1MouseEnter(Sender: TObject);
begin
 FloatAnimation2.Enabled:=False;
 FloatAnimation1.Enabled:=True;
end;

procedure TForm2.Rectangle1MouseLeave(Sender: TObject);
begin
 FloatAnimation1.Enabled:=False;
 FloatAnimation2.Enabled:=True;
end;
Code:
object Form2: TForm2
  Left = 0
  Top = 0
  Caption = 'Form2'
  ClientHeight = 480
  ClientWidth = 640
  FormFactor.Width = 320
  FormFactor.Height = 480
  FormFactor.Devices = [Desktop]
  DesignerMasterStyle = 0
  object Layout1: TLayout
    Align = VertCenter
    Size.Width = 640.000000000000000000
    Size.Height = 480.000000000000000000
    Size.PlatformDefault = False
    TabOrder = 0
    object Rectangle1: TRectangle
      Align = Left
      Fill.Color = claBlack
      Opacity = 0.800000011920929000
      Size.Width = 49.000000000000000000
      Size.Height = 480.000000000000000000
      Size.PlatformDefault = False
      Stroke.Thickness = 0.000000000000000000
      OnMouseEnter = Rectangle1MouseEnter
      OnMouseLeave = Rectangle1MouseLeave
      object FloatAnimation1: TFloatAnimation
        AnimationType = InOut
        Delay = 0.200000002980232200
        Duration = 0.500000000000000000
        Interpolation = Back
        PropertyName = 'Width'
        StartValue = 56.000000000000000000
        StartFromCurrent = True
        StopValue = 256.000000000000000000
      end
      object FloatAnimation2: TFloatAnimation
        AnimationType = InOut
        Delay = 0.200000002980232200
        Duration = 0.500000000000000000
        Interpolation = Back
        PropertyName = 'Width'
        StartValue = 256.000000000000000000
        StartFromCurrent = True
        StopValue = 56.000000000000000000
      end
    end
  end
end
FloatAnimation
Reply With Quote