===============================================================================
Screen
Copyright 2001 by Mychaeel <mychaeel@0x01.net>
===============================================================================

Mail all bug reports and suggestions to Mychaeel <mychaeel@0x01.net>

NOTE TO MAPPERS: Please always include the most recent version of the Screen
component (see below for the download link) with your map releases. Your maps
will be fully compatible with newer versions of the Screen component, and this
way you will help to minimize version conflicts for your map's users.


===============================================================================
Installation
===============================================================================

1. Extract Screen.u into your UnrealTournament\System directory.

2. Extract ScriptedScreen.utx into your UnrealTournament\Textures directory.

3. Extract DM-ScreenDemo.unr into your UnrealTournament\Maps directory.

4. Add the following lines to your UnrealTournament.ini file:

     [Editor.EditorEngine]
     EditPackages=Screen

If you get version conflicts, download the latest version of the Screen
component at http://www.0x01.net/members/mb/download/Screen.zip


===============================================================================
Compatibility Issues
===============================================================================

I have thought a deal about compatibility of this version of the Screen
package with upcoming ones or older ones.

The usual way to prevent version mismatches when connecting to a game server is
giving every version of a package (a map, for instance) a version-unique name
by including a version number of some kind in the package name. This works very
well with mutators and maps, but for components like this one it raises some
undesirable side effects:

  * If you, as a mapper, want to use an updated or bugfixed version of this
    component, you have to manually re-create all actors that come from the
    old package to ones from the new package. There's no way (known to me) to
    simply substitute the package name for a range of actors.
  
  * If you have multiple versions of this package installed at the same time
    (which would be perfectly possible, valid and even necessary if the
    different versions' package names were unique to their respective version
    number), all classes common to two or more versions would show up multiply
    in UnrealEd's actor browser. Now go figure out which one belongs to which
    version.

On the other hand, UnrealScript has been designed to ensure binary
compatibility of different versions of a package file if some basic guidelines
are followed. In order to avoid the aforementioned problems, I will use the
same package name for all current and upcoming versions of the Screen
component.

  * For you (as a mapper) this means your maps will be fully compatible with
    any newer version of the Screen component. However, please always include
    the most recent version of the Screen component with your map releases, and
    please incldue this documentation file as well.

  * For you (as a player) this means that if you run into version conflicts on
    the Screen package upon connecting to a game server, simply delete or
    rename the Screen.u file in your UnrealTournament\System directory.

  * For you (as a server administrator) this means that I kindly ask you to
    always keep the latest version of the Screen component on your server.

Thank you all for your cooperation. It's appreciated.


===============================================================================
Info
===============================================================================

Scrolling textures are a nice addition to almost every map, but scripted
textures have potential for much more than just that.

The Screen package provides a very general approach to that: A scripted texture
that is connected to a Screen actor can display any number of so-called slides
which can in turn display anything ranging from simple text to complex dynamic
information. The Screen package includes prefabricated slide actor classes.

The notion of slides is very generic. Slides don't have to be of the same size
as the screen. Slides that are larger than the screen (such as huge amounts of
wrapped text) can be automatically scrolled. In addition, every slide can be
assigned an entry and an exit animation such as sliding in from or out to
either side of the screen with customizable speeds.

This document describes how to create a screen in a map, how to create custom
scripted textures that can be used as a canvas for a screen and how to create
your own slide classes that can easily be used on a screen.

A note on tiled screens: The Unreal Tournament graphics engine imposes a size
limit on scripted textures. If you need larger (or higher-resolution) screens
than that, you can split a large "virtual screen" into a number of smaller
actual screens and tile them accordingly. One of those Screen actors will be
the "master screen" and be responsible for things like slide animation, slide
switching and rendering slides. Point the TileMaster property of all other
Screen actors to this master Screen actor and set their TileLeft and TileTop
properties to make them display their respective part of the big picture.


Creating a Screen in a Map
==========================

1. Open ScriptedScreen.utx in the texture browser and apply any of the Screen#
   textures to a surface in your map.

2. Create a Screen actor (Actor, Info, ClientScriptedTexture) somewhere in your
   map.

3. In the new Screen actor's properties, set the ScriptedTexture property in
   the ClientScriptedTexture section to the name of the Screen# texture you had
   used before.

4. Set the Width and Height properties in the Screen section to the pixel size
   of the screen. If necessary, adjust the Left and Top properties to shift the
   content displayed on the screen.

5. Create a ScreenSlidePage or a ScreenSlideMap actor (Actor, Info,
   ScreenSlide) somewhere in your map.

6. Adjust the new ScreenSlide actor's properties as it suits you. (See below
   for an explanation of the available properties.)

7. In the previously created Screen actor's properties, set the SlideCurrent
   property in the Screen section to the name of the ScreenSlide you created.

That's it for a simple screen with a single slide. To add more slides, create
more ScreenSlide actors and link them by setting their SlideNext properties in
the ScreenSlide section to their respective successor.


