Loading…
None
String updated in the repository |
|
None
String updated in the repository |
|
English | Spanish | ||
---|---|---|---|
argument | argumento | Learn GDScript From Zero | |
function | función | Learn GDScript From Zero |
Arguments are values (numbers, bits of text, and more) that change how the function behaves.
Arguments let you fine-tune the effect of the function call. They can be optional at times, but functions often require arguments in order to work.
For example, calling [code]rotate()[/code] without any argument would result in an error. Without an argument, Godot doesn't know by [i]how much[/i] you intend to rotate the [i]sprite[/i].
Don't worry about memorizing what arguments each function requires or accepts! As a programmer, the documentation will always be close by for you to refer to.
Finally, notice how we use a dot in the number [code]0.3[/code] above: you need to use a dot like this to represent decimal numbers. You can't use commas as they have a different purpose in code.
Los argumentos son valores (números, bits de texto, etc.) que cambian el comportamiento de la función.
Los argumentos te permiten afinar el efecto de la llamada de una función. A veces pueden ser opcionales, pero las funciones a menudo requieren argumentos para funcionar.
Por ejemplo, llamar a [code]rotate()[/code] sin ningún argumento provocaría un error. Sin un argumento, Godot no sabe por [i]cuánto[i] pretendes rotar el [i]sprite[/i].
¡No te preocupes por memorizar qué argumentos requiere o acepta cada función! Como programador, la documentación siempre estará cerca para que puedas consultarla.
Por último, fíjate en que utilizamos un punto en el número [code]0.3[/code] anterior: tienes que utilizar un punto de esta forma para representar números decimales. No puedes utilizar comas, ya que tienen un propósito diferente en el código.