UTFWin namespace

The user interface system.

UTFWin is the user interface system in Spore. The ModAPI defines some functionalities of this system; even though a user interface can be created via coding, it is recommended to use the SPUI Editor in SporeModder FX instead. The ModAPI can be useful for programatically creating pieces of interfaces (like the editor categories) and listening to UI Events.

The basic unit in UTFWin is the IWindow, an abstract class that defines an area in the screen. All classes whose name start with 'Win...' are IWindows. The basic implementation is Window; there's another class called InteractiveWindow which is prepared to receive events.

Another key piece in UTFWin is IWinProc, 'window procedures'. Window procedures receive events (aka messages) received on windows, therefore they act as event listeners; they are the UI equivalent to IMessageListener.

For rendering windows, the IDrawable interface is used. Windows can only have one (or none) IDrawable object assigned; depending on the window implementation, the drawable might only be used to render certain parts.

Namespaces

namespace BasicCursorIDs
The cursor IDs that are always available.

Classes

class BehaviourTimeOscillator
class BehaviourTimeRamp
class BehaviourTimeSmoothRamp
class BiStateEffect
class ButtonDrawableRadio
The standard IDrawable for a standard, simple radio or checkbox button component.
class ButtonDrawableStandard
The standard IDrawable for a standard, simple button component.
class CascadeEffect
class cCursorManager
template<typename Pointer, typename Reference>
class ChildrenIterator
class ComboBoxDrawable
The standard IDrawable for a combo box component.
struct ComponentSerialization
A structure that defines how a class is stored in an SPUI.
class cSPUIMessageBox
class DefaultDrawable
A class that implements all the methods of an IDrawable.
class DefaultLayoutElement
A default implementation of ILayoutElement.
class DialogDrawable
The standard IDrawable for a dialog component.
class Effect
class EventPropertyObject
class EventTimeFunctionBase
class FadeEffect
class FrameDrawable
FrameDrawable is a procedural drawable that renders multiple frame styles depending on the current state.
struct FrameStyle
class GlideEffect
class Graphics2D
A class that can be used to draw things in the user interface.
class IBiStateEffect
class IButton
An interface that declares all the functions needed by a button component.
class IButtonDrawable
This class is a type of UTFWin::IDrawable capable of rendering an UTFWin::IButton.
class ICascadeEffect
class IComboBox
class IComboBoxDrawable
An abstract class that has the methods that a drawable for a combo box would require.
class IDialog
class IDialogDrawable
An abstract class that has the methods that a drawable for a dialog would require.
class IDrawable
A class that is capable of drawing a user interface component.
class IEventTimeFunction
class IGlideEffect
class IImageDrawable
An abstract class that has the methods that a drawable that renders an image would require.
class IInflateEffect
class ILayoutElement
This class represents an element that is part of a user interfaces.
class ILayoutStyle
This class represents an object that can apply a certain layout to a given Rectangle area.
class Image
A layout element that represents an image.
class ImageDrawable
A standard IDrawable that renders an image.
class IModulateEffect
class InflateEffect
class InteractiveWindow
class InteractiveWinProc
class IPerspectiveEffect
class IRotateEffect
class IScrollbarDrawable
An abstract class that has the methods that a drawable for a scrollbar would require.
class ISlider
class ISliderDrawable
An abstract class that has the methods that a drawable for a slider would require.
class ISpinnerDrawable
An abstract class that has the methods that a drawable for a spinner would require.
class IStdDrawable
An abstract class that has the methods that a standard drawable would require.
class IText
class ITextEdit
class ITreeNode
class ITreeView
class IWindow
An interface that represents a component in the user interface.
class IWindowManager
class IWinProc
This class is a window procedure, also known as an event/message listener.
class LambdaFilterProc
class LambdaProc
class LayoutObjectsContainer
class LayoutReader
class Message
class MessageBoxCallback
class ModulateEffect
class OutlineFormat
class PerspectiveEffect
template<typename Pointer, typename Reference>
class ProcIterator
struct PropertyMethods
Structure used to define access methods for special property types.
class ProportionalLayout
struct RenderParams
A structure used to represent various parameters for the IDrawable::Paint() method, like which image to draw, the current state of the window, etc.
class RotateEffect
class ScrollbarDrawable
The standard IDrawable for a scrollbar component.
class SerializationService
struct SerializedProperty
Defines how a member of a class is stored in an SPUI.
struct Serializer
A structure that defines how an object must be read in an SPUI.
class SimpleLayout
class SliderDrawable
The standard IDrawable for a slider component.
class SpinnerDrawable
The standard IDrawable for a spinner component.
class SporeAnimatedIconWin
class SporeStdDrawable
class SporeStdDrawableImageInfo
A structure that represents an state of a SporeStdDrawable.
class SporeTooltipWinProc
class StdDrawable
The standard IDrawable for user interactive components.
struct StructSerialization
struct TextChange
This struct is used in kMsgTextChanged messages to represent the text in a ITextEdit.
class TreeNode
class UILayout
An object used to load and contain user interfaces.
class UILayoutObjects
class UIRenderer
class UTFWinObject
class VariableWidthDrawable
A drawable that completely fills the window of variable width with a graphic without a horizontal stretch.
class Window
struct Window_intrusive_list_node
class WindowChildren
class WindowProcedures
class WinTreeView

