Page 1 of 1

[17 Feb 2008] Problem with "Backfill" option

Posted: Sat Jun 13, 2020 5:31 pm
by Clyde
Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 17 Feb 2008 20:36:15 +0100

Hi there!

I have a strange problem with the backfill option of the Display preprocessor command. I wanted to have a window with a gradiant background, so I wrote this in my script at the beginning:

Code: Select all

@DISPLAY {Title = "Enterprise NX-01", X = #LEFT, Y = #TOP, Width = 320, Height = 240, Backfill = {Type ="Gradient", StartColor = #BLACK, EndColor = #BLUE}}
When I start my programme, my normal window with 320 width and 240 height appears, but with black background. _Additionally_ a second screen or sth is opend, which lays in the background of my programme window but in front of my workbench icons and _this_ screen has the black to blue gradiant!? Do you have any idea what I did wrong?

For test reasons I added the following command after the @DISPLAY:

Code: Select all

@BGPIC 1, "AmiKit:Prefs/Presets/Backdrops/Magic.jpg"
This works pretty fine, the jpg is loaded as the background of my programme window.

Also, I tried this code, but it fails with sth like "A value was expected!", in German "Es wurde ein Wert erwartet!" and points to the following line:

Code: Select all

@DISPLAY {Title = "Enterprise NX-01", X = #LEFT, Y = #TOP, Width = 320, Height = 240, Backfill = {Type = "Picture", Brush="AmiKit:Prefs/Presets/Backdrops/Magic.jpg", X = #CENTER, Y = #CENTER}}
Thanks in advance!

Micha

[19 Feb 2008] Re: Problem with "Backfill" option

Posted: Sat Jun 13, 2020 5:31 pm
by lazi
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 19 Feb 2008 09:42:40 +0100

Hello Michael

The same behaviour happens for me too. I do not know that if it is a feature or a bug, but use the following to the desired effect:

Code: Select all

@DISPLAY{Title="Enterprise NX-01",Width=320,Height=240}

CreateGradientBGPic(0,#LINEAR,#BLACK,#BLUE)
DisplayBGPic(0)

repeat
waitevent
forever

[19 Feb 2008] Re: Problem with "Backfill" option

Posted: Sat Jun 13, 2020 5:31 pm
by Clyde
Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 19 Feb 2008 08:57:07 -0000

Hi Lázi,

thanks a lot for your answer, I will test it this evenning.

Would be interesting what Andreas says, whether it is a bug or not.

Thanks again!

Greetings

[20 Feb 2008] Re: Problem with "Backfill" option

Posted: Sat Jun 13, 2020 5:31 pm
by airsoftsoftwair
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 20 Feb 2008 00:51:05 +0100
Hi there!

I have a strange problem with the backfill option of the Display preprocessor command. I wanted to have a window with a gradiant background, so I wrote this in my script at the beginning:

Code: Select all

@DISPLAY {Title = "Enterprise NX-01", X = #LEFT, Y = #TOP, Width = 320, Height = 240, Backfill = {Type ="Gradient", StartColor = #BLACK, EndColor = #BLUE}}
When I start my programme, my normal window with 320 width and 240 height appears, but with black background. _Additionally_ a second screen or sth is opend, which lays in the background of my programme window but in front of my workbench icons and _this_ screen has the black to blue gradiant!? Do you have any idea what I did wrong?
Nothing, that's the normal behaviour. Backfills always occupy the whole screen area behind the Hollywood window. They can be used to blank out the Workbench etc.

If you want a gradient background, use CreateGradientBGPic().
For test reasons I added the following command after the @DISPLAY:

Code: Select all

@BGPIC 1, "AmiKit:Prefs/Presets/Backdrops/Magic.jpg"
This works pretty fine, the jpg is loaded as the background of my programme window.

Also, I tried this code, but it fails with sth like "A value was expected!", in German "Es wurde ein Wert erwartet!" and points to the following line:

Code: Select all

@DISPLAY {Title = "Enterprise NX-01", X = #LEFT, Y = #TOP, Width = 320, Height = 240, Backfill = {Type = "Picture", Brush="AmiKit:Prefs/Presets/Backdrops/Magic.jpg", X = #CENTER, Y = #CENTER}}
This line works here. Are you sure it is this line causing the error?

Remember that preprocessor commands cannot handle variables so stuff like

Code: Select all

@DISPLAY {Width = scrwidth, Height = scrheight}
won't work. You must pass constant expressions to them. But the above line is fine. #CENTER is a constant and thus can be used in the preprocessor.