Difference between revisions of "FF7/Field/Script/Opcodes/E0 BGON"

From Final Fantasy Inside
< FF7‎ | Field‎ | Script‎ | Opcodes
Jump to navigation Jump to search
my_wiki>Synergy Blades
 
m (4 revisions imported)
 
(3 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
! width="40" | 0xE0
 
! width="40" | 0xE0
 
! width="50" | ''B1 / B2''
 
! width="50" | ''B1 / B2''
 +
! width="40" | ''A''
 
! width="40" | ''L''
 
! width="40" | ''L''
! width="40" | ''S''
 
 
|}
 
|}
  
 
==== Arguments ====
 
==== Arguments ====
  
* '''const Bit[4]''' ''B1'': Bank to retrieve ''L'', or zero if ''L'' is specified as a literal.
+
* '''const Bit[4]''' ''B1'': Bank to retrieve ''A'', or zero if ''A'' is specified as a literal.
* '''const Bit[4]''' ''B2'': Bank to retrieve ''S'', or zero if ''S'' is specified as a literal.
+
* '''const Bit[4]''' ''B2'': Bank to retrieve ''L'', or zero if ''L'' is specified as a literal.
* '''const UByte''' ''L'': The ID of the background area to manipulate, as specified in the background's sprite.
+
* '''const UByte''' ''A'': The ID of the background area to manipulate, as specified in the background's sprite.
* '''const UByte''' ''S'': The ID of the layer of ''L'' to display (turn on), as specified in the background's sprite.
+
* '''const UByte''' ''L'': The ID of the layer of ''L'' to display (turn on), as specified in the background's sprite.
  
 
==== Description ====
 
==== Description ====
  
Turns on the portion of background whose [[FF7/Field/Sprite|background sprite]] belongs to the scripted layer and state specified.
+
Turns on the portion of background whose [[FF7/Field/Sprite|background sprite]] belongs to the scripted area and state specified.
  
Parts of the background image may be assigned a "script layer" that allows control over the background by the scripting system. Within each script layer, backgrounds are drawn on top of each other on the same location; these can represent a door in both open and closed states, for example, allowing the script to switch between an open door when a trigger is crossed, and a closed door otherwise, by simply [[FF7/Field/Script/Opcodes/E1 BGOFF|turning off]] the "closed door" background and turning on the "open door" background.
+
Parts of the background image (or more accurately, specific sprites) may be assigned a "scripted area" that allows control over that portion of the background by the scripting system. Within each scripted area, backgrounds are drawn on top of each other in layers, on the same location; these can represent a door in both open and closed states, for example, allowing the script to switch between an open door when a trigger is crossed and a closed door otherwise by simply [[FF7/Field/Script/Opcodes/E1 BGOFF|turning off]] the "closed door" background and turning on the "open door" background.

Latest revision as of 05:19, 23 May 2019

  • Opcode: 0xE0
  • Short name: BGON
  • Long name: Background On

Memory layout

0xE0 B1 / B2 A L

Arguments

  • const Bit[4] B1: Bank to retrieve A, or zero if A is specified as a literal.
  • const Bit[4] B2: Bank to retrieve L, or zero if L is specified as a literal.
  • const UByte A: The ID of the background area to manipulate, as specified in the background's sprite.
  • const UByte L: The ID of the layer of L to display (turn on), as specified in the background's sprite.

Description

Turns on the portion of background whose background sprite belongs to the scripted area and state specified.

Parts of the background image (or more accurately, specific sprites) may be assigned a "scripted area" that allows control over that portion of the background by the scripting system. Within each scripted area, backgrounds are drawn on top of each other in layers, on the same location; these can represent a door in both open and closed states, for example, allowing the script to switch between an open door when a trigger is crossed and a closed door otherwise by simply turning off the "closed door" background and turning on the "open door" background.