Graphics Settings Node – Buildbox 3 Manual

By |

Graphics Settings

This advanced node toggles Image Filtering in a World and is only available in a World’s Mind Map. Image filtering blurs the edges of pixels in every image and texture.

To rename this node, in the Options panel on the right, and in the Name attribute, enter a new name.

The example below demonstrates how image filtering affects a low resolution texture.

With Image filtering selected, the pixel lines of the texture are blurred Disabling Image Filtering allows you to see the lines and shape of each pixel.

 

Brainevents – API Reference

By |

Brainevents

Brainevents activate gameplay features and logic in a sequential order that is determined by the object or player action. See more at the Brainevents documentation page.

Function Description
addBrainEventCallback(name, function)

Adds a callback function to trigger when the Brainevent is triggered. An event can only have one callback attached to it at a time. If addBrainEventCallback() is used on an event that already has a callback, it will replace the existing one with the new one.

currentEvent()

Returns the name of the current or most recent event. If there is no such event, returns an empty string.

hasEvent(name)

Returns true if the entity has an event of the given name, or false if not.

removeBrainEventCallback(name)

Removes the callback attached to the given Brainevent. Remember, each event can only have one callback associated with it.

setEvent(name)

Triggers the event passed as a parameter, also setting it as the entity’s current event. If no data is passed, the event will pass a boolean true value.


addBrainEventCallback(name, function)

Adds a callback function to trigger when the Brainevent is triggered. An event can only have one callback attached to it at a time. If addBrainEventCallback() is used on an event that already has a callback, it will replace the existing one with the new one.

Parameters

string name – the name of the event function the callback function to execute when the event is triggered

if (this.entity().hasEvent('MyEvent')) {
    this.entity().addBrainEventCallback('MyEvent', function() {
        log('In MyEvent Callback!');
        return true;
    });
}

↑ Back to top


currentEvent()

Returns the name of the current or most recent event. If there is no such event, returns an empty string.

Returns

string – the name of the current event

↑ Back to top


hasEvent(name)

Returns true if the entity has an event of the given name, or false if not.

Parameters

string name – the name of the event

Returns

boolean – true if the entity has the event, false if not

↑ Back to top


removeBrainEventCallback(name)

Removes the callback attached to the given Brainevent. Remember, each event can only have one callback associated with it.

Parameters

string name – the name of the event

↑ Back to top


setEvent(name)

Triggers the event passed as a parameter, also setting it as the entity’s current event. If no data is passed, the event will pass a boolean true value.

Parameters

string name – the name of the event
data (optional) value passed to the event of data type boolean, number, or string

this.entity().setEvent('AttackEventName');

↑ Back to top

Background Music – API Reference

By |

Background Music

The BackgroundMusic class can be used to control the Background Music of a UI Screen Node.

Static Function Description
play(sound, looped)

Sets the audio track of the Background Music and plays it.

stop()

Stops the Background Music.

setVolume(volume)

Sets the volume of the Background Music, range 0 (muted) to 1 (max).

volume()

Returns the volume of the Background Music, range 0 (muted) to 1 (max).


play(sound, looped)

Sets the audio track of the Background Music and plays it.

Parameters

Sound sound – The new audio to play as Background Music. Sound is a Script node attribute.
boolean looped – Optional. Set the Background Music to loop if true, or stop after one play if false.

function start(){
     let track2 = this.attribute('track2');
     BackgroundMusic.play(track2);
}


A screenshot showing the Sound attribute used in the code example.

↑ Back to top


stop()

Stops the Background Music.

↑ Back to top


setVolume(volume)

Sets the volume of the Background Music, range 0 (muted) to 1 (max).

Parameters

number – the new volume of the Background Music

↑ Back to top


volume()

Returns the volume of the Background Music, range 0 (muted) to 1 (max).

Returns

number – the volume of the Background Music

↑ Back to top

Did you find this page useful?

Please give it a rating:

Please provide some feedback!

This is very helpful to us.

Tell us how we can improve this post?

Coin Shop – Buildbox 3 Manual

By |

Coin Shop

A Coin Shop is a UI Screen that allows the player to use the points or coins they have collected in the game to purchase a Character or Object.

In-game Example

The example below demonstrates how the player can purchase a red hat for their character.

After the player arrives at the 2D World, they can see the character is not wearing a hat. After the player clicks or taps the Coin Shop button, they arrive at the coin shop menu. After the player selects one of the Coin Shop buttons, they must click or tap the confirmation button to confirm their purchase.
After the player confirms their purchase, the button changes its color, and subtracts 1 from the Coin Score’s total amount. After the Coin Shop button is unlocked, the player can select it, changing the button’s outline color. After the player clicks or taps the play button, their character is now wearing a red hat.

Creating a Coin Shop

To create a Coin Shop menu, you need to create the following:

