Display and screens

Find quick help here to get you started with Hollywood
Post Reply
ilbarbax
Posts: 115
Joined: Thu Apr 01, 2010 6:41 pm

Display and screens

Post by ilbarbax »

Hi,

I'm programming a application with multiple displays and asyncronus FX on the different displays. At the moment is working fine, however I have two questions.
1. How to open a display with transparent backgroud? (I already defined a background for the screen and I want to have it in the display as well)
2. How can I output anything to the screen rather than to one of the opened display
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Display and screens

Post by airsoftsoftwair »

ilbarbax wrote: I'm programming a application with multiple displays and asyncronus FX on the different displays. At the moment is working fine, however I have two questions.
1. How to open a display with transparent backgroud? (I already defined a background for the screen and I want to have it in the display as well)
Just create a BGPic that has transparent areas (either through a mask or an alpha channel). Look at the WBApple or EuroCalc examples.
ilbarbax wrote: 2. How can I output anything to the screen rather than to one of the opened display
That's not possible. Hollywood can't draw to the screen directly, only to displays.
ilbarbax
Posts: 115
Joined: Thu Apr 01, 2010 6:41 pm

Re: Display and screens

Post by ilbarbax »

No clue to write on the transparent display.



CreateBrush(99, dw-644, dh-136-130-5, #BLUE, {AlphaChannel = True, Clear = True})
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(5, {BGPic = 99, X = 643, Y = 137, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(5)
SelectDisplay(5)
TextOut(#CENTER,#CENTER,"111111")

it does not print 11111. If I remove clear option it works fine, but obviously without transparency but having a blue background.
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Display and screens

Post by djrikki »

Hi,

How do I retrieve the current screen resolution? Is there a Hollywood constant or command for this?

Alternatively is there a C: command for this?
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Display and screens

Post by djrikki »

Nevermind! ;p

Found the great GetAttribute() command, some useful functionality in that command I see.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Display and screens

Post by airsoftsoftwair »

ilbarbax wrote:No clue to write on the transparent display.



CreateBrush(99, dw-644, dh-136-130-5, #BLUE, {AlphaChannel = True, Clear = True})
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(5, {BGPic = 99, X = 643, Y = 137, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(5)
SelectDisplay(5)
TextOut(#CENTER,#CENTER,"111111")

it does not print 11111. If I remove clear option it works fine, but obviously without transparency but having a blue background.
That's normal behaviour. You're creating a fully transparent BGPic with alpha channel here. You won't be able to draw anything to this BGPic because it's fully transparent. Remember that the transparent areas of a BGPic act as a mask: You won't be able to draw on them. Drawing operations will only be visible on non-transparent areas of your BGPic!

If you want to have a transparent BGPic with the text "111111" on it, you need to draw this text to the BGPic *before* actually displaying the BGPic, i.e.

Code: Select all

CreateBrush(99, dw-644, dh-136-130-5, #BLUE, {AlphaChannel = True, Clear = True})
SelectAlphaChannel(99)
TextOut(#CENTER,#CENTER,"111111")
EndSelect
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(5, {BGPic = 99, X = 643, Y = 137, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(5)
This should work!
ilbarbax
Posts: 115
Joined: Thu Apr 01, 2010 6:41 pm

Re: Display and screens

Post by ilbarbax »

Thanks Andreas, another brick is in position on my mind. However I need a dynamic behaviour having the possibility to write on the display at different times.

I Have anyway sorted out the situation using GrabDesktop command as follow:

Function NewBGDisplay(dsp, xa, ya, wa, ha)
GrabDesktop(99,{X = xa, Y = ya,Width=wa, Height=ha})
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(dsp, {BGPic = 99, X = xa, Y = ya, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(dsp)
EndFunction
Post Reply