Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 05-08-2024, 07:17
Fak Eid Fak Eid is offline
Registered User
 
Join Date: Jun 2023
Location: Mars
Posts: 147
Thanks: 98
Thanked 152 Times in 54 Posts
Fak Eid is on a distinguished road
Custom Slideshow and Generic WebView Example

Real life examples are in Epic Games Installer

Generic WebView Example
You can reuse the attached WebView.html like this:

Code:
[Files]
Source: "Files\Web\WebView.html"; DestDir: "{tmp}"; Flags: dontcopy;
Code:
procedure LoadHtmlContent(Width, Height: Integer; SrcURL: WideString);
var
  sHtml, VideoId: Widestring;
  sTemplate: AnsiString;
  Sl: TStringList;
begin
  VideoId := Copy(SrcURL, Pos('v=', SrcURL) + 2, 11);
  LoadStringFromFile(ExtractAndLoad('WebView.html'), sTemplate);
  sHtml := Format(sTemplate, [Width, Height, VideoId]);

  Sl := TStringList.Create;
  try
    Sl.Text := sHtml;
    Sl.SaveToFile(ExpandConstant('{tmp}\WebView.html'));
  finally
    Sl.Free;
  end;
end;
Code:
LoadHtmlContent(680, 384, 'https://www.youtube.com/ watch?v=hS7ZY7oLCS4&ab_channel=RANDOMGAMERTAGS');

TrailerRect.FCreate(FMXForm.Handle);
TrailerRect.SetBounds(250, 145, 680, 383);
TrailerRect.Opacity(0);
TrailerRect.HitTest(False);

TrailerWebView.FCreate(FMXForm.Handle, TrailerRect.Handle, ExpandConstant('{tmp}\WebView.html'));
TrailerWebView.Start;
Custom Image Slideshow
The need for this was because both type of Image Slideshow were dependent on FMXForm and couldn't be overlayed with a different component. Hence, I had to go with creating my own.

Code:
j: Integer;
GameImage: FImage;
SlideShowTimer: FTimer;
Code:
GameImage.FCreate(FMXForm.Handle);
GameImage.SetBounds(250, 145, 680, 383);
GameImage.LoadPicture(ExtractAndLoad('Image0.jpg'), iwStretch);
GameImage.Opacity(1);

SlideShowTimer.FCreate(GameImage.Handle, True);
SlideShowTimer.Interval(100);
SlideShowTimer.OnTimer(@ChangeSlide);
Code:
procedure ChangeSlide(Sender: TObject);
var
  Time: Cardinal;
  SlideOpacity: Single;
begin
  if GameImage.GetOpacity = 1 then Slider := False
  else if GameImage.GetOpacity = 0 then begin
    GameImage.LoadPicture(ExtractAndLoad('Image' + IntToStr(j) +'.jpg'), iwStretch);
    j := j+1;
    Slider := True;
  end;

  if (Slider = False) and not (GameImage.GetOpacity = 0) then SlideOpacity := GameImage.GetOpacity - 0.05
  else if (Slider = True) and not(GameImage.GetOpacity = 1) then SlideOpacity := GameImage.GetOpacity + 0.05;
  GameImage.Opacity(SlideOpacity);

  #ifdef NumberOfSlides
  if j = {#NumberOfSlides} then j := 0;
  #endif
end;
What is NumberOfSlides?
Settings.ini has a parameter as Number of Slides where you need to define the number of Image Files from the folder, to be included in the slideshow.
Attached Images
File Type: gif Fak Eid SlideShow.gif (1.92 MB, 182 views)
Attached Files
File Type: rar WebView.rar (620 Bytes, 16 views)

Last edited by Fak Eid; 05-08-2024 at 07:59.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM BLACKFIRE69 Conversion Tutorials 0 15-11-2023 17:35
Windows Phone Installer similar to razor12911's original design? Kitsune1982 Conversion Tutorials 0 02-07-2020 13:04
INDEX - Conversion Tutorial Index Razor12911 Conversion Tutorials 5 11-06-2020 02:05
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



All times are GMT -7. The time now is 09:36.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com