Placeholder Asset

After the player uses a Coin Shop Button to purchase an asset, the Placeholder asset will be replaced by the purchased asset.

To create a Placeholder Asset:

  1. In a World Editor and in the Asset panel on the left, click Asset Library.
  2. In the Shapes category, double-click Cube to add it to the Asset Panel.
  3. Click Asset Library to go back to the World Editor.
  4. Double-click the Cube to open the Asset Node Map.
  5. In the Node Category panel on the left, click Advanced category to expand it.
  6. Drag the Shop Item Placeholder node to the grid.
  7. In the Options panel on the right and in the Shop ID field, type a desired ID.
    This ID must match a Coin Shop Button’s shop ID
Coin Shop Button

The Coin Shop Button allows the player to purchase and select a Character or Object in the game.

To add a Coin Shop button to a UI Screen:

  1. In a UI Editor, and in the Objects category in the Asset panel, drag a Coin Shop Button to the grid.
  2. If needed, drag the sides and corners to resize the button.
  3. In the Options panel on the right and in the Asset field square, click the Edit button to open the Asset Manager.
  4. In the Asset Manager window and in the left panel, select the asset you want this button to purchase.
  5. In the right panel, scroll down and click Save to close the Asset Manager window.
  6. In the Shop ID field, type a Shop ID that matches a Placeholder Asset’s Shop ID.
  7. In the Price field, enter the amount of Coins or Points you want the player to spend on an asset.

Appearance

The Coin Shop Button contains 4 attribute categories that make up its appearance during the following occurrences:

Attribute Category Occurrence
Unselected The player has yet to interact with the button.
Selected The button is toggled or enabled and its asset will appear in the game when the Placeholder Asset spawns.
Locked Unable to be selected. Requires a purchase to unlock.
Unlocked The player is able to interact with the button to select its associated asset.

To change the button’s appearance, drag a PNG image from your computer to an Animation attribute field.

Shop Item Attributes

The Shop Item attribute category allows you to define which asset the button will unlock as well as the currency and price of the asset. This attribute category contains the following:

Attribute Description
Asset The asset that will appear in the game after it has been unlocked and selected.
Shop ID Enter an ID that matches a Placeholder Asset Shop ID.
Price Enter the amount of coins or points required to purchase the asset.
Currency Select the type of currency required to make the purchase:

  • Coins
  • Points
  • In-app Purchase
Unlocked by Default Select to make the button available for free and without any required purchase.
Selected by Default Select to make the button already be selected after the player arrives at the UI Screen.
Requires Confirmation Select to make a confirmation button appear after the player makes a purchase attempt

A Confirmation Button must be present in the UI Editor.
Confirmation Button (Optional)

Allows the player to confirm their Coin Shop Button purchase. Only one can exist in a UI Screen.

To add a confirmation button:

  1. On the UI Editor grid, select a Coin Shop Button.
  2. In the Options panel on the right, select the Requires Confirmation check-box.
  3. In the Asset panel on the left, drag a Confirmation Button to the grid.
Only 1 Confirmation Button can be present on a UI Screen. If a UI Screen contains more than 1 Confirmation Button the Coin Shop Buttons will only use the first one you added.

Interval and Threshold Node – Buildbox 3 Manual

By |

Interval and Threshold Node

This action node toggles the visibility of an asset based on the Interval and Threshold values. Interval is the number of times this node is enabled. Threshold is the distance that the first-spawned Character has traveled.

  • To enable this node, connect the Enabled input to another node’s output.
  • To activate other nodes after changing the asset’s visibility, connect the Visible output to any desired node inputs.

To learn more about the Interval and Threshold attributes, click the dropdowns below:

Threshold

Threshold is the distance that the first-spawned Character has traveled in the game. After the first-spawned character travels the distance specified by the Threshold attribute, this node changes the asset’s visibility.

To change the asset’s visibility with the threshold, select the Use Threshold checkbox and in the Visibility Threshold field, enter a distance amount in units.

The following is an example of a UI text asset that appears on the In-game UI screen after the player restarts the level.

After the game starts, the Player character asset moves forward in the Z direction. After the Character travels 100 units, the text appears at the bottom of the screen.
Interval

Interval is the number of times this node has been enabled. After this node enables the number of times specified by the Interval attribute, this node changes the asset’s visibility.

To change the asset’s visibility with an interval, select the Use Interval checkbox and in the Interval field, enter the interval amount.

The following is an example of a UI text asset that appears on the Game Over UI screen after the player dies after the second attempt.

After the player arrives at the Game Over screen for the first time, the interval increases to 1. After arriving at the Game Over screen a second time, the interval increases to 2 and makes the text appear with a tip.

Node Attributes