Enums

enum class OscillatorTimeFunction: uint32_t { Wave = 1 }
enum EventFlags { kEventFlagBasicInput = 0x01, kEventFlagUpdate = 0x02, kEventFlagPaint = 0x04, kEventWindowChanged = 0x08, kEventStateChanged = 0x10, kEventRefresh = 0x40, kEventFlagAdvanced = 0x80, kEventFlagLayout = 0x108, kEventFlagElement = 0x400 }
enum MessageType { kMsgKeyDown = 0x01, kMsgKeyUp = 0x02, kMsgKeyDown2 = 0x03, kMsgKeyUp2 = 0x04, kMsgKeyPress = 0x05, kMsgMouseDown = 0x06, kMsgMouseUp = 0x07, kMsgMouseMove = 0x08, kMsgMouseWheel = 0x09, kMsgRefresh = 0x0A, kMsgUpdate = 0x0C, kMsgPaint = 0x0D, kMsgWindowChanged = 0x0E, kMsgLayout = 0x10, kMsgElementAdded = 0x11, kMsgElementRemoved = 0x12, kMsgStateChanged = 0x13, kMsgCollisionDetect = 0x14, kMsgTransformed = 0x15, kMsgButtonClick = 0x17, kMsgButtonSelect = 0x18, kMsgMouseEnter = 0x1B, kMsgMouseLeave = 0x1C, kMsgWinProcAdded = 0x1000, kMsgWinProcRemoved = 0x1001, kMsgComponentActivated = 0x287259F6, kMsgTextChanged = 0x9B1552DA }
enum RefreshType { kRefreshMouse = 1, kRefreshKeyboard = 0 }
enum class BackgroundTiling: uint32_t { Stretch = 0, Tile = 1, CenterStretch = 2, CenterTile = 3 }
enum class TriggerType { Visible = 0, Invisible = 1, Enabled = 2, Disabled = 3, MouseFocus = 4, KeyboardFocus = 5, AnyFocus = 6, NoMouseFocus = 7, NoKeyboardFocus = 8, NoFocus = 9, ButtonSelected = 10, ButtonUnselected = 11 }
enum class InterpolationType { Linear = 0, EaseInEaseOut = 1, DampedSpring = 2 }
enum ButtonFlags { kBtnFlagTriggerOnDown = 0x00000001, kBtnFlagFixedWidth = 0x00000002, kBtnFlagFixedHeight = 0x00000004 }
Flags that can be set to an UTFWin::IButton.
enum ButtonStateFlags { kBtnStateSelected = 4 }
Flags relted to the state of a button that can be set to an UTFWin::IButton.
enum ComboBoxFlags { kComboBoxOutline = 0x00000001 }
enum class ComboBoxColors { Foreground = 0, Background = 1, HighlightedForeground = 2, HighlightedBackground = 3, SelectedForeground = 4, SelectedBackground = 5 }
enum class Scaling { StretchImage = 1, StretchCenter = 2, TileImage = 3, TileCenter = 4 }
An enumeration used by certain drawables, that determines how to draw the images.
enum class AlignmentH { Left = 1, Right = 2, Center = 3 }
enum class AlignmentV { Top = 1, Bottom = 2, Middle = 3 }
enum class FontAlignmentH { Default = 0, Left = 1, Right = 2, Center = 3 }
enum class FontAlignmentV { Default = 0, Top = 1, Bottom = 2, Middle = 3 }
enum class Orientation { Horizontal = 1, Vertical = 2 }
enum class ButtonTypes { Standard = 1, Toggle = 2, Radio = 3 }
enum class StateIndices: uint32_t { Normal = 0, Disabled = 1, Highlighted = 2, Active = 3, CheckedNormal = 4, CheckedDisabled = 5, CheckedHighlighted = 6, CheckedActive = 7 }
enum class Sides { Left = 0, Top = 1, Right = 2, Bottom = 3 }
enum class ImageTiling { None = 0, Standard = 1, Edge = 2 }
An enumeration used by ImageDrawable, that determine how the image is tiled.
enum class TextColors { Text = 0, Background = 1, DisabledText = 2, DisabledBackground = 3, SelectedText = 4, SelectedBackground = 5, Caret = 6, CaretBackground = 7 }
enum class TextEditWarpMode: uint32_t { SingleLine = 0, MultiLine = 1, MultiLineWordWrap = 2 }
enum class ScrollbarEnDis: uint32_t { Never = 0, AsNeeded = 1, Always = 2 }
enum WindowFlags { kWinFlagVisible = 0x1, kWinFlagEnabled = 0x2, kWinFlagClickToFront = 0x4, kWinFlagIgnoreMouse = 0x10, kWinFlagAlwaysInFront = 0x40, kWinFlagClip = 0x400, kWinFlagIgnoreMouseChildren = 0x1000 }
enum WindowStates { kStateEnabled = 1, kStateClicked = 2, kStateHover = 8 }
enum SerializedTypes { kTypeParent = 1, kTypeBool = 2, kTypeUInt8 = 3, kTypeUInt16 = 4, kTypeUInt32 = 5, kTypeUInt64 = 6, kTypeInt8 = 7, kTypeInt16 = 8, kTypeInt32 = 9, kTypeInt64 = 10, kTypeFloat = 11, kTypeDim = 15, kTypeVec4 = 16, kTypeVec2 = 17, kTypeText = 18, kTypePointer = 19, kTypeStruct = 20, kFlagArray = 0x8000 }
The possible property types used in SPUI serialization.
enum LayoutAnchor { kAnchorTop = 1, kAnchorBottom = 2, kAnchorLeft = 4, kAnchorRight = 8 }
enum class IconDrawModes: uint32_t { ImageSize = 0, WindowSize = 1 }
enum class ShadowModes: uint32_t { None = 0, Full = 1, Background = 2, Icon = 3 }
enum class TooltipBehaviour: uint32_t { Default = 0, UnderWindow = 1, Offset = 2 }

