class_resourceinteractiveloader.rst 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/ResourceInteractiveLoader.xml.
  6. .. _class_ResourceInteractiveLoader:
  7. ResourceInteractiveLoader
  8. =========================
  9. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Interactive :ref:`Resource<class_Resource>` loader.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Interactive :ref:`Resource<class_Resource>` loader. This object is returned by :ref:`ResourceLoader<class_ResourceLoader>` when performing an interactive load. It allows loading resources with high granularity, which makes it mainly useful for displaying loading bars or percentages.
  15. .. rst-class:: classref-reftable-group
  16. Methods
  17. -------
  18. .. table::
  19. :widths: auto
  20. +---------------------------------------+----------------------------------------------------------------------------------------------------+
  21. | :ref:`Resource<class_Resource>` | :ref:`get_resource<class_ResourceInteractiveLoader_method_get_resource>` **(** **)** |
  22. +---------------------------------------+----------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_stage<class_ResourceInteractiveLoader_method_get_stage>` **(** **)** |const| |
  24. +---------------------------------------+----------------------------------------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`get_stage_count<class_ResourceInteractiveLoader_method_get_stage_count>` **(** **)** |const| |
  26. +---------------------------------------+----------------------------------------------------------------------------------------------------+
  27. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`poll<class_ResourceInteractiveLoader_method_poll>` **(** **)** |
  28. +---------------------------------------+----------------------------------------------------------------------------------------------------+
  29. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`wait<class_ResourceInteractiveLoader_method_wait>` **(** **)** |
  30. +---------------------------------------+----------------------------------------------------------------------------------------------------+
  31. .. rst-class:: classref-section-separator
  32. ----
  33. .. rst-class:: classref-descriptions-group
  34. Method Descriptions
  35. -------------------
  36. .. _class_ResourceInteractiveLoader_method_get_resource:
  37. .. rst-class:: classref-method
  38. :ref:`Resource<class_Resource>` **get_resource** **(** **)**
  39. Returns the loaded resource if the load operation completed successfully, ``null`` otherwise.
  40. .. rst-class:: classref-item-separator
  41. ----
  42. .. _class_ResourceInteractiveLoader_method_get_stage:
  43. .. rst-class:: classref-method
  44. :ref:`int<class_int>` **get_stage** **(** **)** |const|
  45. Returns the load stage. The total amount of stages can be queried with :ref:`get_stage_count<class_ResourceInteractiveLoader_method_get_stage_count>`.
  46. .. rst-class:: classref-item-separator
  47. ----
  48. .. _class_ResourceInteractiveLoader_method_get_stage_count:
  49. .. rst-class:: classref-method
  50. :ref:`int<class_int>` **get_stage_count** **(** **)** |const|
  51. Returns the total amount of stages (calls to :ref:`poll<class_ResourceInteractiveLoader_method_poll>`) needed to completely load this resource.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_ResourceInteractiveLoader_method_poll:
  55. .. rst-class:: classref-method
  56. :ref:`Error<enum_@GlobalScope_Error>` **poll** **(** **)**
  57. Polls the loading operation, i.e. loads a data chunk up to the next stage.
  58. 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.
  59. 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>`.
  60. Returns another :ref:`Error<enum_@GlobalScope_Error>` code if the poll has failed.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_ResourceInteractiveLoader_method_wait:
  64. .. rst-class:: classref-method
  65. :ref:`Error<enum_@GlobalScope_Error>` **wait** **(** **)**
  66. Polls the loading operation successively until the resource is completely loaded or a :ref:`poll<class_ResourceInteractiveLoader_method_poll>` fails.
  67. 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>`.
  68. Returns another :ref:`Error<enum_@GlobalScope_Error>` code if a poll has failed, aborting the operation.
  69. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  70. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  71. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  72. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`