Page 1 of 1

@Display and brush (of CreateBrush) not work

Posted: Wed Oct 26, 2022 11:35 am
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, ...)

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

Posted: Wed Oct 26, 2022 12:10 pm
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.

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

Posted: Wed Oct 26, 2022 2:08 pm
by sinisrus
@JPV

Thanks for the explanation