UsableScreen
What's this?
This is Unreal actor that makes an usable screen displayed on any texture.
The basic principles of usable screen.
- It becames controllable by touching UsableScreenController actor.
- It has areas (called slices) that will cause different events on fire and alt-fire. Slices may have different properties and behaviour.
- I started to make UsableScreen for UT99, so it's UT2004 version is not finished yet (no replication and it's missing some features).
You can find screenshots and downloads with demo maps at http://keaukraine.narod.ru/other/us.html
Where it is used
It is used in Diamond's singleplayer map SP-Plateau.
Also it will be used in such mods for Unreal Tournament as Lost Secrets of Na Pali and The Chosen One.
Using Usable Screen in UT maps
1. Setting up UnrealEd
Currently UsableScreen was developed and tested with Unreal Tournament version 436, so make sure you've pathced your game to this or later version.
You will need to add some packages to EditPackages. Add this lines into [Editor.EditorEngine] section of your UnrealTournament.ini :
EditPackages=UsableScreen
Now you will have UsableScreen's package loaded at startup of UnrealEd.
2. Creating ScriptedTexture for screen
It is important to create corresponding scripted texture for each UsableScreen. After creating scripted texture you can apply it to some surface or even set it as skin for mesh.
You can notice that 256x256 textures doesn't have enough space to fit all you need. You can create ScriptedTextures with any dimensions with this UnrealEd command:
TEXTURE NEW NAME="texturename" CLASS="engine.scriptedtexture" GROUP="somegroup" PACKAGE="somepackage" USIZE=size VSIZE=size
3. Adding UsableScreen
Now you should add UsableScreen actor to your map. It can be found in Actor Class Browser:
Set it's ScriptedTexture property (ClientScriptedTexture section in properties window) to scripted texture corresponding this screen.
4. Adding slices
Slice is an interactive rectangle area on UsableScreen's texture. You can choose between different types of slices.
Common properties for all slices:
X: X coordinate of slice.
Y: Y coordinate of slice.
SizeX, SizeY: Height and width of slice.
bVisible: Toggles visibility of slice.
bDrawFrame: Indicates whether should frame be present on slice or not.
FrameTexture: Picks the color of frame.
FireEvent: Event caused by clicking fire button on slice.
AltFireEvent: Event caused by clicking alt-fire button on slice.
ClickSound: Sound played on fire/alt-fire.
After adding slice to map you must add it to the Slices array in corresponding UsableScreen actor.
USlice does nothing when added, you should use it's subclasses to have something displayed on screen.
By default USlice calls only Trigger() event caused by clicking fire or alt-fire button. But it is possible to make it call UnTrigger() event by setting it's initial state to Controlling. Note that you can't fire different events with fire and alt-fire buttons in this state and you should set only one of FireEvent or AltFireEvent properties. UChangeableTextureSlice will work properly in this state and will change it's texture to default only after fire/alt-fire button was released.
4.1 UTextSlice
Slice to display text.
DisplayedText: Text that will be displayed in this slice.
FontName: Name of font which will be used to display text.
bAutoSize: Indicates whether should splice be strethed to fit text or not.
bTextWrap: Indicates whether should text be wrapped or not.
WrapDelimiter: If bTextWrap is set to True, text will be wrapped by lack of splice/screen width and by special wrap delimiter symbol. The default delimiter is "|".
4.2 UPlayerNameSlice
The sublass of UTextSlice that displays the name of player using this screen.
4.3 UTextureSlice
Slice to display graphical information. Notice that palettes of UsableScreen's base texture and displayed texture should be the same for normal colors.
DisplayedTexture: Texture to be displayed.
bMaskedTexture: Should it be masked or not.
4.4 UChangeableTextureSlice
These derived from UTextureSlice slices serves to create a set of buttons, only one of which is displayed pressed while all of rest remains unpressed.
SecondTexture: Second texture that should represent button in pressed state.
AffectedSlices: Array of UChangeableTextureSlices which works in conjuction with this slice.
4.5 USlicesContainer
I created this slice to place more than 32 slices at one screen and to group slices with common goals.
Slices: You can place up to 16 slices here.
Parent: Set UsableScreen on which it should be displayed. Notice that it should be added into UsableScreen's Slices list too.
Notice: Don't put one USlicesContainer into other USlicesContainer to prevent uncorrect work in network games.
Coordinates of slices in USlicesContainer aren't relative to USlicesContainer's coordinates – they should be set as for any other slices.
5. UsableScreenController
To take control over UsableScreen you must add UsableScreenController.
Properties:
ControlledScreen: UsableScreen which should be controlled by this UsableScreenController.
TextureCenterX, TextureCenterY: Coordinates of texture's center.
MouseTexture: Texture of mouse cursor.
MouseSizeU, MouseSizeV: The size of mouse cursor.
6. UScreenSliceChanger
This actors creates dependencies between slices to create tab-controls. It has two lists of slices – content slices and control slices.
Properties:
ControlSlices: Slices that makes controls to switch content slices
ContentSlices: Slices that contains corresponding data.
You should set FireEvent or AltFireEvent of ControlSlices to the Tag property of UScreenSliceChanger.
In UsableScreen version 1.1 UScreenSliceChanger has 2 states:
- TabSheets state (default). It works like TabSheets in Windows. When it gets triggered it checks is actor which caused event a slice from ControlSlices array. If it is then it shows corresponding slice from ContentSlices. It always makes visible only one slice from ContentSlices.
- FreeSwitch state. In this state it is possible to turn visible multiple slices. To implement this you should add several slices into ContentSlices array and set all corresponding slices in ControlSlices to the slice which will control these slices.