Skip to content
Adrian K edited this page Mar 18, 2024 · 2 revisions

Description

Levers are used to switch the state of the associated type back and forth.

Location

Levers are located inside the levers folder which contains additional folders to further differentiate the type of lever that is being defined These subfolders are:

  • basic
  • countdown
  • sand

Inside each of these folders one further folder called textures exists.

E.g.: switchBlocksMod\levers\basic\textures

Defining Levers

Levers are defined by a lever{screennumber}.xml file, as the name implies levers are defined by what screen they appear on, counting starts from one.

File structure

The file may begin with an xml header, but it is not needed. The Levers tag however has to be the last element in the xml file.

You may then add any amount of Lever tags inside of it.

A Lever tag then requires two more tags

  • Texture
  • Position

The position tag then contains X and Y

Example

Path to file switchBlocksMod\levers\sand

File levers2.xml

<?xml version="1.0"?>
<Levers xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Lever>
        <Texture>lever</Texture>
        <Position>
            <X>176</X>
            <Y>160</Y>
        </Position>
    </Lever>
    <Lever>
        <Texture>lever_red</Texture>
        <Position>
            <X>240</X>
            <Y>160</Y>
        </Position>
    </Lever>
    <Lever>
        <Texture>lever_blue</Texture>
        <Position>
            <X>304</X>
            <Y>160</Y>
        </Position>
    </Lever>
</Levers>

This would define three levers for the sand type on screen two at respective positions with textures found in the textures folder