class_resourceinteractiveloader.rst 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ResourceInteractiveLoader.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ResourceInteractiveLoader:
  6. ResourceInteractiveLoader
  7. =========================
  8. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Interactive :ref:`Resource<class_Resource>` loader.
  13. Methods
  14. -------
  15. +---------------------------------------+--------------------------------------------------------------------------------------------------+
  16. | :ref:`Resource<class_Resource>` | :ref:`get_resource<class_ResourceInteractiveLoader_method_get_resource>` **(** **)** |
  17. +---------------------------------------+--------------------------------------------------------------------------------------------------+
  18. | :ref:`int<class_int>` | :ref:`get_stage<class_ResourceInteractiveLoader_method_get_stage>` **(** **)** const |
  19. +---------------------------------------+--------------------------------------------------------------------------------------------------+
  20. | :ref:`int<class_int>` | :ref:`get_stage_count<class_ResourceInteractiveLoader_method_get_stage_count>` **(** **)** const |
  21. +---------------------------------------+--------------------------------------------------------------------------------------------------+
  22. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`poll<class_ResourceInteractiveLoader_method_poll>` **(** **)** |
  23. +---------------------------------------+--------------------------------------------------------------------------------------------------+
  24. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`wait<class_ResourceInteractiveLoader_method_wait>` **(** **)** |
  25. +---------------------------------------+--------------------------------------------------------------------------------------------------+
  26. Description
  27. -----------
  28. Interactive :ref:`Resource<class_Resource>` loader. This object is returned by :ref:`ResourceLoader<class_ResourceLoader>` when performing an interactive load. It allows to load with high granularity, so this is mainly useful for displaying loading bars/percentages.
  29. Method Descriptions
  30. -------------------
  31. .. _class_ResourceInteractiveLoader_method_get_resource:
  32. - :ref:`Resource<class_Resource>` **get_resource** **(** **)**
  33. Returns the loaded resource if the load operation completed successfully, ``null`` otherwise.
  34. ----
  35. .. _class_ResourceInteractiveLoader_method_get_stage:
  36. - :ref:`int<class_int>` **get_stage** **(** **)** const
  37. Returns the load stage. The total amount of stages can be queried with :ref:`get_stage_count<class_ResourceInteractiveLoader_method_get_stage_count>`.
  38. ----
  39. .. _class_ResourceInteractiveLoader_method_get_stage_count:
  40. - :ref:`int<class_int>` **get_stage_count** **(** **)** const
  41. Returns the total amount of stages (calls to :ref:`poll<class_ResourceInteractiveLoader_method_poll>`) needed to completely load this resource.
  42. ----
  43. .. _class_ResourceInteractiveLoader_method_poll:
  44. - :ref:`Error<enum_@GlobalScope_Error>` **poll** **(** **)**
  45. Polls the loading operation, i.e. loads a data chunk up to the next stage.
  46. Returns :ref:`@GlobalScope.OK<class_@GlobalScope_constant_OK>` if the poll is successful but the load operation has not finished yet (intermediate stage). This means :ref:`poll<class_ResourceInteractiveLoader_method_poll>` will have to be called again until the last stage is completed.
  47. Returns :ref:`@GlobalScope.ERR_FILE_EOF<class_@GlobalScope_constant_ERR_FILE_EOF>` if the load operation has completed successfully. The loaded resource can be obtained by calling :ref:`get_resource<class_ResourceInteractiveLoader_method_get_resource>`.
  48. Returns another :ref:`Error<enum_@GlobalScope_Error>` code if the poll has failed.
  49. ----
  50. .. _class_ResourceInteractiveLoader_method_wait:
  51. - :ref:`Error<enum_@GlobalScope_Error>` **wait** **(** **)**
  52. Polls the loading operation successively until the resource is completely loaded or a :ref:`poll<class_ResourceInteractiveLoader_method_poll>` fails.
  53. Returns :ref:`@GlobalScope.ERR_FILE_EOF<class_@GlobalScope_constant_ERR_FILE_EOF>` if the load operation has completed successfully. The loaded resource can be obtained by calling :ref:`get_resource<class_ResourceInteractiveLoader_method_get_resource>`.
  54. Returns another :ref:`Error<enum_@GlobalScope_Error>` code if a poll has failed, aborting the operation.