UI

From BFBB Wiki
Jump to: navigation, search
UI
UI
Type Placeable
Object ID 0x20
Games used Night of 100 Frights
Battle for Bikini Bottom

A UI is a graphic that is drawn to the screen, on top of everything else in the scene. It can accept user input and is used to display menus, UI elements, background images, boss health meters, logos, etc. It can draw either a simple 2D Texture or a 3D Model (but not both).

Format[edit]

UIs are placeable assets. Some notes on the 0x54 byte header:

  • The rotation and scale only apply to a UI with a model (ModelAssetID). A UI with a texture ignores these properties.
  • The position is measured in screen space. The XY coordinates are measured in pixels, (0,0) being the top left corner of the screen. The Z coordinate represents depth and is used to determine the draw order (a UI with a higher depth will be drawn behind one with a lower depth).
  • The asset ID at 0x10 is an optional Surface that is applied to the model.
  • The asset ID at 0x50 is an optional AnimList.

Following the header:

Offset Type Description
0x54 int Unknown. Always 52.
0x58 short Width in pixels.
0x5A short Height in pixels.
0x5C AssetID (Texture) Texture for the UI. Note that you cannot show both a model and texture at the same time. If you set this to something other than null, ModelAssetID will be ignored.
0x60 Vector2 Texture Coordinate (Top Left)
0x68 Vector2 Texture Coordinate (Top Right)
0x70 Vector2 Texture Coordinate (Bottom Right)
0x78 Vector2 Texture Coordinate (Bottom Left)
Events
0x80 Event[numberOfEvents] Events

Events[edit]

  • PadPressX
  • PadPressSquare
  • PadPressO
  • PadPressTriangle
  • PadPressL1
  • PadPressL2
  • PadPressR1
  • PadPressR2
  • PadPressStart
  • PadPressSelect
  • PadPressUp
  • PadPressDown
  • PadPressRight
  • PadPressLeft
  • UI Select
  • UI Unselect
  • UI Focus On
  • UI Focus Off
  • UI Focus On+Select
  • UI Focus Off+Unselect