Creating a Map Surveillance Screen
==================================

Want to create a screen that displays all players' positions on your map? That
requires a little work, but apart from that it is quite simple. Here are the
steps.

1. Create a new screen with a Screen actor and a ScreenSlideMap actor as
   described above.

2. In the top view in UnrealEd zoom out until you have a nice view of your
   whole map. Press the PrtScr key on your keyboard (above the Insert key) to
   take a screenshot.

3. Open your favorite bitmap editor. Open a new bitmap there and paste the
   screenshot into it.

4. Select the part of the screenshot that should be displayed on the screen
   and crop the bitmap to it (usually by chosing Crop from the Edit menu).

5. Convert the bitmap to a palettized format (256 colors) and save it in pcx
   or bmp format.

6. Open the texture browser in UnrealEd and click on the Import command in the
   File menu. Select the bitmap you created and click Open.

7. Enter "MyLevel" as the package name (in order to save this texture along
   with your level rather than in a separate utx file) and an arbitary texture
   name. Click OK.

8. Now open the property sheet for the ScreenSlideMap actor you created before.
   Set the Map property to the name of the texture you had just imported, and
   set MapLeft, MapTop, MapRight and MapBottom to the world coordinates that
   correspond with the texture's upper-left and lower-right corner.

9. Adjust any other properties in the ScreenSlide section as needed.

There you go. Render your map and next time you'll have a nifty screen showing
all players in your map. If you want to exclude players of a given team,
simply set their ShowColor flags to false in the slide's properties.
   

Creating Custom Scripted Textures
=================================

The ScriptedScreen.utx texture package provides eight large scripted screen
textures with black background and a color palette that represents colors from
everywhere in the color space. However, if you want to use another background
for your screen or a different palette (or a differently sized texture), you
can easily create your own scripted textures for use with the Screen actor.

1. Create a bitmap containing your desired background texture. Make sure it is
   palettized. Save it in pcx or bmp format.

2. Open the texture browser. Click on File, Import and open your new texture.
   Enter a new package name and a texture name that suits you. Click OK. After
   this procedure, the texture browser should display your newly created
   texture package containing your background texture. If it doesn't, likely
   something with your bitmap file was wrong; in this case, double-check its
   dimensions, palette and file format.

3. Click on File, New. Enter a name for the scripted texture you are about to
   create and select "ScriptedTexture" in the Class drop-down list.

4. In the Texture Properties dialog that pops up, set the ScriptedSource
   property in the ScriptedTexture section to the name of your previously
   imported base texture. Close the dialog.

Now you can use your newly created texture in the ScriptedTexture property of
any Screen actor you like.


Creating Own Slide Classes
==========================

Yet to come. Forgive me.


===============================================================================
Property Documentation
===============================================================================

Screen
======

Left, Top, Width, Height
  The offset and dimensions of the virtual screen space on the scripted
  texture. These settings are used to determine slide positions on the texture.
  Note that the slide display is not clipped at the borders of the virtual
  screen space.

TileLeft, TileTop
  Only used for tiled screens. Specifiy the coordinates of the upper-left
  corner of this screen tile.

TileMaster
  Only used for tiled screens. Points to the master screen actor. If this
  property is set to anything else than None, Width and Height and all
  properties below are ignored.

ScreenBackground, ScreenForeground
  Textures to be drawn on the screen background and foreground on every frame.
  The textures are stretched to completely fill the virtual screen space.

SlideCurrent
  The slide that is currently displayed; in UnrealEd, the slide that is to be
  displayed first.


ScreenSlide
===========

AlignHorz, AlignVert
  Alignment of this slide on the screen.

Background, BackgroundScroll, BackgroundTile
  Optional background texture for this slide. BackgroundScroll specifies
  whether the background should be fixed on the screen or whether it should be
  scrolled along with the slide; BackgroundTile specifies whether the
  background texture should be drawn repeatedly on the screen if it is smaller
  than the screen or just in the upper-left corner.

ClientWidth, ClientHeight
  Actual width and height of the slide content, not counting any padding at its
  edges. Note that some slide types might ignore these settings because they
  determine their width or height themselves (wrapped text for instance).

ClientPaddingLeft, ClientPaddingTop, ClientPaddingRight, ClientPaddingBottom
  Number of pixels padded to the edges of this slide.

EffectEntry, EffectEntrySpeed, EffectExit, EffectExitSpeed
  Entry and exit animations that are to be played on this slide, and their
  respective speeds. Speeds are usually given in pixels per second.

ScrollHorz, ScrollHorzSpeed, ScrollVert, ScrollVertSpeed
  Scrolling behaviour of this slide on the screen for each direction, and their
  respective scrolling speeds. Slides can either scroll back and forth by
  selecting SlideScroll_Bounce or can scroll from bottom to top by selecting
  SlideScroll_Wrap. Speeds are given in pixels per second.

