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

Report any Hollywood bugs here
Post Reply
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

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

Post by NathanH »

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: 169
Joined: Fri Apr 03, 2015 3:17 pm

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

Post by emeck »

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.15
PowerBook 5.8 MorphOS 3.15
Amiga 1200 BPPC/BVision AOS4.1 FE
User avatar
airsoftsoftwair
Posts: 5443
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 »

Yes, looks like a bug. Will be fixed.
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

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

Post by NathanH »

Thanks very much to both of you!

NathanH
User avatar
airsoftsoftwair
Posts: 5443
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 »

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