Typedefs

using IWindowList_t = eastl::intrusive_list<Window_intrusive_list_node>
using HandleUILambda_t = bool(*)(IWindow*, const Message&)
using Tooltip = SporeTooltipWinProc
using ProgressBarDrawable = VariableWidthDrawable

Functions

auto GetAllocator() -> ICoreAllocator*
ASSERT_SIZE(ButtonDrawableRadio, 0x18)
auto Addresses(ButtonDrawableRadio) -> namespace
ASSERT_SIZE(ButtonDrawableStandard, 0x18)
auto Addresses(ButtonDrawableStandard) -> namespace
ASSERT_SIZE(CascadeEffect, 0x40)
auto Addresses(CascadeEffect) -> namespace
ASSERT_SIZE(ComboBoxDrawable, 0x1C)
auto Addresses(ComboBoxDrawable) -> namespace
auto GetEventFlags(MessageType type) -> EventFlags
auto Addresses(cSPUIMessageBox) -> namespace
auto Addresses(cCursorManager) -> namespace
ASSERT_SIZE(DialogDrawable, 0x40)
auto Addresses(DialogDrawable) -> namespace
ASSERT_SIZE(BiStateEffect, 0x60)
auto Addresses(BiStateEffect) -> namespace
ASSERT_SIZE(EventTimeFunctionBase, 0x48)
ASSERT_SIZE(FadeEffect, 0x60)
auto Addresses(FadeEffect) -> namespace
ASSERT_SIZE(FrameDrawable, 0x60)
auto Addresses(FrameDrawable) -> namespace
ASSERT_SIZE(GlideEffect, 0x70)
auto Addresses(GlideEffect) -> namespace
auto Addresses(Graphics2D) -> namespace
auto Addresses(IButton) -> namespace
ASSERT_SIZE(Image, 0x2C)
auto Addresses(Image) -> namespace
ASSERT_SIZE(ImageDrawable, 0x50)
auto Addresses(ImageDrawable) -> namespace
auto Addresses(IImageDrawable) -> namespace
ASSERT_SIZE(InflateEffect, 0xB8)
auto Addresses(InflateEffect) -> namespace
auto Addresses(InteractiveWinProc) -> namespace
auto Addresses(ITextEdit) -> namespace
auto Addresses(IWindowManager) -> namespace
ASSERT_SIZE(Message, 0x1C)
ASSERT_SIZE(ModulateEffect, 0x70)
auto Addresses(ModulateEffect) -> namespace
ASSERT_SIZE(OutlineFormat, 0x28)
ASSERT_SIZE(PerspectiveEffect, 0x14)
auto Addresses(PerspectiveEffect) -> namespace
ASSERT_SIZE(ProportionalLayout, 0x20)
auto Addresses(ProportionalLayout) -> namespace
ASSERT_SIZE(RotateEffect, 0x78)
auto Addresses(RotateEffect) -> namespace
auto Addresses(ScrollbarDrawable) -> namespace
ASSERT_SIZE(ScrollbarDrawable, 0x2C)
ASSERT_SIZE(SerializationService, 0x34)
ASSERT_SIZE(SimpleLayout, 0x14)
auto Addresses(SimpleLayout) -> namespace
ASSERT_SIZE(SliderDrawable, 0x1C)
auto Addresses(SliderDrawable) -> namespace
ASSERT_SIZE(SpinnerDrawable, 0x1C)
auto Addresses(SpinnerDrawable) -> namespace
ASSERT_SIZE(SporeStdDrawable, 0x160)
auto Addresses(SporeStdDrawable) -> namespace
ASSERT_SIZE(SporeStdDrawableImageInfo, 0x98)
auto Addresses(SporeStdDrawableImageInfo) -> namespace
auto CreateTooltip(const char16_t* pText, const char16_t* pDetailedText = u"", const char16_t* pLayoutName = u"tooltips", uint32_t controlID = 0x3754E6C, uint32_t detailControlID = 0x3754E6C) -> Tooltip*
Creates an instance of the Tooltip class that can be used to display the given text as a tooltip.
ASSERT_SIZE(SporeTooltipWinProc, 0x68)
auto Addresses(SporeTooltipWinProc) -> namespace
ASSERT_SIZE(StdDrawable, 0x7C)
auto Addresses(StdDrawable) -> namespace
ASSERT_SIZE(TreeNode, 0x50)
auto Addresses(TreeNode) -> namespace
ASSERT_SIZE(UILayout, 0x18)
auto Addresses(UILayout) -> namespace
ASSERT_SIZE(LayoutObjectsContainer, 0x80)
auto Addresses(UIRenderer) -> namespace
auto Addresses(UTFWinObject) -> namespace
ASSERT_SIZE(VariableWidthDrawable, 0x14)
auto Addresses(VariableWidthDrawable) -> namespace
ASSERT_SIZE(Window, 0x20C)
auto Addresses(Window) -> namespace
ASSERT_SIZE(WinTreeView, 0x368)

