DelphiXE2 FireMonkey3D 滑鼠指向時的漸層

來源:互聯網
上載者:User

一、接前面的,在 Diffuse 的下拉式清單中,選擇 Create New TColorAnimation

 

二、連續點擊兩次,建立兩個 TColorAnimation

 

三、修改屬性

ColorAnimation1.StartValue := Green ;ColorAnimation1.StopValue  := Lime  ;ColorAnimation1.Trigger    := 'IsMouseOver=true';ColorAnimation2.StartValue := Lime  ;ColorAnimation2.StopValue  := Green ;ColorAnimation2.Trigger    := 'IsMouseOver=false';

 

 

四、 左邊是平時的球, ---------------------------------------------------------------------------右邊是滑鼠移動到球上時,球的顏色改變

 

 

表單代碼;

object Form1: TForm1  Left = 0  Top = 0  BiDiMode = bdLeftToRight  Caption = 'Form1'  ClientHeight = 601  ClientWidth = 681  Transparency = False  Visible = False  object Sphere1: TSphere    RotationAngle.Point = '(0,-5.6288743019104,0)'    Width = 3.000000000000000000    Height = 3.000000000000000000    Depth = 3.000000000000000000    Opacity = 1.000000000000000000    Material.Diffuse = claGreen    Quanternion = '(0,-0.0491016022861004,0,0.998793303966522)'    object ColorAnimation1: TColorAnimation      Duration = 0.200000002980232200      Trigger = 'IsMouseOver=true'      StartValue = claGreen      StopValue = claLime      PropertyName = 'Material.Diffuse'    end    object ColorAnimation2: TColorAnimation      Duration = 0.200000002980232200      Trigger = 'IsMouseOver=false'      StartValue = claLime      StopValue = claGreen      PropertyName = 'Material.Diffuse'    end  end  object Light1: TLight    Position.Point = '(1,1,-5)'    Width = 1.000000000000000000    Height = 1.000000000000000000    Depth = 1.000000000000000000    Opacity = 1.000000000000000000    LightType = ltDirectional    Quanternion = '(0,0,0,1)'  endend

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.