#LAYERBUTTON Area Not Matching Image (Problem on Windows, Not Amiga)

Report any Hollywood bugs here
Post Reply
PEB
Posts: 569
Joined: Sun Feb 21, 2010 1:28 am

#LAYERBUTTON Area Not Matching Image (Problem on Windows, Not Amiga)

Post by PEB »

This is a problem that only shows up when a menu is attached to a display that has a background with an alpha channel.

The following code (based upon the "AlphaApple" Hollywood example script) demonstrates this problem (not on Amiga, but on Windows):

Code: Select all

@BGPIC 1, "appleimg.png", {LoadAlpha = True}
@MENU 1, {{"Test", {{"Test", ID = "Test"}}}}
@DISPLAY {Borderless = True, DragRegion = {{X = 0, Y = 0, Width = 528, Height = 535}}, Menu = 1}

EscapeQuit(True)
EnableLayers()

CreateBrush(1, 50, 50)
DisplayBrush(1, #CENTER, #CENTER, {Name="Button"})

Function p_ButtonFunc(msg)
	Switch msg.action
		Case "OnMouseOver"
			SetLayerStyle("Text", {Text="Over"})
		Case "OnMouseOut"
			SetLayerStyle("Text", {Text="Out"})
	EndSwitch
EndFunction
Button$={OnMouseOver=p_ButtonFunc, OnMouseOut=p_ButtonFunc}
MakeButton(1, #LAYERBUTTON, "Button", False, True, Button$)

TextOut(#CENTER, #CENTER, "", {Name="Text", AnchorX=0.5})

Repeat
	WaitEvent
Forever
If you test this code on an Amiga, it will work as it should, since Amiga allows for a floating menu (not attached to the display.) However, if you test this code on a Windows machine, you will notice that the menu (though invisible) causes the button area to be about 20 pixels lower than the button image.

If the button area needs to be shifted down because of the menu, then the button image should also be shifted down (so they match). However, if it would be possible for the button area not to shift down, I think that would be preferable.
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: #LAYERBUTTON Area Not Matching Image (Problem on Windows, Not Amiga)

Post by airsoftsoftwair »

Ok, will be fixed.
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: #LAYERBUTTON Area Not Matching Image (Problem on Windows, Not Amiga)

Post by airsoftsoftwair »

Code: Select all

- Fix [Windows]: Hollywood will no longer try to install a menu for transparent windows; this doesn't make
  sense on Windows and caused some problems with mouse events 
Post Reply