Enum documentation

enum UTFWin::EventFlags

Enumerators
kEventFlagBasicInput

A flag to listen to message types 0x01 – 0x09 and 0x17 – 0x1A, that is, all the ones related to keyboard and mouse input.

kEventFlagUpdate

A flag to listen to the message type kMsgUpdate.

kEventFlagPaint

A flag to listen to the message type kMsgPaint.

kEventWindowChanged

A flag to listen to the message type kMsgWindowChanged and 0x0F.

kEventStateChanged

A flag to listen to the message type kMsgStateChanged.

kEventRefresh

A flag to listen to the message types kMsgRefresh, kMsgMouseEnter and kMsgMouseLeave.

kEventFlagAdvanced

A flag to listen to the rest of message types, all the ones above 0x1C.

This does not include the kMsgWinProcAdded and kMsgWinProcRemoved, which are ALWAYS listened.

kEventFlagLayout

Some flags to listen to the message type kMsgLayout. This is composed of multiple flags.

kEventFlagElement

A flag to listen to the message types kMsgElementAdded and kMsgElementRemoved.

enum UTFWin::MessageType

Enumerators
kMsgKeyDown

Occurs when a key is pressed while the component has focus.

kMsgKeyUp

Occurs when a key is released while the component has focus.

kMsgKeyDown2