Option Description
Name Type a custom name for this node, if needed.
Initially Visible Select to make the asset visible when it is created or spawned in the game. Clear to make the asset invisible.
Use Interval Select to enable Interval attribute. Clear to disable the Interval attribute.
Interval Enter the number of times you want this node to be enabled before toggling the asset’s visibility.
Use Threshold Select to enable Threshold attribute. Clear to disable the Threshold attribute.
Visibility Threshold Enter how far you want the first-spawned Character to travel before changing the asset’s visibility.

If needed, you can also customize this node. For details, see Customizing Nodes.

Brainevents – Buildbox 3 Manual

By |

Brainevents and State Brainboxes

Brainevents activate gameplay features and logic in a sequential order that is determined by the object or player action. State Brainboxes allow you to activate the Brainevents that they are attached to, and contain predefined gameplay features and functionalities such as animation, data, motion, and outcomes.

The following example is a 2D character asset that contains multiple Brainevents and State Brainboxes:

When the asset is created in the game, the Idle Brainevent activates, which in turn activates the Idle State Brainbox that plays an animation. After the player presses a movement key, the Idle Brainevent deactivates and the Run Brainevent activates along with the Run State Brainbox that moves the character while playing an animation. After the player releases the movement key, the Run Brainevent deactivates and the Idle Brainevent activates. The character stops moving and plays its Idle animation.
Brainevents

There are two ways you can add a Brainevent to an asset.

To add a Brainevent to an asset from the Asset panel:

  1. In a World workspace and in the Asset panel, select an asset.
  2. In the Options panel, click the Add Brainevent button on the bottom.
  3. In the Name field, enter a new name for the Brainevent.

To add or edit a Brainevent from the asset’s Node Map, double-click the asset in the asset panel and do any of the following:

  • To add a Brainevent in the asset’s Node Map, click the + button on the Start node. A New Event appears on the Start node
  • To type a new name for the Brainevent, click the Brainevent’s name on the Start Node.
  • To view or change the Brainevent’s attributes in the Options panel on the right, select the Start node.

Brainevent Output

After you create a Brainevent, a new output with the Brainevent name appears on the asset’s start node.

  • To allow the Brainevent to activate nodes, connect the Brainevent output to the nodes of your choice.
  • When the Brainevent activates, it will activate all of its connected nodes.

Priority

Since only one Brainevent can be active at a time, you can enter a value in a Brainevent’s Priority attribute to determine how Brainevents can activate and deactivate one another.

  • During an active Brainevent, only Brainevents with the same or higher priority value will be able to activate.
  • For example, if the active Brainevent’s priority is 2, then only other Brainevents with a priority of 2 or higher can activate. Brainevents that contain a priority lower than 2, will not be able to activate.

The following is an example of multiple Brainevents with different priorities that change the color of the asset:

After the Green event activates, the Red and Blue events deactivate and will not be able to activate again until the Green event deactivates. The Red and Blue Brainevents will interrupt one another when either activates.

Self-Interruptible

  • Select the Self-Interruptible checkbox to allow the Brainevent to activate even if it is already active.
  • Clear the checkbox to prevent the Brainevent from activating again when it is already active.
State Brainboxes

State Brainboxes add predefined functionality and outcomes to an asset and can transition to other Brainevents.

To add a State Brainbox to a Brainevent, navigate to the Options panel and next to a Brainevent name, click the Add Brainbox icon and select one of the following State Brainboxes:

Name Icon Description Transition
AI Simple Applies the following to an asset:

  • Automatic movement along the X axis and changes its direction after it collides with another object or approaches the end of a platform.
  • Character detection that allows the asset to detect a character then move towards the characters location to attack it.
None
AI Advanced Applies the following to an asset:

  • Automatic movement along the X axis and changes its direction after it collides with another object or approaches the end of a platform.
  • Attack frequency that makes the asset automatically attack periodically.
None
Idle Plays a looping animation when the asset is created or spawned in the game Initial Event – Select the Brainevent you want to activate when the asset is created or spawns in the game.
Run Allows the player to press the A and D keyboard buttons to make the asset move left or right while playing an animation and sound. The asset will always face the movement direction and flips when the movement direction changes. Idle Event – Select a Brainevent that contains an Idle State Brainbox or a Brainevent you want to activate after the player releases the run control.
Jump Allows the player to press the X keyboard button to launch the asset up in the Y direction while playing an animation and sound.

Requires the asset’s physics to be Dynamic.
Fall Event – Select a Brainevent that contains a Fall State Brainbox or a Brainevent you want to activate when the character begins to fall.
Fall Plays an animation and sound when the asset begins to fall in the Y direction.

Requires the asset’s physics to be Dynamic.
None – This Brainevent stays active until a different one activates.
Land Plays an animation and sound when the asset lands on a surface.

