SetDisplayAtrributes x & y don't work except for positional constants

Report any Hollywood bugs here
Post Reply
NathanH
Posts: 26
Joined: Sun Jul 05, 2015 1:29 am

SetDisplayAtrributes x & y don't work except for positional constants

Post by NathanH » 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

User avatar
emeck
Posts: 80
Joined: Fri Apr 03, 2015 3:17 pm

Re: SetDisplayAtrributes x & y don't work except for positional constants

Post by emeck » Sun Nov 17, 2019 7:03 am

Tested under MOS3.12 and same behaviour.

But this works as a quick fix:

horizontal=#LEFT + 150
vertical=#TOP + 150
PowerBook 5.2 MorphOS 3.12
PowerBook 5.8 MorphOS 3.12
Amiga 1200 BPPC/BVision AOS4.1 FE

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

Re: SetDisplayAtrributes x & y don't work except for positional constants

Post by airsoftsoftwair » Sun Nov 17, 2019 1:27 pm

Yes, looks like a bug. Will be fixed.

NathanH
Posts: 26
Joined: Sun Jul 05, 2015 1:29 am

Re: SetDisplayAtrributes x & y don't work except for positional constants

Post by NathanH » Sun Nov 17, 2019 11:30 pm

Thanks very much to both of you!

NathanH

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

Re: SetDisplayAtrributes x & y don't work except for positional constants

Post by airsoftsoftwair » Sat Dec 14, 2019 1:07 pm

Code: Select all

- Fix: When changing display size and position in one SetDisplayAttributes() call, SetDisplayAttributes()
  automatically centered the display in case the coordinates passed in "X" and "Y" were identical to the
  current display position

Post Reply