Page 1 of 1

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

Posted: Wed Jan 29, 2020 4:50 am
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.

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

Posted: Thu Jan 30, 2020 10:19 pm
by airsoftsoftwair
Ok, will be fixed.

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

Posted: Sun Aug 23, 2020 11:43 am
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