Requires the asset’s physics to be Dynamic. Requires the surface asset’s physics to be any type of physics.
Event on End – Select a Brainevent that you want to activate after the animation ends.
Attack Allows the player to press the Z keyboard button, or another specified button to make the asset play an animation and create a hitbox that applies damage to other assets with health. Event on End – Select a Brainevent that you want to activate after the animation ends.
Damage Applies health to an asset and allows it to and take damage from other assets. Also plays an animation and sound when the asset takes damage.

Event on End – Select a Brainevent that you want to activate after the animation ends.

Death Event – Select a Brainevent that contains the Death State Brainbox or a Brainevent you want to activate when the Character’s health reaches 0.

 

Death Plays an animation and sound to signify the death or defeat of the asset. None – This Brainevent stays active until a different one activates.

To view the nodes associated with a State Brainbox, double-click an asset in the asset panel.
Below is an example of the Run State Brainbox and the Idle State Brainbox.

Linking JavaScript Files – API Reference

By |

Linking JavaScript Files

The Buildbox JavaScript panel allows you to link a custom node script to a JavaScript file on your computer, allowing you to use an external text editor to update and change your custom node script. Whether you update the file in the Buildbox JavaScript panel or external editor, it will be updated in both locations

To access the JavaScript panel, on an asset’s node map, double-click a node or click its edit icon.

To link a file to the JavaScript panel, click Link File at the bottom-right of the JavaScript panel, and depending on whether you need to export the file from or import it to Buildbox, choose one of the following procedures below.

Export to File & Link
  1. Select Export File & Link. The Save As window appears.
  2. Select the location where you want to save the file.
  3. Name the file and click Save.

A JavaScript file with the custom node script is now created locally on your computer and is linked to your custom node inside Buildbox.

Import from File & Link
  1. Select Import from File & Link.
  2. On your computer, navigate to the JavaScript file that contains your custom node script.
  3. Click Open.

The script from your JavaScript file appears in the Buildbox JavaScript panel and is linked to your local file.

To avoid breaking the link to your JavaScript file, avoid moving or renaming the JavaScript file on your computer, or deleting the linked node in Buildbox,

After you link a JavaScript file to a node, click the icon at the bottom right of the JavaScript panel to view the following options:

Option Description
Open Externally Opens the linked JavaScript file using your default script editor.
Show in Folder Opens the folder that contains the linked JavaScript file.
Export to File & Link Creates and saves a JavaScript file that contains your custom node script locally on your computer and links the file to the Buildbox JavaScript panel.
Import from File & Link Imports and creates a link to a JavaScript file from your computer to the Buildbox JavaScript panel.
Unlink Unlinks the JavaScript file from the Buildbox JavaScript panel. The updates will no longer be synchronized.

Did you find this page useful?

Please give it a rating:

Please provide some feedback!

This is very helpful to us.

Tell us how we can improve this post?

Haptic Feedback Node – Buildbox 3 Manual

By |

Haptic Feedback Node

This action node activates a low or high vibration level on a mobile device.

This node contains two inputs that control different levels of the device vibration:

  • Low—activates a quick and light vibration.
  • High—activates a longer and more intense vibration.

If needed, type a custom name for this node in the name attribute.

Signal Threshold Node – Buildbox 3 Manual

By |

Signal Threshold Node

This action node activates any connected node inputs after this node activates the amount of times specified by the Threshold amount.

After you add this node to an asset:

  1. Connect the In input to the desired node’s output.
  2. Connect the Out output to the desired node’s input.
  3. Select this node, and In the options panel, in the Threshold field, enter the amount of times you want the player to activate this node before activating the nodes connected to the Out output.

The following example requires players to press a keyboard button three times to change the asset’s color. Since the Threshold amount is set to 2, the player needs to press the keyboard button twice to fulfill that amount, and once more to activate the Set Color node.

Node Attributes

Option Description
Name Enter a custom name for this node, if needed.
Threshold Enter amount of times you want this node to activate before it can activate any connected nodes.
Single Event Select this checkbox to require the In input to activate by the Threshold amount once. After the Threshold amount has been fulfilled, the Out output will activate any connected nodes when In input activates.

If needed, you can also customize this node. For details, see Customizing Nodes.

Signal Invert Node – Buildbox 3 Manual

By |

Signal Invert Node

This action node inverts the signal received from a connected node. For example, if the In input receives a true signal, the Out output sends a false signal.

Each node output sends a true or false signal that node inputs receive. A true signal allows an input to enable a nodes action while a false signal disables that action. When this node’s In input receives a signal from a different node’s output, the Out output sends the opposite signal to any connected node inputs.

To change the name of the node, select it in the node map and in the Options panel, in the Name field, type a custom name, if needed.

The image below is an example a keyboard button that when pressed, stops the asset’s current movement.

If needed, you can also customize this node. For details, see Customizing Nodes.