node-insim
    Preparing search index...

    Class IS_BTN

    BuTtoN - button header - followed by 0 to 240 characters

    You can make up to 240 buttons appear on the host or guests (ID = 0 to 239). You should set the InSimFlags.ISF_LOCAL flag (in IS_ISI) if your program is not a host control system, to make sure your buttons do not conflict with any buttons sent by the host.

    LFS can display normal buttons in these four screens:

    • main entry screen
    • race setup screen
    • in game
    • SHIFT+U mode

    The recommended area for most buttons is defined by:

    If you draw buttons in this area, the area will be kept clear to avoid overlapping LFS buttons with your InSim program's buttons. Buttons outside that area will not have a space kept clear. You can also make buttons visible in all screens by setting the Inst property to INST_ALWAYS_ON.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _raw: RawProperties<IS_BTN> = ...

    All string properties in a raw format as it was received from LFS

    Button style flags

    ClickID: number = 0

    Button ID (0 to 239)

    This value is returned in IS_BTC and IS_BTT packets.

    Host buttons and local buttons are stored separately, so there is no chance of a conflict between a host control system and a local system (although the buttons could overlap on screen).

    Programmers of local InSim programs may wish to consider using a configurable button range and possibly screen position, in case their users will use more than one local InSim program at once.

    H: number = 0

    Height (0 to 200)

    Inst: number = 0

    Mainly used internally by InSim but also provides some extra user flags

    NOTE: You should not use INST_ALWAYS_ON for most buttons. This is a special flag for buttons that really must be on in all screens (including the garage and options screens). You will probably need to confine these buttons to the top or bottom edge of the screen, to avoid overwriting LFS buttons. Most buttons should be defined without this flag, and positioned in the recommended area so LFS can keep a space clear in the main screens.

    L: number = 0

    Left offset (0 to 200)

    ReqI: number = 1

    Non-zero (returned in IS_BTC and IS_BTT packets)

    Size: number = IS_BTN.FIXED_DATA_SIZE

    12 + text size (a multiple of 4)

    T: number = 0

    Top offset (0 to 200)

    Text: string = ''

    0 to 240 characters of text

    Type: ISP_BTN = PacketType.ISP_BTN
    TypeIn: number = 0

    If set, the user can click this button to type in text.

    Lowest 7 bits are the maximum number of characters to type in (0 to 95) The highest bit (128) can be set to initialise dialog with the button's text

    On clicking the button, a text entry dialog will be opened, allowing the specified number of characters to be typed in. The caption on the text entry dialog is optionally customisable using Text in the IS_BTN packet. If the first character of IS_BTN's Text field is zero, LFS will read the caption up to the second zero. The visible button text then follows that second zero.

    Text: 65-66-67-0 would display button text "ABC" and no caption

    Text: 0-65-66-67-0-68-69-70-71-0-0-0 would display button text "DEFG" and caption "ABC"

    UCID: number = 0

    Connection to display the button (0 = local / 255 = all)

    W: number = 0

    Width (0 to 200)

    INST_ALWAYS_ON: 128
    IS_X_MAX: 110
    IS_X_MIN: 0
    IS_Y_MAX: 170
    IS_Y_MIN: 30
    MAX_CLICK_ID: 239

    Methods