diff options
author | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-02-19 14:02:17 +0000 |
---|---|---|
committer | jaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-02-19 14:02:17 +0000 |
commit | f4537c94794d456d4b7157efeeca2509363bdbb8 (patch) | |
tree | a2ded8b57f31bf7f02a34b9cb5f32eb825446875 /Game/Code/Menu | |
parent | 46aba686fbcfdee835eaa47143c632b4de53fb68 (diff) | |
download | usdx-f4537c94794d456d4b7157efeeca2509363bdbb8.tar.gz usdx-f4537c94794d456d4b7157efeeca2509363bdbb8.tar.xz usdx-f4537c94794d456d4b7157efeeca2509363bdbb8.zip |
mmmmmmmmmmmmm
Looping background images in the menu's ...
http://trac2.assembla.com/usdx/ticket/5#comment:2
( starting to get there )
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@865 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Menu/UMenu.pas | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/Game/Code/Menu/UMenu.pas b/Game/Code/Menu/UMenu.pas index 339402a2..6a5cb0ff 100644 --- a/Game/Code/Menu/UMenu.pas +++ b/Game/Code/Menu/UMenu.pas @@ -28,6 +28,8 @@ type BackImg: TTexture; BackW: integer; BackH: integer; + + fFileName : string; public Text: array of TText; Static: array of TStatic; @@ -181,6 +183,9 @@ begin //Set ButtonPos to Autoset Length ButtonPos := -1; + + + VideoPlayback.Init; end; { constructor TMenu.Create(Back: String); @@ -290,17 +295,23 @@ begin end; procedure TMenu.AddBackground(Name: string); -var - lFileName : string; +//var +// lFileName : string; begin if Name <> '' then begin - lFileName := Skin.GetTextureFileName(Name); - lFileName := AdaptFilePaths( lFileName ); + fFileName := Skin.GetTextureFileName(Name); + fFileName := AdaptFilePaths( fFileName ); - if fileexists( lFileName ) then + if fileexists( fFileName ) then begin - BackImg := Texture.GetTexture( lFileName , 'Plain'); + BackImg := Texture.GetTexture( fFileName , 'Plain'); + + if ( BackImg.TexNum = 0 ) then + begin + if VideoPlayback.Open( fFileName ) then + VideoPlayback.Play; + end; BackImg.W := 800; BackImg.H := 600; @@ -733,6 +744,7 @@ var PetX: integer; PetY: integer; begin + BackImg.ColR := 1; BackImg.ColG := 1; BackImg.ColB := 1; @@ -740,7 +752,8 @@ begin BackImg.TexY1 := 0; BackImg.TexX2 := 1; BackImg.TexY2 := 1; - if (BackImg.TexNum <> -1) then begin + if (BackImg.TexNum <> -1) then + begin // does anyone know what these loops were for? { // draw texture with overlapping for PetY := 1 to BackH do @@ -758,6 +771,14 @@ begin BackImg.H := 600; DrawTexture(BackImg); end; // if + + +// if assigned( VideoPlayback ) then + begin + VideoPlayback.GetFrame( now() ); + VideoPlayback.DrawGL(2); + end; + end; function TMenu.DrawFG: boolean; @@ -1513,6 +1534,18 @@ procedure TMenu.onShow; begin // nothing // beep; + + if fileexists( fFileName ) then + begin + // BackImg := Texture.GetTexture( fFileName , 'Plain'); + + if ( BackImg.TexNum = 0 ) then + begin + if VideoPlayback.Open( fFileName ) then + VideoPlayback.Play; + end; + end; + end; procedure TMenu.onShowFinish; |