Display problems

Find quick help here to get you started with Hollywood
Post Reply
SpawnPPC
Posts: 61
Joined: Fri Mar 15, 2024 11:51 pm

Display problems

Post by SpawnPPC »

Hello.

I ran into another problem.
The code I put at the bottom of this text has been improved and perfected also thanks to the users of this forum who helped me.
I was interested in solving a problem with the Mode=Ask attribute that did not recognize me exactly in Window or FullScreen mode. This problem has been solved.
But now this is happening:
- If you choose Window, a window opens as in Debug but you can see that it is much smaller than it should be
- If you choose the FullScreen 800x600 mode for example, a full screen opens but the resolution is different, in this case 640x480 and obviously it is not clear if the opened screen is 80x600 or 640x5480 for example, but it is certainly a low resolution... anyway the debugging gives me as 640x480 against 800x600 selected

I am certainly wrong, but in detail this code does very little:
- declares a hidden 320x200 Display(10) convenience screen
- Closes and frees the resources of Display(1) which is usually the Hollywood one
- Reopens a new Display(1) asking what type of display he wants
- If the user chooses Window, it opens a Window of the resolution pre-established by the variables in play
- If the user chooses Full Screen opens a new screen of the chosen resolution
- writes all the values ​​of the variables on the Debug

Changing ID from 1 to 5 for example the result does not change.
Also in the full screen mode some graphic glitches appear that I can not make disappear.
It is noted that the Windows Debug IDE has a display bug. You have to pass the mouse highlighting the area to show some Debug results otherwise hidden.

Any ideas?

bySpawnPPC

-------------------------------------------------------------

Code: Select all


@DISPLAY 10, {Width = 320, Height = 200, Hidden = True}
Global ScreenWidth, ScreenHeight; Variabili globali per la risoluzione dello schermo
Global WinWidth, WinHeight; Variabili globali per le dimensioni della finestra
Global XPos, YPos; Varibili globali per le dimensioni della finestra

