Skip to reading
GDScript Programming & Godot

snappedf()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page

Earlier edition reference / Current 0.86.4.0 property paths > p. 350

Code example
snappedf(x: float, step: float) -> float

Snap a value to the supplied increment.

snappedi()#

Code example
snappedi(x: float, step: int) -> int

Snap a value to the supplied increment.

sqrt()#

Code example
sqrt(x: float) -> float

Exponential, natural logarithm, power or square root. Check the mathematical domain.

step_decimals()#

Code example
step_decimals(x: float) -> int

Decimal precision needed for an increment; useful for display/editing.

str()#

Code example
str(...) -> String

Convert one or more values to String text.

str_to_var()#

Code example
str_to_var(string: String) -> Variant

Convert supported Variant data to/from Godot’s text representation.

tan()#

Code example
tan(angle_rad: float) -> float

Trigonometric/hyperbolic calculation; ordinary angle inputs use radians.

tanh()#

Code example
tanh(x: float) -> float

Trigonometric/hyperbolic calculation; ordinary angle inputs use radians.

Page 317 of 378Permalink
Go to page