Occurs when a key is pressed while the component has focus.

kMsgKeyUp2

Occurs when a key is released while the component has focus.

kMsgKeyPress

Occurs when a character, space or backspace key is pressed while the control has focus.

kMsgMouseDown

Occurs when the mouse pointer is over the component and a mouse button is pressed.

kMsgMouseUp

Occurs when the mouse pointer is over the component and a mouse button is released.

kMsgMouseMove

Occurs when the mouse pointer is moved over the component.

kMsgMouseWheel

Occurs when the mouse wheel moves while the component has focus.

kMsgRefresh

Occurs when the mouse pointer leaves or enters the component.

kMsgUpdate

Occurs every game loop, not all components receive this message.

kMsgPaint

Occurs when the component is redrawn.

kMsgWindowChanged

Occurs when something in the window (caption, flags or drawable) changes.

kMsgLayout

Occurs every time the window area is changed, when IWindow::Revalidate() is called.

kMsgElementAdded

Occurs every time a window or procedure is added.

kMsgElementRemoved

Occurs every time a window is removed.

kMsgStateChanged

Occurs when the state of a window changes.

kMsgCollisionDetect

Occurs when a window is checked to see if it contains the mouse pointer.

kMsgTransformed

Occurs when a transformation is applied to a window.

kMsgButtonClick

Occurs when a standard button is clicked.

kMsgButtonSelect

Occurs when a toggle or radio button is selected.

kMsgMouseEnter

Occurs when the mouse pointer enters the component.

kMsgMouseLeave

Occurs when the mouse pointer leaves the component.

kMsgWinProcAdded

Occurs inmediately after a IWinProc is added to a component.

This is called directly on the IWinProc.

kMsgWinProcRemoved

Occurs inmediately after a IWinProc is removed from a component.

This is called directly on the IWinProc.

kMsgComponentActivated

kMsgTextChanged

Occurs when the text inside a ITextEdit is changed.

enum class UTFWin::BackgroundTiling: uint32_t

