class-description NEWS COMMUNITY STORE LABS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE LABS TOGGLE FULLSCREEN VOLLBILD AN/AUS bool
A built-in boolean type.

The bool is a built-in Variant type that may only store one of two values: true or false. You can imagine it as a switch that can be either turned on or off, or as a binary digit that can either be 1 or 0.

Booleans can be directly used in if, and other conditional statements:

var can_shoot = true if can_shoot: launch_bullet()

All comparison operators return booleans (==, >, <=, etc.). As such, it is not necessary to compare booleans themselves. You do not need to add == true or == false.

Booleans can be combined with the logical operators and, or, not to create complex conditions:

if bullets > 0 and not is_reloading(): launch_bullet() if bullets == 0 or is_reloading(): play_clack_sound()
bool bool<>():bool

Constructs a bool set to false.

bool bool<>( bool from=, from:bool=, ):bool

Constructs a bool as a copy of the given bool.

bool bool<>( float from=, from:float=, ):bool

Cast a float value to a boolean value. Returns false if from is equal to 0.0 (including -0.0), and true for all other values (including @GDScript.INF and @GDScript.NAN).

bool bool<>( int from=, from:int=, ):bool

Cast an int value to a boolean value. Returns false if from is equal to 0, and true for all other values.

bool operator !=<>( bool right=, right:bool=, ):bool

Returns true if the two booleans are not equal. That is, one is true and the other is false. This operation can be seen as a logical XOR.

bool operator <<>( bool right=, right:bool=, ):bool

Returns true if the left operand is false and the right operand is true.

bool operator ==<>( bool right=, right:bool=, ):bool

Returns true if the two booleans are equal. That is, both are true or both are false. This operation can be seen as a logical EQ or XNOR.

bool operator ><>( bool right=, right:bool=, ):bool

Returns true if the left operand is true and the right operand is false.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...