Skip to content

screenslib

A screen is a Blitz object, numbered from 0. Screen and ScreenTags open a screen; WbToScreen and FindScreen take a screen that is already there, such as the Workbench. Each of them makes the screen the used screen, the one on which Window opens its windows.

CloseScreen closes only the screens that the program opened itself; a screen taken with WbToScreen or FindScreen is only forgotten, never closed.

A screen that Screen cannot open is the runtime error “Can’t open Screen”; ScreenTags returns an error code instead. With runtime error checking, using a screen object that holds no screen is the error “Uninitialized Screen”.

Based on the screenslib guide by Acid Software.

Library number 158. It manages Screen objects, by default at most 5 (the compiler options set the maximum).

Commands

BeepScreen

Flashes the screen, the system’s visual beep.

Statement. Help text: Screen#
Arguments: .w

CloseScreen

Closes the screen if the program opened it; a screen taken with WbToScreen or FindScreen is only forgotten.

Statement. Help text: Screen#
Arguments: .w

FindScreen

Takes a screen that is already open as the screen object - the frontmost one, or the first whose title or default title begins with Title$ - and makes it the used screen.

Statement. Help text: Screen#[,Title$]
2 forms:

  • .w
  • .w, $

As with WbToScreen, a screen that the object held before is freed first: closed if the object opened it, otherwise only forgotten.

HideScreen

Moves the screen to the back.

Statement. Help text: Screen#
Arguments: .w

LoadScreen

Loads an IFF ILBM picture into the screen’s bitmap, and with Palette# also its colours into that palette object; Use Palette then shows them on the screen.

Statement. Help text: Screen#,Filename$[,Palette#]
2 forms:

  • .w, $
  • .w, $, .w

The errors are those of LoadBitMap, and the file is closed before each of them:

SituationError
the file cannot be opened“Can’t Open File”, or “Can’t Open IFF” with Palette#
the file has no picture header“Can’t Find IFF ‘BMHD’”
the file has no picture data“Can’t Find IFF ‘BODY’”
the file ends inside the picture data“Can’t Read File”

MoveScreen

Moves the screen by the given distances.

Statement. Help text: Screen#,deltax,deltay
Arguments: .w, .w, .w

Screen

Opens a screen and makes it the used screen. The short form takes a mode number - the depth in its lowest three bits (0 means 8), 8 for high resolution and 16 for interlace - and an optional title; the long form takes position, size, depth, view mode, title and pens, optionally with a bitmap to show.

Statement. Help text: [Screen#,Mode[,Title$]]|[Screen#,X,Y,W,H,D,Viewmode,Title$,Dpen,Bpen[,BitMap#]
4 forms:

  • .w, .w
  • .w, .w, $
  • .w, .w, .w, .w, .w, .w, .l, $, .w, .w
  • .w, .w, .w, .w, .w, .w, .l, $, .w, .w, .w

The width is rounded up to a multiple of 16. The height of the short form is that of the display, 200 lines for NTSC or 256 for PAL, doubled for interlace. A screen that the object already holds is freed first. With runtime error checking, a bitmap smaller than the screen is the error “Can’t use specified BitMap”.

The view mode of the long form is that of the graphics library, combined with |; 0 is low resolution:

ValueView mode
$8000high resolution
$20super high resolution (together with $8000)
$4interlace
$800HAM
$80extra half-brite

For example, a super high resolution screen with 256 colours on an AGA Amiga:

Screen 0,0,0,1280,256,8,$8020,"MyScreen",1,0

ScreenPens

The pens of Intuition’s look, such as the text, shine and shadow pens, for the screens that Screen opens from now on; ScreenPens On and Off switch them on or off.

Statement. Help text: Text,Shine,Shadow,Fill,FillText,Background,HighLight
2 forms:

  • .w
  • .w, .w, .w, .w, .w, .w, .w

ScreenTags

Opens a screen through Intuition’s tag list call, with the title and extra tags as tag and data pairs or as the address of a tag list; used as a function, it returns the address of the screen or, if it cannot be opened, Intuition’s error code.

Statement or function, result .l. Help text: Screen#,Title$ [&TagList] or [[,Tag,Data]...]
3 forms:

  • .w, $
  • .w, $, .l
  • .w, $, { .l, .l }...

With runtime error checking, more than 15 tag and data pairs given as arguments are the error “Too Many Tags”; a longer list can be given as the address of a tag list, which takes any number of tags.

ShowBitMap

Shows a bitmap in the used screen instead of its own, or without an argument its own bitmap again, for example for double buffering. Wait with VWait after it before drawing into the bitmap that was shown before, so that the new one is really on the display.

Statement. Help text: [BitMap#]
2 forms:

  • no arguments
  • .w

ShowScreen

Brings the screen to the front.

Statement. Help text: Screen#
Arguments: .w

SMouseX

The x position of the mouse on the used screen.

Function, result .w. No help text.
No arguments.

SMouseY

The y position of the mouse on the used screen.

Function, result .w. No help text.
No arguments.

ViewPort

The address of the screen’s ViewPort, for calling the graphics library directly.

Function, result .l. Help text: (Screen#)
Arguments: .w

WbToScreen

Takes the Workbench screen as the screen object and makes it the used screen, mostly to open windows on it.

Statement. Help text: Screen#
Arguments: .w

A screen that the object held before is freed first: closed if the object opened it, otherwise only forgotten.