Enumerators
Stretch

Stretches background image.

Tile

Tiles image.

CenterStretch

Stretches center of image and tiles edges,.

CenterTile

Tiles center and edges.

enum UTFWin::ButtonFlags

Flags that can be set to an UTFWin::IButton.

Enumerators
kBtnFlagTriggerOnDown

Button considers itself clicked on mouse/key down rather than mouse/key up.

kBtnFlagFixedWidth

Button is fixed width - this means that you can still resize the window area but the actual button width will remain fixed and and it will be positioned within a given window area. Most often used with radio and check box buttons with caption text positioned to the left or right of the button.

kBtnFlagFixedHeight

Button is fixed height - this means that you can still resize the window area but the actual button height will remain fixed and and it will be positioned within a given window area. Most often used with radio and check box buttons with caption text positioned to the left or right of the button.

enum UTFWin::ButtonStateFlags

Flags relted to the state of a button that can be set to an UTFWin::IButton.

enum UTFWin::ComboBoxFlags

Enumerators
kComboBoxOutline

An outline is drawn around the control when highlighted.

enum class UTFWin::Scaling

An enumeration used by certain drawables, that determines how to draw the images.

Enumerators
StretchImage

Stretch the entire image so it fills all the space.

StretchCenter

Draw the edges of the image normally and then stretch the center.

TileImage

Use tiling to fill the space, repeatedly rendering the image.

TileCenter

Draw the edges of the iamge normally, and then tile the center.

enum class UTFWin::ImageTiling

An enumeration used by ImageDrawable, that determine how the image is tiled.

Enumerators
None

No tiling is used.

Standard

The entire image is tiled to fill the space.

Edge

Draws the edges (whcih are considered 1/3 of the space) normally and tiles the rest of the image until it fills all the space.

enum class UTFWin::TextEditWarpMode: uint32_t

Enumerators
SingleLine

All text in one line.

MultiLine

Wrap on hard linebreaks only.

MultiLineWordWrap

Multiline with soft wordwrap.

enum UTFWin::WindowFlags

Enumerators
kWinFlagVisible

Flag indicating that this window is visible.

kWinFlagEnabled

Flag to put the window into an interactive state.

kWinFlagClickToFront

If true, window will move to front when clicked.

kWinFlagIgnoreMouse

Flag indicating that this window can't recieve mouse events.

kWinFlagAlwaysInFront

If true, window will always be in front of windows that don't have this flag.

kWinFlagClip

Flag indicating whether child windows should be clipped.

kWinFlagIgnoreMouseChildren

Flag indicating that this window's children can't recieve mouse events.

enum UTFWin::SerializedTypes

The possible property types used in SPUI serialization.

enum class UTFWin::ShadowModes: uint32_t

Enumerators
None

Don't use shadows.

Full

Use shadows for both the background and the icon.

Background

Only use shadows for the background.

Icon

Only use shadows for the icon.

Typedef documentation

typedef eastl::intrusive_list<Window_intrusive_list_node> UTFWin::IWindowList_t

typedef bool(*UTFWin::HandleUILambda_t)(IWindow*, const Message&)

Function documentation

Tooltip* UTFWin::CreateTooltip(const char16_t* pText, const char16_t* pDetailedText = u"", const char16_t* pLayoutName = u"tooltips", uint32_t controlID = 0x3754E6C, uint32_t detailControlID = 0x3754E6C)

Creates an instance of the Tooltip class that can be used to display the given text as a tooltip.

Parameters
pText The text the tooltip displays.
pDetailedText [Optional] The detailed text showed when the mouse has been a while hovering.
pLayoutName [Optional] The name of the UI layout used in the tooltip.
controlID [Optional] The ControlID of the window in the layout that will display the text.
detailControlID [Optional] The ControlID of the window in the layout that will display the detailed text.

Tooltips are window procedures, so you can add it to a window with IWindow::AddWinProc().