Name
CreateDisplay -- create a new display (V4.5)
Synopsis
[id] = CreateDisplay(id[, table])
Function
This function can be used to create a new display which you can open using OpenDisplay(). You have to pass an identifier for the new display or Nil. If you pass Nil, CreateDisplay() will return a handle to the new display which you can then use to refer to this display.

Furthermore, you should pass a table in the second argument to configure the style for the new display. Please note that every display must have a BGPic associated with it. Thus, it is advised that you always specify the BGPic tag in the optional table when creating a display. If you do not specify the BGPic tag, CreateDisplay() will create a new BGPic for the new display automatically. The newly created BGPic will be of the size specified in Width and Height and it will be filled according to the style specified in FillStyle. If you specify the BGPic tag, Width, Height and FillStyle are ignored.

Also note that the same BGPic cannot be associated with multiple displays. Each BGPic must only be associated with a single display. It is not possible to have BGPic 1 associated with display 1 and 2, for example. Simply make a copy of the BGPic using CopyBGPic() if you need to use a single BGPic with multiple displays.

The optional table argument recognizes the following tags:

BGPic:
Specifies the BGPic that shall be attached to the new display. You need to specify either this tag or the Width, Height and FillStyle tags. See further notes above.

Width, Height:
See DISPLAY for details. Ignored if BGPic tag is set.

X, Y:
See DISPLAY for details.

Mode:
See DISPLAY for details.

Title:
See DISPLAY for details.

Borderless:
See DISPLAY for details.

Sizeable:
See DISPLAY for details.

Fixed:
See DISPLAY for details.

Backfill:
See DISPLAY for details.

ScrWidth, ScrHeight:
See DISPLAY for details.

ScrDepth:
See DISPLAY for details.

NoHide:
See DISPLAY for details.

NoModeSwitch:
See DISPLAY for details.

NoClose:
See DISPLAY for details.

Active:
See DISPLAY for details.

HidePointer:
See DISPLAY for details.

UseQuartz:
See DISPLAY for details.

ScaleMode:
See DISPLAY for details.

ScaleWidth, ScaleHeight:
See DISPLAY for details.

SmoothScale:
See DISPLAY for details.

DragRegion:
See DISPLAY for details.

SizeRegion:
See DISPLAY for details.

Layers:
See DISPLAY for details.

FitScale:
See DISPLAY for details. (V4.7)

KeepProportions:
See DISPLAY for details. (V4.7)

FillStyle:
See DISPLAY for details.. Ignored if BGPic tag is set. Defaults to #FILLCOLOR. (V5.0)

Color:
See DISPLAY for details.

TextureBrush:
See DISPLAY for details. (V5.0)

TextureX, TextureY:
See DISPLAY for details. (V5.0)

GradientStyle:
See DISPLAY for details. (V5.0)

GradientAngle:
See DISPLAY for details. (V5.0)

GradientStartColor, GradientEndColor:
See DISPLAY for details. (V5.0)

GradientCenterX, GradientCenterY:
See DISPLAY for details. (V5.0)

GradientBalance:
See DISPLAY for details. (V5.0)

GradientBorder:
See DISPLAY for details. (V5.0)

GradientColors:
See DISPLAY for details. (V5.0)

KeepScreenOn:
See DISPLAY for details. (V5.1)

PubScreen:
See DISPLAY for details. (V5.2)

HideFromTaskbar:
See DISPLAY for details. (V5.3)

HideOptionsMenu:
See DISPLAY for details. (V5.3)

Orientation:
See DISPLAY for details. (V5.3)

DisableBlanker:
See DISPLAY for details. (V6.0)

Menu:
See DISPLAY for details. (V6.0)

Monitor:
See DISPLAY for details. (V6.0)

XServer:
See DISPLAY for details. (V6.0)

ScreenTitle:
See DISPLAY for details. (V6.0)

ScreenName:
See DISPLAY for details. (V6.0)

RememberPosition:
See DISPLAY for details. (V6.1)

Maximized:
See DISPLAY for details. (V7.0)

TrapRMB:
See DISPLAY for details. (V7.0)

NoScaleEngine:
See DISPLAY for details. (V7.0)

NoLiveResize:
See DISPLAY for details. (V7.0)

NativeUnits:
See DISPLAY for details. (V7.0)

AlwaysOnTop:
See DISPLAY for details. (V7.1)

NoCyclerMenu:
See DISPLAY for details. (V8.0)

HideTitleBar:
See DISPLAY for details. (V8.0)

Subtitle:
See DISPLAY for details. (V8.0)

SingleMenu:
See DISPLAY for details. (V8.0)

ScaleFactor:
See DISPLAY for details. (V8.0)

SystemScale:
See DISPLAY for details. (V8.0)

After the display has been successfully created, you can open it by calling OpenDisplay(), you can draw to it by using SelectDisplay() and you can close it using CloseDisplay().

See SelectDisplay for an in-depth discussion of using multiple displays in Hollywood.

This command is also available from the preprocessor: Use @DISPLAY to create displays at startup time!

Inputs
id
identifier for the display or Nil for auto id select
table
optional: further configuration options for loading operation
Results
id
optional: identifier of the new display; will only be returned when you pass Nil as argument 1 (see above)
Example
CreateDisplay(2, {BGPic = 2, Active = True})
OpenDisplay(2)
NPrint("Hello World")
The code above creates a new display and attaches BGPic number 2 to it. The display will inherit the size and graphics from BGPic. Then we open the display and print "Hello World" into it.


CreateDisplay(2, {Width = 800, Height = 600, Borderless = True,
   Color = #WHITE, Active = True})
OpenDisplay(2)
The code above creates and opens a 800x600 borderless display with white background. Because we did not specify a BGPic for this display, CreateDisplay() will create one automatically and attach it to the new display. You can get a handle to the automatically created BGPic by querying #ATTRBGPIC on the new display using GetAttribute().

Show TOC