@Display and brush (of CreateBrush) not work

Report any Hollywood bugs here
Post Reply
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

@Display and brush (of CreateBrush) not work

Post by sinisrus »

Hello,

Is it a bug ??

Code: Select all

CreateBrush(2,10,10,#BLUE)
    SelectBrush(2)
    BOX(0,0,10,10,#GREEN)
    EndSelect

@DISPLAY 1, {fillstyle=#FILLTEXTURE,TextureBrush=2} ; => Not work

SetDisplayAttributes({fillstyle=#FILLTEXTURE,TextureBrush=2}) ; => Good Work
I have this problem with @DISPLAY (Brush, TextureBrush, BGPic, ...)
User avatar
jPV
Posts: 734
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: @Display and brush (of CreateBrush) not work

Post by jPV »

It's not a bug. @DISPLAY is a preprocessor command which is processed before anything else in the script, no matter on which line it's located, so your display is created before your CreateBrush() command and that's why it doesn't work.

You should create the display with CreateDisplay() and OpenDisplay() if you want to use some content that's created within the script. Or keep the defaut display hidden (Hidden=True), change the attributes you want, and then open it manually when you've made all you need.
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: @Display and brush (of CreateBrush) not work

Post by sinisrus »

@JPV

Thanks for the explanation
Post Reply