Primitive 0x0023 - Camera Control

This primitive is used to pan the camera to bring the Stack Object into view.


Use

There is no SimPe wizard for this instruction, so the following table details the meaning of each of the operands.

OperandDescriptionOperand Values
0 & 1 Timeout if Op4 bit6 set
2 Unused
3 Zoom 0x01: Far
0x02: Mid
0x03: Near
4 - bit 1 Visible controls whether or not the target has to be visible for the pan to execute Off: Not-visible
On: Visible
4 - bit 2 Unused
4 - bit 3 Unused
4 - bit 4 Center controls if the pan ends with the target in the center of the screen or just visible anywhere Off: Anywhere on screen
On: Centered
4 - bit 5 Unused
4 - bit 6 Controls where the Time Out value is taken from Off: Use value in Op0/Op1
On: Use value in Temp 0
4 - bit 7 Slow Down controls if the speed of pan decreases as the target is approached Off: Slow down
On: Don't slow down
4 - bit 8 Unused
5 thru 15 Unused

See Also


SimPe Code

// Decompiled with JetBrains decompiler
// Type: pjse.BhavNameWizards.WizPrim0x0023
// Assembly: pjse.coder.plugin, Version=4.0.3349.37576, Culture=neutral, PublicKeyToken=null

using SimPe;
using SimPe.PackedFiles.Wrapper;
using System;

namespace pjse.BhavNameWizards
{
  public class WizPrim0x0023 : BhavWizPrim
  {
    public WizPrim0x0023(Instruction i)
      : base(i)
    {
    }

    protected override string Operands(bool lng)
    {
      byte[] numArray = new byte[16];
      ((byte[]) this.instruction.Operands).CopyTo((Array) numArray, 0);
      ((byte[]) this.instruction.Reserved1).CopyTo((Array) numArray, 8);
      string str1 = "" + BhavWiz.dnStkOb() + ": " + (((int) numArray[4] & 1) != 0 ? pjse.Localization.GetString("bwp23_visible") : pjse.Localization.GetString("bwp23_notVisible")) + ", " + pjse.Localization.GetString("bwp23_zoom") + ": 0x" + Helper.HexString(numArray[3]) + " (";
      string str2;
      switch (numArray[3])
      {
        case 1:
          str2 = str1 + pjse.Localization.GetString("bwp23_far");
          break;
        case 2:
          str2 = str1 + pjse.Localization.GetString("bwp23_mid");
          break;
        case 3:
          str2 = str1 + pjse.Localization.GetString("bwp23_near");
          break;
        default:
          str2 = str1 + pjse.Localization.GetString("unk");
          break;
      }
      return str2 + ")" + ", " + pjse.Localization.GetString("bwp23_center") + ": " + (((int) numArray[4] & 8) != 0).ToString() + ", " + pjse.Localization.GetString("bwp_timeout") + ": " + (((int) numArray[4] & 32) != 0 ? this.dataOwner((byte) 8, (ushort) 0) : "0x" + Helper.HexString(BhavWiz.ToShort(numArray[0], numArray[1]))) + ", " + pjse.Localization.GetString("bwp23_slowDown") + ": " + (((int) numArray[4] & 64) == 0).ToString();
    }
  }
}