SetDisplayAtrributes x & y don't work except for positional constants
Posted: Sun Nov 17, 2019 1:22 am
Hi,
I'm running Hollywood 8 on both WinUAE OS3.9 and AROS i-386. I would expect the following code to keep the changing display at coordinates (150, 150). It doesn't, it shifts to the center of the screen instead. If you use position constants (e.g., horizontal=#CENTER and vertical=#TOP) things work as expected. The display stays at the top of the screen. I thought that I could remedy this problem by using MoveDisplay() at the end of the function to place the display where I want it. Try uncommenting this line and the display appears to jump to random positions with each click. Seems like a bug to me and I haven't been able to find a work-around for my project. Thanks.
NathanH
@DISPLAY {width=60, height=60, borderless=True, DragRegion={{Type=#BOX, X=0, Y=0, Width=60, Height=60}}}
horizontal=150
vertical=150
dwidth=60
dheight=60
dcolor=#BLACK
gtype=#CONICAL
color1=#TEAL
color2=#BLUE
gangle=15
Function p_ChangeSize()
dwidth=10+Rnd(100)
dheight=10+Rnd(100)
SetDisplayAttributes({x=horizontal, y=vertical, width=dwidth, height=dheight, color=dcolor})
SetFillStyle(#FILLGRADIENT,gtype, color1, color2, gangle)
SetDisplayAttributes({DragRegion={{Type=#BOX, X=0, Y=0, Width=dwidth, Height=9}}})
Box(0, 9, dwidth, dheight-9)
Line(0, 0, 0, dheight, #WHITE)
;MoveDisplay(horizontal, vertical)
EndFunction
InstallEventHandler({OnMouseUp=p_ChangeSize})
p_ChangeSize()
Repeat
WaitEvent
Forever
I'm running Hollywood 8 on both WinUAE OS3.9 and AROS i-386. I would expect the following code to keep the changing display at coordinates (150, 150). It doesn't, it shifts to the center of the screen instead. If you use position constants (e.g., horizontal=#CENTER and vertical=#TOP) things work as expected. The display stays at the top of the screen. I thought that I could remedy this problem by using MoveDisplay() at the end of the function to place the display where I want it. Try uncommenting this line and the display appears to jump to random positions with each click. Seems like a bug to me and I haven't been able to find a work-around for my project. Thanks.
NathanH
@DISPLAY {width=60, height=60, borderless=True, DragRegion={{Type=#BOX, X=0, Y=0, Width=60, Height=60}}}
horizontal=150
vertical=150
dwidth=60
dheight=60
dcolor=#BLACK
gtype=#CONICAL
color1=#TEAL
color2=#BLUE
gangle=15
Function p_ChangeSize()
dwidth=10+Rnd(100)
dheight=10+Rnd(100)
SetDisplayAttributes({x=horizontal, y=vertical, width=dwidth, height=dheight, color=dcolor})
SetFillStyle(#FILLGRADIENT,gtype, color1, color2, gangle)
SetDisplayAttributes({DragRegion={{Type=#BOX, X=0, Y=0, Width=dwidth, Height=9}}})
Box(0, 9, dwidth, dheight-9)
Line(0, 0, 0, dheight, #WHITE)
;MoveDisplay(horizontal, vertical)
EndFunction
InstallEventHandler({OnMouseUp=p_ChangeSize})
p_ChangeSize()
Repeat
WaitEvent
Forever