Function SceltaDisplay()
    SelectDisplay(10)
    CloseDisplay(1)
    FreeDisplay(1)
    ScreenWidth = GetAttribute(#DISPLAY,Nil , #ATTRHOSTWIDTH); HOST S.O.
    ScreenHeight = GetAttribute(#DISPLAY,Nil , #ATTRHOSTHEIGHT); HOST S.O.
    DebugPrint(ScreenWidth, ScreenHeight)
    Local Margine
    Local GestioneLayout
    If ScreenWidth <= 800
	Margine = 10
	GestioneLayout = 0
    ElseIf ScreenWidth > 800 And ScreenWidth <= 1920
	Margine = 100
	GestioneLayout = 0
    ElseIf ScreenWidth > 1920 And ScreenWidth <= 2560
	Margine = 200
	GestioneLayout = 0
    ElseIf ScreenWidth > 2560
	Margine = 300
	GestioneLayout = 0
    EndIf
    DebugPrint (Margine, GestioneLayout)
    WinWidth = ScreenWidth - (2 * Margine)
    WinHeight = ScreenHeight - (2 * Margine)
    XPos = (ScreenWidth - WinWidth) / 2
    YPos = (ScreenHeight - WinHeight) / 2
    DebugPrint(WinWidth, WinHeight)
    DebugPrint(XPos, YPos)
    Width = WinWidth
    Height = WinHeight
    X = XPos
    Y = YPos
    DebugPrint(Width, height)
    DebugPrint(X, Y)
    CreateDisplay(1, {Width, Height, X, Y, Title = "", Borderless = True, Fixed = True, Mode = "Ask",})
    OpenDisplay(1)
    SelectDisplay(1)
    Local DisplayMode
    DisplayMode = GetAttribute(#DISPLAY, 1, #ATTRMODE)
    If DisplayMode = #DISPMODE_WINDOWED
        DebugPrint("WINDOW")
    ElseIf DisplayMode = #DISPMODE_FULLSCREEN
        DebugPrint("FULLSCREEN")
    EndIf
    If DisplayMode = #DISPMODE_FULLSCREEN
	ScreenWidth = GetAttribute(#DISPLAY, 1, #ATTRWIDTH)
	ScreenHeight = GetAttribute(#DISPLAY, 1, #ATTRHEIGHT)
	WinWidth = ScreenWidth
	WinHeight = ScreenHeight
    EndIf
    DebugPrint(ScreenWidth, ScreenHeight)
    DebugPrint(WinWidth, WinHeight)
    Wait(5, #SECONDS)
    End
EndFunction

Function Main()
	
    SceltaDisplay()

    ; Attesa dell'evento (interazione con l'utente)
    Repeat
	WaitEvent
    Forever

EndFunction

; Avvio del programma principale
Main()

plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Display problems

Post by plouf »

i think you are searching for these commands

Code: Select all

 
DebugPrint(GetAttribute(#DISPLAY, 1, #ATTRRAWWIDTH ).. " x " ..GetAttribute(#DISPLAY, 1, #ATTRRAWHEIGHT))
Christos
SpawnPPC
Posts: 61
Joined: Fri Mar 15, 2024 11:51 pm

Re: Display problems

Post by SpawnPPC »

Thanx I will try !

bySpawnPPC
SpawnPPC
Posts: 61
Joined: Fri Mar 15, 2024 11:51 pm

Re: Display problems

Post by SpawnPPC »

Hello everyone!

I managed to solve most of the problems. The glitches remain when the user chooses to open a full screen. Also, the commands to capture the parameters of the new display, when the user chooses Full Screen, are wrong on Debug. In the sense that I choose to open a 800x600 screen, Hollywood actually opens it, but if I go to capture the attributes of the full screen just created it tells me that it is 1720x880.

Where am I going wrong?

Thanks

Emanuele

-------------------------------------------------------------

Code: Select all


@DISPLAY 10, {Width = 320, Height = 200, Hidden = True}
Global ScreenWidth, ScreenHeight; Variabili globali per la risoluzione dello schermo
Global WinWidth, WinHeight; Variabili globali per le dimensioni della finestra
Global XPos, YPos; Varibili globali per le dimensioni della finestra

Function SceltaDisplay()
    SelectDisplay(10)
    CloseDisplay(1)
    ScreenWidth = GetAttribute(#DISPLAY,Nil , #ATTRHOSTWIDTH)
    ScreenHeight = GetAttribute(#DISPLAY,Nil , #ATTRHOSTHEIGHT)
    DebugPrint(ScreenWidth, ScreenHeight)
    Local Margine
    Local GestioneLayout
    If ScreenWidth <= 800
	Margine = 10
	GestioneLayout = 0
    ElseIf ScreenWidth > 800 And ScreenWidth <= 1920
	Margine = 100
	GestioneLayout = 0
    ElseIf ScreenWidth > 1920 And ScreenWidth <= 2560
	Margine = 200
	GestioneLayout = 0
    ElseIf ScreenWidth > 2560
	Margine = 300
	GestioneLayout = 0
    EndIf
    DebugPrint (Margine, GestioneLayout)
    WinWidth = ScreenWidth - (2 * Margine)
    WinHeight = ScreenHeight - (2 * Margine)
    XPos = (ScreenWidth - WinWidth) / 2
    YPos = (ScreenHeight - WinHeight) / 2
    DebugPrint(WinWidth, WinHeight)
    DebugPrint(XPos, YPos)
    CreateDisplay(1, {Width = WinWidth, Height = WinHeight, X = XPos, Y=YPos, Title = "", Borderless = True, Fixed = True, Mode = "Ask", AlwaysOnTop = True})
    SelectDisplay(1)
    OpenDisplay(1)
    Local DisplayMode
    DisplayMode = GetAttribute(#DISPLAY, 1, #ATTRMODE)
    If DisplayMode = #DISPMODE_WINDOWED
	DebugPrint("WINDOW")
    ElseIf DisplayMode = #DISPMODE_FULLSCREEN
	DebugPrint("FULLSCREEN")
	ScreenWidth = GetAttribute(#DISPLAY, 1, #ATTRWIDTH)
	ScreenHeight = GetAttribute(#DISPLAY, 1, #ATTRHEIGHT)
	WinWidth = ScreenWidth
	WinHeight = ScreenHeight
    EndIf
    DebugPrint(ScreenWidth, ScreenHeight)
    DebugPrint(WinWidth, WinHeight)
    Wait(5, #SECONDS)
    End
EndFunction

Function Main()
	
    SceltaDisplay()

    ; Attesa dell'evento (interazione con l'utente)
    Repeat
	WaitEvent
    Forever

EndFunction

; Avvio del programma principale
Main()

plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Display problems

Post by plouf »

you have "dig" DISPLAY more than anyone until now :), seems you found some "misprogrammings" in its operations
i dont know that deep, but i check what you said, just fo curiosity.

Seems tan using mode="Ask" hollywood makes some decisions by its own, with requester
using mode="Fullscreen" you get correct results

maybe its a "misprogramming" report it to bugs !

Here is what i try
- As you see with fullscreen you get correct results
- with requester, no matter what you choose , width changes but height remains at hollywood dimensions, like hardcoded

Code: Select all

CreateDisplay(2, {width=800,height=600,Mode = "fullscreen", Active=True})
OpenDisplay(2)
  	
NPrint("Current"..GetAttribute(#DISPLAY, 2, #ATTRRAWWIDTH ).. " x " ..GetAttribute(#DISPLAY, 2, #ATTRRAWHEIGHT))
NPrint("MAX ..."..GetAttribute(#DISPLAY, 2,#ATTRMAXWIDTH ).. " x " ..GetAttribute(#DISPLAY, 2, #ATTRRAWHEIGHT))
WaitLeftMouse()
CloseDisplay(2)

CreateDisplay(3, {width=800,height=600,ScrWidth=#NATIVE, ScrHeight=#NATIVE,Mode = "ModeRequester", Active=True})
OpenDisplay(3)
  	
NPrint("Current"..GetAttribute(#DISPLAY, 3, #ATTRRAWWIDTH ).. " x " ..GetAttribute(#DISPLAY, 3, #ATTRRAWHEIGHT))
NPrint("MAX ..."..GetAttribute(#DISPLAY, 3,#ATTRMAXWIDTH ).. " x " ..GetAttribute(#DISPLAY, 3, #ATTRRAWHEIGHT))
WaitLeftMouse()
Christos
SpawnPPC
Posts: 61
Joined: Fri Mar 15, 2024 11:51 pm

Re: Display problems

Post by SpawnPPC »

Hello and thank you!

I think the Hollywood manual is lacking in very few examples and inaccuracies, as well as details. Opening and closing a screen should be very simple, yet in Hollywood I find it very complex.
Sometimes it seems that everything works perfectly, other times it seems that Hollywood ignores my commands and does as it pleases.

To date I have not yet managed to load a very simple Logo in the position I want within a new screen. Incredible!!!

Among other things, it seems that they do not respond to direct emails from users... I mean, I have always spent money on their software... do I not have the right to some clarifications? I am certainly the one who is wrong, but an answer would be appreciated.

Anyway, I will try to open a new Topic and see if someone of good will can help me.

Thank you all from the bottom of my heart!

SpawnPPC
User avatar
jPV
Posts: 734
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Display problems

Post by jPV »

SpawnPPC wrote: Sat Nov 16, 2024 12:22 amThe glitches remain when the user chooses to open a full screen.
What kind of glitches? A quick glimpse of a grey screen before it renders to black?

You could also have the display 1 as hidden from the start to avoid it popping up briefly when you launch the program.
@DISPLAY 1, {Width = 1, Height = 1, Hidden = True}

Also, the commands to capture the parameters of the new display, when the user chooses Full Screen, are wrong on Debug. In the sense that I choose to open a 800x600 screen, Hollywood actually opens it, but if I go to capture the attributes of the full screen just created it tells me that it is 1720x880.
You are calculating this kind of values to WinWidth and WinHeight, and then giving them to the CreateDisplay, which then tries to create a screen according these non-standard values. I would open standard sized displays (screens) and then use marginals later when drawing something on the screen.

On Amiga it also depends which kind of screenmodes you have defined in the system, if you try to open 1720x880 screen and haven't configured such a screenmode, it takes the closest resolution screenmode it finds.

To date I have not yet managed to load a very simple Logo in the position I want within a new screen. Incredible!!!
Why not? Just DisplayBrush() in any position you want, or centered.

Among other things, it seems that they do not respond to direct emails from users...
Andreas usually responds pretty quickly both emails and in this forum. For some reason he's been quiet here lately, maybe he's really busy with something at the moment. Customer service has been top-notch earlier.
Flinx
Posts: 342
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: Display problems

Post by Flinx »

SpawnPPC wrote: Mon Nov 18, 2024 1:11 am To date I have not yet managed to load a very simple Logo in the position I want within a new screen. Incredible!!!
It's not THAT complicated.
Show us an example and surely someone will try to help.
If you're interested, I've copied a few lines from my current project. All you need is any SVG file (replace the name in the second line).

Code: Select all

EnableLayers()
@BRUSH 23, "Graphics/L1015.svg"
gLRCdisplay=1
gDisplayHeight=GetAttribute(#DISPLAY, gLRCdisplay, #ATTRHEIGHT)
gDisplayWidth=GetAttribute(#DISPLAY, gLRCdisplay, #ATTRWIDTH)

Function p_ScaleSVG(brushid, layername$, xpos, ypos, svgButtonWidth, svgButtonHeight, svghidden)
	Local svgW=GetAttribute(#BRUSH,brushid,#ATTRWIDTH)
	Local svgH=GetAttribute(#BRUSH,brushid,#ATTRHEIGHT)

	; einpassen und zentrieren
	Local svgScale=svgButtonWidth/svgW
	Local svgYPosOffs=(svgButtonHeight-svgH*svgScale)/2
	Local svgXPosOffs=0
	If svgScale>svgButtonHeight/svgH
		svgScale=svgButtonHeight/svgH
		svgXPosOffs=(svgButtonWidth-svgW*svgScale)/2
		svgYPosOffs=0
	EndIf
	If svgScale<=0 Then svgScale=1e-10
	DisplayBrush(brushid, xpos+svgXPosOffs, ypos+svgYPosOffs,
		     {Name=layername$, Hidden=svghidden,
		     Transparency=0,
		     ScaleX=svgScale, ScaleY=svgScale})
EndFunction ;p_ScaleSVG()


p_ScaleSVG(23, "L",0, gDisplayHeight/3, gDisplayWidth, gDisplayHeight/2.5, False)

Wait(1,#SECONDS)

aobj2=RemoveLayerFX("L", {Type = #CROSSFADE, Speed = 5, Async=True})
Repeat
	If Not done Then done=AsyncDrawFrame(aobj2)
	VWait
Until done
FreeBrush(23)


User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Display problems

Post by airsoftsoftwair »

SpawnPPC wrote: Mon Nov 18, 2024 1:11 am Among other things, it seems that they do not respond to direct emails from users... I mean, I have always spent money on their software... do I not have the right to some clarifications? I am certainly the one who is wrong, but an answer would be appreciated.
Sorry, I've been very busy lately. I'll answer all e-mails but it can take some time. For Hollywood programming questions it's highly recommended to use the forums instead because it gives other users the chance to help as well and that leaves more time to improve Hollywood for me ;)
Post Reply