SlideNext, Time
  Slide that is to be displayed after this slide, after the given amount of
  time in the Time property. Note that entry and exit animations are played
  regardless of the time you specify, and that a slide is only dismissed after
  having completed its scrolling animation.


ScreenSlideMap
==============

FontPlayers, FontPlayersColor
  Name and color of the font to be used to display the player tag.

Map
  Texture that contains the map scheme sketch. This texture is scaled to
  snugly fit into this slide's client area.

MapLeft, MapTop, MapRight, MapBottom
  World coordinates of the upper-left and lower-right pixel of the map sketch.
  Used to calculate a player's position on the screen.

PlayerDisplay
  Player tag that is displayed next to each player's position on the screen.
  The following macros are expanded:
  
    %p   Player name
    %h   Health status of this player
    %s   Current score of this player

PlayerIcons, PlayerIconsWidth, PlayerIconsHeight
  Texture that contains the icons that are drawn at a player's position on the
  screen, and their width and height. All icons must be of same size. The
  texture contains icons for neutral, red, blue, green and gold players
  starting at the upper-left texture corner.

ShowNeutral, ShowRed, ShowBlue, ShowGreen, ShowGold
  Specify which teams should be displayed on the screen.


ScreenSlidePage
===============

FontNormal, FonrNormalBold, FontNormalColor
  Fonts to be used for normal and boldfaced normal text, and the default color
  for such text.

FontBig, FontBigBold
  Fonts to be used for big text.

FontHeading, FontHeadingColor
  Font and default color to be used for headings.

Text
  Text to be displayed, with optional HTML markup. The following HTML tags are
  supported (and all other tags are silently ignored):
  
    <body text=>                Sets default color for normal text
    <h# align=>                 Heading with optional alignment
    <p align=>                  Paragraph with optional alignment
    <br>                        Inserts a linebreak
    <img src= width= height=>   Inserts an image (see below) with optional size
    <font color= size=>         Sets font color and size
    <big>                       Sets big font
    <small>                     Sets normal font
    <b>                         Sets boldfaced font
  
  In order to include an image in your text, import it into UnrealEd as a
  texture and reference it from the <img> tag with its fully qualified name,
  like <img src="Engine.Actor_S">. Masked textures are supported.

TextCaps
  Specifies whether the text should be automatically capitalized. Some fonts
  don't include lowercase letters, so this is sometimes a handy option.


ScreenSlidePageWeb
==================

Same as ScreenSlidePage, but gets its content from an arbitary webserver.

AddressHost, AddressPort, AddressPath
  Host, port and local part of the URL from which the content is to be fetched.
  For example, given the address
  
    http://www.0x01.net/members/mb/
  
  the host is "www.0x01.net", the port is not given (and thus defaults to 80)
  and the local part of the address is "/members/mb/", including the leading
  forward slash.

NetworkGameOnly
  If true, only attempts to connect to the given webserver if the player is
  either running a listen server or has joined a network game. If false,
  unconditionally tries to fetch the data from the webserver. As long as no
  data has been acquired, the slide displays its default Text property.


ScreenSlideRanking
==================

EntryCount
  Maximum number of players that are shown in the ranking table.

EntryHeight, EntryPadding
  Pixel height of a single ranking entry, and amount of spacing between two
  subsequent entries.

Caption, CaptionCaps, CaptionFont, CaptionColor, CaptionColorTeam
  Text that is drawn at the top of each entry, and whether it should be
  converted to caps before being drawn, and its font and its color. If
  CaptionColorTeam is set to true, the caption color is chosen to match the
  corresponding player's team color. The following macros are expanded:
  
    %p  Player name
    %s  Current score of this player
    %d  Number of deaths of this player
    %t  Playing time in minutes

Info, InfoCaps, InfoFont, InfoColor
  Text that is drawn at the bottom of each entry. Same as Caption and its
  related properties.


===============================================================================
Version History
===============================================================================

Version 110
- Fixed graceless handling of mis-set properties in ScreenSlideMap
- Changed default properties in ScreenSlideMap
- Fixed replication issues in ScreenSlideMap
- Moved animation calculations from RenderTexture to Tick
- Added support for high-resolution tiled screens
- Fixed scrolling for dynamically sized slides
- Added ScreenSlideRanking class

Version 100
- Initial release


===============================================================================
Known Issues
===============================================================================

None yet. If you find any, please drop me a line. Thanks.


===============================================================================
Copyright/Permissions
===============================================================================

Screen component: Copyright (c) 2001 by Mychaeel <mychaeel@0x01.net>
Demo map and artwork: Copyright (c) 2001 by ElBundee <elbundee@gmx.net>

You may distribute this component through any electronic network, provided you
include this documentation file.


===============================================================================

UNREAL (c) 1998 Epic Megagames, Inc. All Rights Reserved. Distributed by
GT Interactive Software, Inc. under license. UNREAL and the UNREAL logo are
registered trademarks of Epic Megagames, Inc. All other trademarks and trade
names are properties of their respective owners.