diff options
331 files changed, 13520 insertions, 4905 deletions
diff --git a/AUTHORS.md b/AUTHORS.md index 84b0754929..bf833d1435 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -47,11 +47,13 @@ name is available. Geequlim Gen (dbsGen) George Marques (vnen) + Gilles Roudiere (groud) Guilherme Felipe (guilhermefelipecgs) Hein-Pieter van Braam (hpvb) Hubert Jarosz (Marqin) Hugo Locurcio (Calinou) Ignacio Etcheverry (neikeq) + Indah Sylvia (ISylvox) J08nY Jakub Grzesik (kubecz3k) Johan Manuel (29jm) @@ -77,18 +79,21 @@ name is available. Ramesh Ravone (RameshRavone) Ray Koopa (RayKoopa) Rémi Verschelde (akien-mga) + Ruslan Mustakov (endragor) + Saniko (sanikoyes) SaracenOne Theo Hallenius (TheoXD) Thomas Herzog (karroffel) Timo (toger5) V. Vamsi Krishna (vkbsb) Vinzenz Feenstra (vinzenz) + Wilson E. Alvarez (Rubonnek) Zher Huei Lee (leezh) ZuBsPaCe 박한얼 (volzhs) + bruvzg est31 marynate mrezai romulox-x - sanikoyes yg2f (SuperUserNameMan) diff --git a/DONORS.md b/DONORS.md new file mode 100644 index 0000000000..57902fb2fc --- /dev/null +++ b/DONORS.md @@ -0,0 +1,141 @@ +# Donors to the Godot Engine project + +Godot Engine is a non-profit project developed by a community of voluntary +contributors, as well as occasional paid contributors thanks to the financial +support of generous donors. + +The ways to donate to the project, as well as details on how the funds are +used, are described on [Godot's website](https://godotengine.org/donate). + +The following is a list of the current monthly donors, to be have their +generous deed immortalized in the next stable release of Godot Engine. + +## Platinum sponsors + +None so far, but your company could be the first! :) + +## Gold sponsors + + Gamblify <https://www.gamblify.com> + +## Mini sponsors + + Arron Washington + Chris Phyffer + Christian Uldall Pedersen + Hein-Pieter van Braam + Matthieu Huvé + Neal Gompa (Conan Kudo) + Olimpiu Metiu + Ruslan Mustakov + +## Gold donors + + Alexander Otto + Jake Bo + Javier + Nathan Warden + Ranoller + Rémi Verschelde + Stephan Lanfermann + + Andreas Schüle + Bernhard Liebl + Jordan M Lucas + + BanjoNode2D + Chris Serino + Conrad Curry + Craig Smith + David Churchill + Dean Harmon + Guilherme Felipe de C. G. da Silva + Henrique Alves + Laurence Bannister + Leo + Przemysław Gołąb (n-pigeon) + Robert Willes + Robin Arys + summerblind + Testus Maximus + Thomas Bjarnelöf + + Amanda Haldy + Andreas Haas + Bryanna M + Cody Parker + D + Ezra Theunissen + flesk + François Cantin + Hendrik Mans + Jeppe Zapp + Johannes Wuensch + Justin Arnold + Justo Delgado Baudà + Leandro Voltolino + Myles + Robert Podgorski + Scott Beacon + x1212 + +## Silver donors + + Alex Barsukov + Avencherus + Bastian Böhm + Ben Vercammen + Bryan Stevenson + Collin Shooltz + Fabian Becker + fengjiongmax + Geequlim + Gerrit Großkopf + Guldoman + hatniX + HeartBeast + Heribert Hirth + Hunter Jones + imekon + Jacob McKenney + Jonathon + Josh 'Cheeseness' Bush + Julian Murgia + Juraj Móza + Kevin Boyer + Klavdij Voncina + Lisandro Lorea + magodev + Martin Novák + Matthew Fitzpatrick + Matthew Valancy + Matthias Hölzl + Max R.R. Collada + Michael Gringauz + Mikael Olsson + Moritz Laass + nee + nvgrod + Pablo Seibelt + Pan Ip + Paul Mason + Paweł Kowal + Pietro Vertechi + rayos + Richman Stewart + Roger Smith + Sam Van Campenhout + Sam Vila + Sasori Olkof + Sootstone + Tavo Tell + Tom Larrow + Trent McPheron + Troy Bonneau + UltyX + Xananax & karroffel + +## Bronze donors + +There are even more donors that support the project with a small monthly donation. +Every bit counts and we thank every one of them for their amazing support! diff --git a/core/array.cpp b/core/array.cpp index c35bf5bf0c..2e3fbf858d 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -210,6 +210,17 @@ const Variant &Array::get(int p_idx) const { return operator[](p_idx); } +Array Array::duplicate() const { + + Array new_arr; + int element_count = size(); + new_arr.resize(element_count); + for (int i = 0; i < element_count; i++) { + new_arr[i] = get(i); + } + + return new_arr; +} struct _ArrayVariantSort { _FORCE_INLINE_ bool operator()(const Variant &p_l, const Variant &p_r) const { diff --git a/core/array.h b/core/array.h index 777116ab56..8a647dd13b 100644 --- a/core/array.h +++ b/core/array.h @@ -84,6 +84,8 @@ public: Variant pop_back(); Variant pop_front(); + Array duplicate() const; + Array(const Array &p_from); Array(); ~Array(); diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index abe8b9b715..0f217c8235 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -568,7 +568,7 @@ Dictionary _OS::get_time(bool utc) const { } /** - * Get a epoch time value from a dictionary of time values + * Get an epoch time value from a dictionary of time values * @p datetime must be populated with the following keys: * day, hour, minute, month, second, year. (dst is ignored). * @@ -1705,7 +1705,7 @@ Variant _File::get_var() const { ERR_FAIL_COND_V(!f, Variant()); uint32_t len = get_32(); PoolVector<uint8_t> buff = get_buffer(len); - ERR_FAIL_COND_V(buff.size() != len, Variant()); + ERR_FAIL_COND_V((uint32_t)buff.size() != len, Variant()); PoolVector<uint8_t>::Read r = buff.read(); diff --git a/core/class_db.cpp b/core/class_db.cpp index 1cb287a143..f5ddd9c761 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -535,7 +535,11 @@ void ClassDB::get_method_list(StringName p_class, List<MethodInfo> *p_methods, b minfo.return_val = method->get_return_info(); minfo.flags = method->get_hint_flags(); - minfo.default_arguments = method->get_default_arguments(); + + for (int i = 0; i < method->get_argument_count(); i++) { + if (method->has_default_argument(i)) + minfo.default_arguments.push_back(method->get_default_argument(i)); + } p_methods->push_back(minfo); } diff --git a/core/image.cpp b/core/image.cpp index bb1ce2cee3..4d1f32c360 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -1256,9 +1256,9 @@ void Image::create(const char **p_xpm) { if (*line_ptr == '#') { line_ptr++; - uint8_t col_r; - uint8_t col_g; - uint8_t col_b; + uint8_t col_r = 0; + uint8_t col_g = 0; + uint8_t col_b = 0; //uint8_t col_a=255; for (int i = 0; i < 6; i++) { diff --git a/core/io/file_access_compressed.h b/core/io/file_access_compressed.h index 2fe1428752..ba84c9767c 100644 --- a/core/io/file_access_compressed.h +++ b/core/io/file_access_compressed.h @@ -37,11 +37,11 @@ class FileAccessCompressed : public FileAccess { Compression::Mode cmode; bool writing; - int write_pos; + uint32_t write_pos; uint8_t *write_ptr; - int write_buffer_size; - int write_max; - int block_size; + uint32_t write_buffer_size; + uint32_t write_max; + uint32_t block_size; mutable bool read_eof; mutable bool at_end; @@ -57,7 +57,7 @@ class FileAccessCompressed : public FileAccess { mutable int read_block_size; mutable int read_pos; Vector<ReadBlock> read_blocks; - int read_total; + uint32_t read_total; String magic; mutable Vector<uint8_t> buffer; diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp index cf82d04ac5..12503f3be4 100644 --- a/core/io/file_access_encrypted.cpp +++ b/core/io/file_access_encrypted.cpp @@ -73,14 +73,14 @@ Error FileAccessEncrypted::open_and_parse(FileAccess *p_base, const Vector<uint8 length = p_base->get_64(); base = p_base->get_pos(); ERR_FAIL_COND_V(p_base->get_len() < base + length, ERR_FILE_CORRUPT); - int ds = length; + uint32_t ds = length; if (ds % 16) { ds += 16 - (ds % 16); } data.resize(ds); - int blen = p_base->get_buffer(data.ptr(), ds); + uint32_t blen = p_base->get_buffer(data.ptr(), ds); ERR_FAIL_COND_V(blen != ds, ERR_FILE_CORRUPT); aes256_context ctx; diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h index 3df2806a7a..74d00a5a8f 100644 --- a/core/io/file_access_encrypted.h +++ b/core/io/file_access_encrypted.h @@ -48,7 +48,7 @@ private: size_t base; size_t length; Vector<uint8_t> data; - mutable size_t pos; + mutable int pos; mutable bool eofed; public: diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index be31076557..58ca2d4c58 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -87,6 +87,8 @@ void FileAccessNetworkClient::_thread_func() { DEBUG_PRINT("SEM WAIT - " + itos(sem->get())); Error err = sem->wait(); + if (err != OK) + ERR_PRINT("sem->wait() failed"); DEBUG_TIME("sem_unlock"); //DEBUG_PRINT("semwait returned "+itos(werr)); DEBUG_PRINT("MUTEX LOCK " + itos(lockcount)); @@ -244,14 +246,14 @@ FileAccessNetworkClient::~FileAccessNetworkClient() { memdelete(sem); } -void FileAccessNetwork::_set_block(size_t p_offset, const Vector<uint8_t> &p_block) { +void FileAccessNetwork::_set_block(int p_offset, const Vector<uint8_t> &p_block) { int page = p_offset / page_size; ERR_FAIL_INDEX(page, pages.size()); if (page < pages.size() - 1) { ERR_FAIL_COND(p_block.size() != page_size); } else { - ERR_FAIL_COND((p_block.size() != (total_size % page_size))); + ERR_FAIL_COND((p_block.size() != (int)(total_size % page_size))); } buffer_mutex->lock(); diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h index d6010cdbac..cd5046f007 100644 --- a/core/io/file_access_network.h +++ b/core/io/file_access_network.h @@ -97,7 +97,7 @@ class FileAccessNetwork : public FileAccess { mutable int last_page; mutable uint8_t *last_page_buff; - uint32_t page_size; + int page_size; int read_ahead; int max_pages; @@ -121,7 +121,7 @@ class FileAccessNetwork : public FileAccess { friend class FileAccessNetworkClient; void _queue_page(int p_page) const; void _respond(size_t p_len, Error p_status); - void _set_block(size_t p_offset, const Vector<uint8_t> &p_block); + void _set_block(int p_offset, const Vector<uint8_t> &p_block); public: enum Command { diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index e36ff28220..e511085ac5 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -166,9 +166,9 @@ bool PackedSourcePCK::try_open_pack(const String &p_path) { uint32_t ver_rev = f->get_32(); ERR_EXPLAIN("Pack version unsupported: " + itos(version)); - ERR_FAIL_COND_V(version != PACK_VERSION, ERR_INVALID_DATA); + ERR_FAIL_COND_V(version != PACK_VERSION, false); ERR_EXPLAIN("Pack created with a newer version of the engine: " + itos(ver_major) + "." + itos(ver_minor) + "." + itos(ver_rev)); - ERR_FAIL_COND_V(ver_major > VERSION_MAJOR || (ver_major == VERSION_MAJOR && ver_minor > VERSION_MINOR), ERR_INVALID_DATA); + ERR_FAIL_COND_V(ver_major > VERSION_MAJOR || (ver_major == VERSION_MAJOR && ver_minor > VERSION_MINOR), false); for (int i = 0; i < 16; i++) { //reserved diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index af7db904e9..0834d6c321 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -333,14 +333,14 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int len -= 12; buf += 12; - int total = namecount + subnamecount; + uint32_t total = namecount + subnamecount; if (flags & 2) total++; if (r_len) (*r_len) += 12; - for (int i = 0; i < total; i++) { + for (uint32_t i = 0; i < total; i++) { ERR_FAIL_COND_V((int)len < 4, ERR_INVALID_DATA); strlen = decode_uint32(buf); @@ -566,7 +566,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int if (count) { data.resize(count); PoolVector<uint8_t>::Write w = data.write(); - for (int i = 0; i < count; i++) { + for (uint32_t i = 0; i < count; i++) { w[i] = buf[i]; } @@ -597,7 +597,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int //const int*rbuf=(const int*)buf; data.resize(count); PoolVector<int>::Write w = data.write(); - for (int i = 0; i < count; i++) { + for (uint32_t i = 0; i < count; i++) { w[i] = decode_uint32(&buf[i * 4]); } @@ -624,7 +624,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int //const float*rbuf=(const float*)buf; data.resize(count); PoolVector<float>::Write w = data.write(); - for (int i = 0; i < count; i++) { + for (uint32_t i = 0; i < count; i++) { w[i] = decode_float(&buf[i * 4]); } diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index f44492248e..16ec6cd3c5 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -37,7 +37,7 @@ #include "core/version.h" //#define print_bl(m_what) print_line(m_what) -#define print_bl(m_what) +#define print_bl(m_what) (void)(m_what) enum { @@ -102,7 +102,7 @@ StringName ResourceInteractiveLoaderBinary::_get_string() { uint32_t id = f->get_32(); if (id & 0x80000000) { - uint32_t len = id & 0x7FFFFFFF; + int len = id & 0x7FFFFFFF; if (len > str_buf.size()) { str_buf.resize(len); } @@ -336,9 +336,9 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { } break; case OBJECT_EXTERNAL_RESOURCE_INDEX: { //new file format, just refers to an index in the external list - uint32_t erindex = f->get_32(); + int erindex = f->get_32(); - if (erindex >= external_resources.size()) { + if (erindex < 0 || erindex >= external_resources.size()) { WARN_PRINT("Broken external resource! (index out of size"); r_v = Variant(); } else { @@ -854,12 +854,6 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { } bool big_endian = f->get_32(); -#ifdef BIG_ENDIAN_ENABLED - endian_swap = !big_endian; -#else - bool endian_swap = big_endian; -#endif - bool use_real64 = f->get_32(); f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian @@ -869,7 +863,11 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { uint32_t ver_format = f->get_32(); print_bl("big endian: " + itos(big_endian)); - print_bl("endian swap: " + itos(endian_swap)); +#ifdef BIG_ENDIAN_ENABLED + print_bl("endian swap: " + itos(!big_endian)); +#else + print_bl("endian swap: " + itos(big_endian)); +#endif print_bl("real64: " + itos(use_real64)); print_bl("major: " + itos(ver_major)); print_bl("minor: " + itos(ver_minor)); @@ -878,7 +876,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) { f->close(); - ERR_EXPLAIN("File Format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a a new engine version: " + local_path); + ERR_EXPLAIN("File Format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a new engine version: " + local_path); ERR_FAIL(); } @@ -964,18 +962,12 @@ String ResourceInteractiveLoaderBinary::recognize(FileAccess *p_f) { } bool big_endian = f->get_32(); -#ifdef BIG_ENDIAN_ENABLED - endian_swap = !big_endian; -#else - bool endian_swap = big_endian; -#endif - - bool use_real64 = f->get_32(); + f->get_32(); // use_real64 f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian uint32_t ver_major = f->get_32(); - uint32_t ver_minor = f->get_32(); + f->get_32(); // ver_minor uint32_t ver_format = f->get_32(); if (ver_format > FORMAT_VERSION || ver_major > VERSION_MAJOR) { @@ -993,8 +985,6 @@ ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() { f = NULL; stage = 0; - endian_swap = false; - use_real64 = false; error = OK; translation_remapped = false; } @@ -1117,19 +1107,20 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons memdelete(f); } ERR_FAIL_COND_V(!fw, ERR_CANT_CREATE); + + uint8_t magic[4] = { 'R', 'S', 'R', 'C' }; + fw->store_buffer(magic, 4); } bool big_endian = f->get_32(); -#ifdef BIG_ENDIAN_ENABLED - endian_swap = !big_endian; -#else - bool endian_swap = big_endian; -#endif - bool use_real64 = f->get_32(); f->set_endian_swap(big_endian != 0); //read big endian if saved as big endian - fw->store_32(endian_swap); +#ifdef BIG_ENDIAN_ENABLED + fw->store_32(!big_endian); +#else + fw->store_32(big_endian); +#endif fw->set_endian_swap(big_endian != 0); fw->store_32(use_real64); //use real64 @@ -1178,7 +1169,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons memdelete(f); memdelete(fw); - ERR_EXPLAIN("File Format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a a new engine version: " + local_path); + ERR_EXPLAIN("File Format '" + itos(FORMAT_VERSION) + "." + itos(ver_major) + "." + itos(ver_minor) + "' is too new! Please upgrade to a new engine version: " + local_path); ERR_FAIL_V(ERR_FILE_UNRECOGNIZED); } @@ -1790,8 +1781,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p } save_unicode_string(p_resource->get_class()); - uint64_t md_at = f->get_pos(); - f->store_64(0); //offset to impoty metadata + f->store_64(0); //offset to import metadata for (int i = 0; i < 14; i++) f->store_32(0); // reserved @@ -1811,11 +1801,11 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p if (skip_editor && F->get().name.begins_with("__editor")) continue; - if (F->get().usage & PROPERTY_USAGE_STORAGE) { + if ((F->get().usage & PROPERTY_USAGE_STORAGE)) { Property p; p.name_idx = get_string_index(F->get().name); p.value = E->get()->get(F->get().name); - if ((F->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO && p.value.is_zero()) || (F->get().usage & PROPERTY_USAGE_STORE_IF_NONONE && p.value.is_one())) + if (((F->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && p.value.is_zero()) || ((F->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && p.value.is_one())) continue; p.pi = F->get(); diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index ab77c2c9d3..2316f05b3c 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -44,8 +44,6 @@ class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader { FileAccess *f; - bool endian_swap; - bool use_real64; uint64_t importmd_ofs; Vector<char> str_buf; diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 1006158003..f4f81f0807 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -446,6 +446,7 @@ Error StreamPeerBuffer::get_data(uint8_t *p_buffer, int p_bytes) { return OK; } + Error StreamPeerBuffer::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r_received) { if (pointer + p_bytes > data.size()) { @@ -463,6 +464,8 @@ Error StreamPeerBuffer::get_partial_data(uint8_t *p_buffer, int p_bytes, int &r_ pointer += r_received; // FIXME: return what? OK or ERR_* + // return OK for now so we don't maybe return garbage + return OK; } int StreamPeerBuffer::get_available_bytes() const { diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 353eabea45..92af247823 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -51,8 +51,8 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S Ref<Translation> translation = Ref<Translation>(memnew(Translation)); int line = 1; - bool skip_this; - bool skip_next; + bool skip_this = false; + bool skip_next = false; while (true) { diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index 62110bfe24..3a4be7cd13 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -385,7 +385,7 @@ void XMLParser::_bind_methods() { Error XMLParser::read() { // if not end reached, parse the node - if (P && (P - data) < length - 1 && *P != 0) { + if (P && (P - data) < (int64_t)length - 1 && *P != 0) { _parse_current_node(); return OK; } diff --git a/core/io/xml_parser.h b/core/io/xml_parser.h index 28c57b567f..26616ed94a 100644 --- a/core/io/xml_parser.h +++ b/core/io/xml_parser.h @@ -67,7 +67,7 @@ public: private: char *data; char *P; - int length; + uint64_t length; void unescape(String &p_str); Vector<String> special_characters; String node_name; diff --git a/core/list.h b/core/list.h index 0cad6038ff..da201e9868 100644 --- a/core/list.h +++ b/core/list.h @@ -180,7 +180,7 @@ private: public: /** - * return an const iterator to the beginning of the list. + * return a const iterator to the beginning of the list. */ _FORCE_INLINE_ const Element *front() const { @@ -195,7 +195,7 @@ public: }; /** - * return an const iterator to the last member of the list. + * return a const iterator to the last member of the list. */ _FORCE_INLINE_ const Element *back() const { @@ -291,6 +291,54 @@ public: erase(_data->first); } + Element *insert_after(Element *p_element, const T &p_value) { + CRASH_COND(p_element && (!_data || p_element->data != _data)); + + if (!p_element) { + return push_back(p_value); + } + + Element *n = memnew_allocator(Element, A); + n->value = (T &)p_value; + n->prev_ptr = p_element; + n->next_ptr = p_element->next_ptr; + n->data = _data; + + if (!p_element->next_ptr) { + _data->last = n; + } + + p_element->next_ptr = n; + + _data->size_cache++; + + return n; + } + + Element *insert_before(Element *p_element, const T &p_value) { + CRASH_COND(p_element && (!_data || p_element->data != _data)); + + if (!p_element) { + return push_back(p_value); + } + + Element *n = memnew_allocator(Element, A); + n->value = (T &)p_value; + n->prev_ptr = p_element->prev_ptr; + n->next_ptr = p_element; + n->data = _data; + + if (!p_element->prev_ptr) { + _data->first = n; + } + + p_element->prev_ptr = n; + + _data->size_cache++; + + return n; + } + /** * find an element in the list, */ diff --git a/core/map.h b/core/map.h index 75a38a3440..a37d898a9c 100644 --- a/core/map.h +++ b/core/map.h @@ -453,8 +453,9 @@ private: if (!rp) rp = _data._nil; Element *node = (rp->left == _data._nil) ? rp->right : rp->left; + node->parent = rp->parent; - if (_data._root == (node->parent = rp->parent)) { + if (_data._root == node->parent) { _data._root->left = node; } else { if (rp == rp->parent->left) { diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 0512cdd798..7132b6573e 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -131,7 +131,6 @@ void CameraMatrix::set_perspective(real_t p_fovy_degrees, real_t p_aspect, real_ void CameraMatrix::set_for_hmd(int p_eye, real_t p_aspect, real_t p_intraocular_dist, real_t p_display_width, real_t p_display_to_lens, real_t p_oversample, real_t p_z_near, real_t p_z_far) { // we first calculate our base frustum on our values without taking our lens magnification into account. - real_t display_to_eye = 2.0 * p_display_to_lens; real_t f1 = (p_intraocular_dist * 0.5) / p_display_to_lens; real_t f2 = ((p_display_width - p_intraocular_dist) * 0.5) / p_display_to_lens; real_t f3 = (p_display_width / 4.0) / p_display_to_lens; @@ -265,75 +264,26 @@ void CameraMatrix::get_viewport_size(real_t &r_width, real_t &r_height) const { bool CameraMatrix::get_endpoints(const Transform &p_transform, Vector3 *p_8points) const { - const real_t *matrix = (const real_t *)this->matrix; - - ///////--- Near Plane ---/////// - Plane near_plane = Plane(matrix[3] + matrix[2], - matrix[7] + matrix[6], - matrix[11] + matrix[10], - -matrix[15] - matrix[14]); - near_plane.normalize(); - - ///////--- Far Plane ---/////// - Plane far_plane = Plane(matrix[2] - matrix[3], - matrix[6] - matrix[7], - matrix[10] - matrix[11], - matrix[15] - matrix[14]); - far_plane.normalize(); - - ///////--- Right Plane ---/////// - Plane right_plane = Plane(matrix[0] - matrix[3], - matrix[4] - matrix[7], - matrix[8] - matrix[11], - -matrix[15] + matrix[12]); - right_plane.normalize(); - - ///////--- Top Plane ---/////// - Plane top_plane = Plane(matrix[1] - matrix[3], - matrix[5] - matrix[7], - matrix[9] - matrix[11], - -matrix[15] + matrix[13]); - top_plane.normalize(); - - Vector3 near_endpoint_left, near_endpoint_right; - Vector3 far_endpoint_left, far_endpoint_right; - - bool res = near_plane.intersect_3(right_plane, top_plane, &near_endpoint_right); - ERR_FAIL_COND_V(!res, false); - - res = far_plane.intersect_3(right_plane, top_plane, &far_endpoint_right); - ERR_FAIL_COND_V(!res, false); - - if ((matrix[8] == 0) && (matrix[9] == 0)) { - near_endpoint_left = near_endpoint_right; - near_endpoint_left.x = -near_endpoint_left.x; - - far_endpoint_left = far_endpoint_right; - far_endpoint_left.x = -far_endpoint_left.x; - } else { - ///////--- Left Plane ---/////// - Plane left_plane = Plane(matrix[0] + matrix[3], - matrix[4] + matrix[7], - matrix[8] + matrix[11], - -matrix[15] - matrix[12]); - left_plane.normalize(); + Vector<Plane> planes = get_projection_planes(Transform()); + const Planes intersections[8][3] = { + { PLANE_FAR, PLANE_LEFT, PLANE_TOP }, + { PLANE_FAR, PLANE_LEFT, PLANE_BOTTOM }, + { PLANE_FAR, PLANE_RIGHT, PLANE_TOP }, + { PLANE_FAR, PLANE_RIGHT, PLANE_BOTTOM }, + { PLANE_NEAR, PLANE_LEFT, PLANE_TOP }, + { PLANE_NEAR, PLANE_LEFT, PLANE_BOTTOM }, + { PLANE_NEAR, PLANE_RIGHT, PLANE_TOP }, + { PLANE_NEAR, PLANE_RIGHT, PLANE_BOTTOM }, + }; - res = near_plane.intersect_3(left_plane, top_plane, &near_endpoint_left); - ERR_FAIL_COND_V(!res, false); + for (int i = 0; i < 8; i++) { - res = far_plane.intersect_3(left_plane, top_plane, &far_endpoint_left); + Vector3 point; + bool res = planes[intersections[i][0]].intersect_3(planes[intersections[i][1]], planes[intersections[i][2]], &point); ERR_FAIL_COND_V(!res, false); + p_8points[i] = p_transform.xform(point); } - p_8points[0] = p_transform.xform(Vector3(near_endpoint_right.x, near_endpoint_right.y, near_endpoint_right.z)); - p_8points[1] = p_transform.xform(Vector3(near_endpoint_right.x, -near_endpoint_right.y, near_endpoint_right.z)); - p_8points[2] = p_transform.xform(Vector3(near_endpoint_left.x, near_endpoint_left.y, near_endpoint_left.z)); - p_8points[3] = p_transform.xform(Vector3(near_endpoint_left.x, -near_endpoint_left.y, near_endpoint_left.z)); - p_8points[4] = p_transform.xform(Vector3(far_endpoint_right.x, far_endpoint_right.y, far_endpoint_right.z)); - p_8points[5] = p_transform.xform(Vector3(far_endpoint_right.x, -far_endpoint_right.y, far_endpoint_right.z)); - p_8points[6] = p_transform.xform(Vector3(far_endpoint_left.x, far_endpoint_left.y, far_endpoint_left.z)); - p_8points[7] = p_transform.xform(Vector3(far_endpoint_left.x, -far_endpoint_left.y, far_endpoint_left.z)); - return true; } @@ -610,6 +560,11 @@ int CameraMatrix::get_pixels_per_meter(int p_for_pixel_width) const { return int((result.x * 0.5 + 0.5) * p_for_pixel_width); } +bool CameraMatrix::is_orthogonal() const { + + return matrix[3][3] == 1.0; +} + real_t CameraMatrix::get_fov() const { const real_t *matrix = (const real_t *)this->matrix; diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h index 175d0cdb1b..3145d73356 100644 --- a/core/math/camera_matrix.h +++ b/core/math/camera_matrix.h @@ -69,6 +69,7 @@ struct CameraMatrix { real_t get_z_near() const; real_t get_aspect() const; real_t get_fov() const; + bool is_orthogonal() const; Vector<Plane> get_projection_planes(const Transform &p_transform) const; diff --git a/core/math/face3.cpp b/core/math/face3.cpp index 748faad28f..e1b172e491 100644 --- a/core/math/face3.cpp +++ b/core/math/face3.cpp @@ -296,7 +296,7 @@ void Face3::get_support(const Vector3 &p_normal, const Transform &p_transform, V /** FIND SUPPORT VERTEX **/ int vert_support_idx = -1; - real_t support_max; + real_t support_max = 0; for (int i = 0; i < 3; i++) { diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp index 9732a1ff37..4051de7afb 100644 --- a/core/math/matrix3.cpp +++ b/core/math/matrix3.cpp @@ -234,7 +234,22 @@ Basis Basis::scaled(const Vector3 &p_scale) const { return m; } +void Basis::set_scale(const Vector3 &p_scale) { + + set_axis(0, get_axis(0).normalized() * p_scale.x); + set_axis(1, get_axis(1).normalized() * p_scale.y); + set_axis(2, get_axis(2).normalized() * p_scale.z); +} + Vector3 Basis::get_scale() const { + + return Vector3( + Vector3(elements[0][0], elements[1][0], elements[2][0]).length(), + Vector3(elements[0][1], elements[1][1], elements[2][1]).length(), + Vector3(elements[0][2], elements[1][2], elements[2][2]).length()); +} + +Vector3 Basis::get_signed_scale() const { // FIXME: We are assuming M = R.S (R is rotation and S is scaling), and use polar decomposition to extract R and S. // A polar decomposition is M = O.P, where O is an orthogonal matrix (meaning rotation and reflection) and // P is a positive semi-definite matrix (meaning it contains absolute values of scaling along its diagonal). diff --git a/core/math/matrix3.h b/core/math/matrix3.h index 9c9080ac46..23429888e0 100644 --- a/core/math/matrix3.h +++ b/core/math/matrix3.h @@ -97,7 +97,9 @@ public: void scale(const Vector3 &p_scale); Basis scaled(const Vector3 &p_scale) const; + void set_scale(const Vector3 &p_scale); Vector3 get_scale() const; + Vector3 get_signed_scale() const; // transposed dot products _FORCE_INLINE_ real_t tdotx(const Vector3 &v) const { diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index e9a383df40..e0137b6921 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -76,7 +76,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me int simplex[4]; { - real_t max, min; + real_t max = 0, min = 0; for (int i = 0; i < p_points.size(); i++) { @@ -99,7 +99,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me //third vertex is one most further away from the line { - real_t maxd; + real_t maxd = 0; Vector3 rel12 = p_points[simplex[0]] - p_points[simplex[1]]; for (int i = 0; i < p_points.size(); i++) { @@ -121,7 +121,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me //fourth vertex is the one most further away from the plane { - real_t maxd; + real_t maxd = 0; Plane p(p_points[simplex[0]], p_points[simplex[1]], p_points[simplex[2]]); for (int i = 0; i < p_points.size(); i++) { @@ -389,8 +389,8 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me for (int i = 0; i < f.indices.size(); i++) { - uint32_t a = E->get().indices[i]; - uint32_t b = E->get().indices[(i + 1) % f.indices.size()]; + int a = E->get().indices[i]; + int b = E->get().indices[(i + 1) % f.indices.size()]; Edge e(a, b); Map<Edge, RetFaceConnect>::Element *F = ret_edges.find(e); diff --git a/core/math/transform.cpp b/core/math/transform.cpp index 60df69a509..638a39ab73 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -118,17 +118,17 @@ Transform Transform::interpolate_with(const Transform &p_transform, real_t p_c) /* not sure if very "efficient" but good enough? */ - Vector3 src_scale = basis.get_scale(); - Quat src_rot = basis; + Vector3 src_scale = basis.get_signed_scale(); + Quat src_rot = basis.orthonormalized(); Vector3 src_loc = origin; - Vector3 dst_scale = p_transform.basis.get_scale(); + Vector3 dst_scale = p_transform.basis.get_signed_scale(); Quat dst_rot = p_transform.basis; Vector3 dst_loc = p_transform.origin; - Transform dst; - dst.basis = src_rot.slerp(dst_rot, p_c); - dst.basis.scale(src_scale.linear_interpolate(dst_scale, p_c)); + Transform dst; //this could be made faster by using a single function in Basis.. + dst.basis = src_rot.slerp(dst_rot, p_c).normalized(); + dst.basis.set_scale(src_scale.linear_interpolate(dst_scale, p_c)); dst.origin = src_loc.linear_interpolate(dst_loc, p_c); return dst; diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp index 614104f698..3b246cb183 100644 --- a/core/math/triangle_mesh.cpp +++ b/core/math/triangle_mesh.cpp @@ -158,7 +158,7 @@ void TriangleMesh::create(const PoolVector<Vector3> &p_faces) { max_depth = 0; int max_alloc = fc; - int max = _create_bvh(bw.ptr(), bwp.ptr(), 0, fc, 1, max_depth, max_alloc); + _create_bvh(bw.ptr(), bwp.ptr(), 0, fc, 1, max_depth, max_alloc); bw = PoolVector<BVH>::Write(); //clearup bvh.resize(max_alloc); //resize back diff --git a/core/method_bind.h b/core/method_bind.h index 75f09b2cd9..3c43f86b54 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -369,7 +369,7 @@ MethodBind *create_vararg_method_bind(Variant (T::*p_method)(const Variant **, i // tale of an amazing hack.. // -// if you declare an nonexistent class.. +// if you declare a nonexistent class.. class __UnexistingClass; #include "method_bind.gen.inc" diff --git a/core/object.h b/core/object.h index 6e1ed4308e..644e2b8270 100644 --- a/core/object.h +++ b/core/object.h @@ -567,12 +567,6 @@ public: template <class T> static T *cast_to(Object *p_object) { -#ifdef DEBUG_ENABLED - // TODO there are some legitimate reasons to pass NULL as p_object. - // we need to figure out how to deal with that in debug mode. - // This code will return NULL for a NULL input in release mode also. - ERR_FAIL_COND_V(p_object == NULL, NULL); -#endif #ifndef NO_SAFE_CAST return dynamic_cast<T *>(p_object); #else @@ -587,12 +581,6 @@ public: template <class T> static const T *cast_to(const Object *p_object) { -#ifdef DEBUG_ENABLED - // TODO there are some legitimate reasons to pass NULL as p_object. - // we need to figure out how to deal with that in debug mode. - // This code will return NULL for a NULL input in release mode also. - ERR_FAIL_COND_V(p_object == NULL, NULL); -#endif #ifndef NO_SAFE_CAST return dynamic_cast<const T *>(p_object); #else diff --git a/core/ordered_hash_map.h b/core/ordered_hash_map.h index 3e619d2b2e..9e95f963e1 100644 --- a/core/ordered_hash_map.h +++ b/core/ordered_hash_map.h @@ -55,8 +55,8 @@ public: friend class OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>; typename InternalList::Element *list_element; - typename InternalList::Element *next_element; typename InternalList::Element *prev_element; + typename InternalList::Element *next_element; Element(typename InternalList::Element *p_element) { list_element = p_element; @@ -69,7 +69,7 @@ public: public: _FORCE_INLINE_ Element() - : list_element(NULL), next_element(NULL), prev_element(NULL) { + : list_element(NULL), prev_element(NULL), next_element(NULL) { } Element next() const { @@ -312,4 +312,4 @@ bool operator!=(const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH return (first.list_element != second.list_element); } -#endif // ORDERED_HASH_MAP_H
\ No newline at end of file +#endif // ORDERED_HASH_MAP_H diff --git a/core/os/os.cpp b/core/os/os.cpp index 1292b7eeed..764f7fe6e6 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -64,12 +64,13 @@ void OS::debug_break(){ void OS::print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type) { - const char *err_type; + const char *err_type = "**ERROR**"; switch (p_type) { case ERR_ERROR: err_type = "**ERROR**"; break; case ERR_WARNING: err_type = "**WARNING**"; break; case ERR_SCRIPT: err_type = "**SCRIPT ERROR**"; break; case ERR_SHADER: err_type = "**SHADER ERROR**"; break; + default: ERR_PRINT("Unknown error type"); break; } if (p_rationale && *p_rationale) diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp index 4040680c6d..ad8438e416 100644 --- a/core/packed_data_container.cpp +++ b/core/packed_data_container.cpp @@ -61,7 +61,7 @@ Variant PackedDataContainer::_iter_init_ofs(const Array &p_iter, uint32_t p_offs Variant PackedDataContainer::_iter_next_ofs(const Array &p_iter, uint32_t p_offset) { Array ref = p_iter; - uint32_t size = _size(p_offset); + int size = _size(p_offset); if (ref.size() != 1) return false; int pos = ref[0]; @@ -74,7 +74,7 @@ Variant PackedDataContainer::_iter_next_ofs(const Array &p_iter, uint32_t p_offs Variant PackedDataContainer::_iter_get_ofs(const Variant &p_iter, uint32_t p_offset) { - uint32_t size = _size(p_offset); + int size = _size(p_offset); int pos = p_iter; if (pos < 0 || pos >= size) return Variant(); @@ -164,7 +164,7 @@ Variant PackedDataContainer::_key_at_ofs(uint32_t p_ofs, const Variant &p_key, b if (p_key.is_num()) { int idx = p_key; - uint32_t len = decode_uint32(r + 4); + int len = decode_uint32(r + 4); if (idx < 0 || idx >= len) { err = true; return Variant(); @@ -183,7 +183,7 @@ Variant PackedDataContainer::_key_at_ofs(uint32_t p_ofs, const Variant &p_key, b uint32_t len = decode_uint32(r + 4); bool found = false; - for (int i = 0; i < len; i++) { + for (uint32_t i = 0; i < len; i++) { uint32_t khash = decode_uint32(r + 8 + i * 12 + 0); if (khash == hash) { Variant key = _get_at_ofs(decode_uint32(r + 8 + i * 12 + 4), rd.ptr(), err); diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index c122d21545..c5f6d0dde0 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -339,9 +339,9 @@ Error PoolAllocator::resize(ID p_mem, int p_new_size) { ERR_FAIL_COND_V(e->lock, ERR_ALREADY_IN_USE); } - int alloc_size = aligned(p_new_size); + uint32_t alloc_size = aligned(p_new_size); - if (aligned(e->len) == alloc_size) { + if ((uint32_t)aligned(e->len) == alloc_size) { e->len = p_new_size; mt_unlock(); @@ -374,7 +374,7 @@ Error PoolAllocator::resize(ID p_mem, int p_new_size) { } //no need to move stuff around, it fits before the next block - int next_pos; + uint32_t next_pos; if (entry_indices_pos + 1 == entry_count) { next_pos = pool_size; // - static_area_size; } else { diff --git a/core/project_settings.cpp b/core/project_settings.cpp index a74917162b..23e4961138 100644 --- a/core/project_settings.cpp +++ b/core/project_settings.cpp @@ -114,7 +114,15 @@ String ProjectSettings::globalize_path(const String &p_path) const { return p_path.replace("res:/", resource_path); }; return p_path.replace("res://", ""); - }; + } else if (p_path.begins_with("user://")) { + + String data_dir = OS::get_singleton()->get_data_dir(); + if (data_dir != "") { + + return p_path.replace("user:/", data_dir); + }; + return p_path.replace("user://", ""); + } return p_path; } diff --git a/core/reference.h b/core/reference.h index 5fe8296314..ca3ae60418 100644 --- a/core/reference.h +++ b/core/reference.h @@ -62,7 +62,7 @@ public: template <class T> class Ref { - T *reference; + T *reference = NULL; void ref(const Ref &p_from) { diff --git a/core/resource.cpp b/core/resource.cpp index 37d42226b4..78e20bada4 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -69,12 +69,11 @@ void Resource::set_path(const String &p_path, bool p_take_over) { ResourceCache::resources.get(p_path)->set_name(""); ResourceCache::lock->write_unlock(); } else { - ERR_EXPLAIN("Another resource is loaded from path: " + p_path); - ResourceCache::lock->read_lock(); bool exists = ResourceCache::resources.has(p_path); ResourceCache::lock->read_unlock(); + ERR_EXPLAIN("Another resource is loaded from path: " + p_path); ERR_FAIL_COND(exists); } } diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 8875732b8e..f0097054b1 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -125,6 +125,9 @@ void ScriptDebuggerRemote::_put_variable(const String &p_name, const Variant &p_ packet_peer_stream->put_var(p_name); int len = 0; Error err = encode_variant(p_variable, NULL, len); + if (err != OK) + ERR_PRINT("Failed to encode variant"); + if (len > packet_peer_stream->get_output_buffer_max_size()) { //limit to max size packet_peer_stream->put_var(Variant()); } else { diff --git a/core/script_language.cpp b/core/script_language.cpp index bde80a30bc..5ead91f26e 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -184,7 +184,6 @@ void ScriptInstance::call_multilevel(const StringName &p_method, VARIANT_ARG_DEC argc++; } - Variant::CallError error; call_multilevel(p_method, argptr, argc); } diff --git a/core/script_language.h b/core/script_language.h index 342d8c8072..2261737f9a 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -206,6 +206,7 @@ public: virtual int find_function(const String &p_function, const String &p_code) const = 0; virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const = 0; virtual Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) { return ERR_UNAVAILABLE; } + virtual bool overrides_external_editor() { return false; } virtual Error complete_code(const String &p_code, const String &p_base_path, Object *p_owner, List<String> *r_options, bool &r_force, String &r_call_hint) { return ERR_UNAVAILABLE; } diff --git a/core/set.h b/core/set.h index 317e180869..f68d78cea1 100644 --- a/core/set.h +++ b/core/set.h @@ -438,8 +438,9 @@ private: if (!rp) rp = _data._nil; Element *node = (rp->left == _data._nil) ? rp->right : rp->left; + node->parent = rp->parent; - if (_data._root == (node->parent = rp->parent)) { + if (_data._root == node->parent) { _data._root->left = node; } else { if (rp == rp->parent->left) { diff --git a/core/string_buffer.cpp b/core/string_buffer.cpp new file mode 100644 index 0000000000..195068f887 --- /dev/null +++ b/core/string_buffer.cpp @@ -0,0 +1,102 @@ +/*************************************************************************/ +/* string_buffer.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#include "string_buffer.h" + +#include <string.h> + +StringBuffer &StringBuffer::append(CharType p_char) { + reserve(string_length + 2); + current_buffer_ptr()[string_length++] = p_char; + return *this; +} + +StringBuffer &StringBuffer::append(const String &p_string) { + return append(p_string.c_str()); +} + +StringBuffer &StringBuffer::append(const char *p_str) { + int len = strlen(p_str); + reserve(string_length + len + 1); + + CharType *buf = current_buffer_ptr(); + for (const char *c_ptr = p_str; c_ptr; ++c_ptr) { + buf[string_length++] = *c_ptr; + } + return *this; +} + +StringBuffer &StringBuffer::append(const CharType *p_str, int p_clip_to_len) { + int len = 0; + while ((p_clip_to_len < 0 || len < p_clip_to_len) && p_str[len]) { + ++len; + } + reserve(string_length + len + 1); + memcpy(&(current_buffer_ptr()[string_length]), p_str, len * sizeof(CharType)); + string_length += len; + + return *this; +} + +StringBuffer &StringBuffer::reserve(int p_size) { + if (p_size < SHORT_BUFFER_SIZE || p_size < buffer.size()) + return *this; + + bool need_copy = string_length > 0 && buffer.empty(); + buffer.resize(next_power_of_2(p_size)); + if (need_copy) { + memcpy(buffer.ptr(), short_buffer, string_length * sizeof(CharType)); + } + + return *this; +} + +int StringBuffer::length() const { + return string_length; +} + +String StringBuffer::as_string() { + current_buffer_ptr()[string_length] = '\0'; + if (buffer.empty()) { + return String(short_buffer); + } else { + buffer.resize(string_length + 1); + return buffer; + } +} + +double StringBuffer::as_double() { + current_buffer_ptr()[string_length] = '\0'; + return String::to_double(current_buffer_ptr()); +} + +int64_t StringBuffer::as_int() { + current_buffer_ptr()[string_length] = '\0'; + return String::to_int(current_buffer_ptr()); +} diff --git a/core/string_buffer.h b/core/string_buffer.h new file mode 100644 index 0000000000..3f36249148 --- /dev/null +++ b/core/string_buffer.h @@ -0,0 +1,82 @@ +/*************************************************************************/ +/* string_buffer.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#ifndef STRING_BUFFER_H +#define STRING_BUFFER_H + +#include "ustring.h" + +class StringBuffer { + static const int SHORT_BUFFER_SIZE = 64; + + CharType short_buffer[SHORT_BUFFER_SIZE]; + String buffer; + int string_length = 0; + + _FORCE_INLINE_ CharType *current_buffer_ptr() { + return static_cast<Vector<CharType> &>(buffer).empty() ? short_buffer : buffer.ptr(); + } + +public: + StringBuffer &append(CharType p_char); + StringBuffer &append(const String &p_string); + StringBuffer &append(const char *p_str); + StringBuffer &append(const CharType *p_str, int p_clip_to_len = -1); + + _FORCE_INLINE_ void operator+=(CharType p_char) { + append(p_char); + } + + _FORCE_INLINE_ void operator+=(const String &p_string) { + append(p_string); + } + + _FORCE_INLINE_ void operator+=(const char *p_str) { + append(p_str); + } + + _FORCE_INLINE_ void operator+=(const CharType *p_str) { + append(p_str); + } + + StringBuffer &reserve(int p_size); + + int length() const; + + String as_string(); + + double as_double(); + int64_t as_int(); + + _FORCE_INLINE_ operator String() { + return as_string(); + } +}; + +#endif diff --git a/core/string_builder.cpp b/core/string_builder.cpp new file mode 100644 index 0000000000..18c710ed2d --- /dev/null +++ b/core/string_builder.cpp @@ -0,0 +1,94 @@ +/*************************************************************************/ +/* string_builder.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#include "string_builder.h" + +#include <string.h> + +StringBuilder &StringBuilder::append(const String &p_string) { + + strings.push_back(p_string); + appended_strings.push_back(-1); + + string_length += p_string.length(); + + return *this; +} + +StringBuilder &StringBuilder::append(const char *p_cstring) { + + int32_t len = strlen(p_cstring); + + c_strings.push_back(p_cstring); + appended_strings.push_back(len); + + string_length += len; + + return *this; +} + +String StringBuilder::as_string() const { + + CharType *buffer = memnew_arr(CharType, string_length); + + int current_position = 0; + + int godot_string_elem = 0; + int c_string_elem = 0; + + for (int i = 0; i < appended_strings.size(); i++) { + if (appended_strings[i] == -1) { + // Godot string + const String &s = strings[godot_string_elem]; + + memcpy(buffer + current_position, s.ptr(), s.length() * sizeof(CharType)); + + current_position += s.length(); + + godot_string_elem++; + } else { + + const char *s = c_strings[c_string_elem]; + + for (int32_t j = 0; j < appended_strings[i]; j++) { + buffer[current_position + j] = s[j]; + } + + current_position += appended_strings[i]; + + c_string_elem++; + } + } + + String final_string = String(buffer, string_length); + + memdelete_arr(buffer); + + return final_string; +} diff --git a/scene/gui/button_group.h b/core/string_builder.h index 6ebc0575d2..7cf2f07872 100644 --- a/scene/gui/button_group.h +++ b/core/string_builder.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* button_group.h */ +/* string_builder.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -27,42 +27,53 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef BUTTON_GROUP_H -#define BUTTON_GROUP_H +#ifndef STRING_BUILDER_H +#define STRING_BUILDER_H -#include "scene/gui/box_container.h" +#include "core/ustring.h" -#if 0 -class BaseButton; +#include "core/vector.h" -class ButtonGroup : public BoxContainer { +class StringBuilder { - GDCLASS(ButtonGroup,BoxContainer); + uint32_t string_length = 0; + Vector<String> strings; + Vector<const char *> c_strings; - Set<BaseButton*> buttons; + // -1 means it's a Godot String + // a natural number means C string. + Vector<int32_t> appended_strings; +public: + StringBuilder &append(const String &p_string); + StringBuilder &append(const char *p_cstring); - Array _get_button_list() const; - void _pressed(Object *p_button); + _FORCE_INLINE_ StringBuilder &operator+(const String &p_string) { + return append(p_string); + } -protected: -friend class BaseButton; + _FORCE_INLINE_ StringBuilder &operator+(const char *p_cstring) { + return append(p_cstring); + } - void _add_button(BaseButton *p_button); - void _remove_button(BaseButton *p_button); + _FORCE_INLINE_ void operator+=(const String &p_string) { + append(p_string); + } - static void _bind_methods(); -public: + _FORCE_INLINE_ void operator+=(const char *p_cstring) { + append(p_cstring); + } + + _FORCE_INLINE_ int num_strings_appended() const { + return appended_strings.size(); + } - void get_button_list(List<BaseButton*> *p_buttons) const; - BaseButton *get_pressed_button() const; - BaseButton *get_focused_button() const; - void set_pressed_button(BaseButton *p_button); - int get_pressed_button_index() const; + String as_string() const; - ButtonGroup(); + _FORCE_INLINE_ operator String() const { + return as_string(); + } }; -#endif -#endif // BUTTON_GROUP_H +#endif // STRING_BUILDER_H diff --git a/core/type_info.h b/core/type_info.h index da6047450c..9fb80af0eb 100644 --- a/core/type_info.h +++ b/core/type_info.h @@ -39,28 +39,27 @@ struct TypeInherits { template <class T, typename = void> struct GetTypeInfo { - enum { VARIANT_TYPE = Variant::NIL }; - + static const Variant::Type VARIANT_TYPE = Variant::NIL; static inline PropertyInfo get_class_info() { ERR_PRINT("GetTypeInfo fallback. Bug!"); return PropertyInfo(); // Not "Nil", this is an error } }; -#define MAKE_TYPE_INFO(m_type, m_var_type) \ - template <> \ - struct GetTypeInfo<m_type> { \ - enum { VARIANT_TYPE = m_var_type }; \ - static inline PropertyInfo get_class_info() { \ - return PropertyInfo((Variant::Type)VARIANT_TYPE, String()); \ - } \ - }; \ - template <> \ - struct GetTypeInfo<const m_type &> { \ - enum { VARIANT_TYPE = m_var_type }; \ - static inline PropertyInfo get_class_info() { \ - return PropertyInfo((Variant::Type)VARIANT_TYPE, String()); \ - } \ +#define MAKE_TYPE_INFO(m_type, m_var_type) \ + template <> \ + struct GetTypeInfo<m_type> { \ + static const Variant::Type VARIANT_TYPE = m_var_type; \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo(VARIANT_TYPE, String()); \ + } \ + }; \ + template <> \ + struct GetTypeInfo<const m_type &> { \ + static const Variant::Type VARIANT_TYPE = m_var_type; \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo(VARIANT_TYPE, String()); \ + } \ }; MAKE_TYPE_INFO(bool, Variant::BOOL) @@ -108,14 +107,14 @@ MAKE_TYPE_INFO(BSP_Tree, Variant::DICTIONARY) //for RefPtr template <> struct GetTypeInfo<RefPtr> { - enum { VARIANT_TYPE = Variant::OBJECT }; + static const Variant::Type VARIANT_TYPE = Variant::OBJECT; static inline PropertyInfo get_class_info() { return PropertyInfo(Variant::OBJECT, String(), PROPERTY_HINT_RESOURCE_TYPE, "Reference"); } }; template <> struct GetTypeInfo<const RefPtr &> { - enum { VARIANT_TYPE = Variant::OBJECT }; + static const Variant::Type VARIANT_TYPE = Variant::OBJECT; static inline PropertyInfo get_class_info() { return PropertyInfo(Variant::OBJECT, String(), PROPERTY_HINT_RESOURCE_TYPE, "Reference"); } @@ -124,7 +123,7 @@ struct GetTypeInfo<const RefPtr &> { //for variant template <> struct GetTypeInfo<Variant> { - enum { VARIANT_TYPE = Variant::NIL }; + static const Variant::Type VARIANT_TYPE = Variant::NIL; static inline PropertyInfo get_class_info() { return PropertyInfo(Variant::NIL, String(), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_NIL_IS_VARIANT); } @@ -132,26 +131,26 @@ struct GetTypeInfo<Variant> { template <> struct GetTypeInfo<const Variant &> { - enum { VARIANT_TYPE = Variant::NIL }; + static const Variant::Type VARIANT_TYPE = Variant::NIL; static inline PropertyInfo get_class_info() { return PropertyInfo(Variant::NIL, String(), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_NIL_IS_VARIANT); } }; -#define MAKE_TEMPLATE_TYPE_INFO(m_template, m_type, m_var_type) \ - template <> \ - struct GetTypeInfo<m_template<m_type> > { \ - enum { VARIANT_TYPE = m_var_type }; \ - static inline PropertyInfo get_class_info() { \ - return PropertyInfo((Variant::Type)VARIANT_TYPE, String()); \ - } \ - }; \ - template <> \ - struct GetTypeInfo<const m_template<m_type> &> { \ - enum { VARIANT_TYPE = m_var_type }; \ - static inline PropertyInfo get_class_info() { \ - return PropertyInfo((Variant::Type)VARIANT_TYPE, String()); \ - } \ +#define MAKE_TEMPLATE_TYPE_INFO(m_template, m_type, m_var_type) \ + template <> \ + struct GetTypeInfo<m_template<m_type> > { \ + static const Variant::Type VARIANT_TYPE = m_var_type; \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo(VARIANT_TYPE, String()); \ + } \ + }; \ + template <> \ + struct GetTypeInfo<const m_template<m_type> &> { \ + static const Variant::Type VARIANT_TYPE = m_var_type; \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo(VARIANT_TYPE, String()); \ + } \ }; MAKE_TEMPLATE_TYPE_INFO(Vector, uint8_t, Variant::POOL_BYTE_ARRAY) @@ -171,8 +170,7 @@ MAKE_TEMPLATE_TYPE_INFO(PoolVector, Face3, Variant::POOL_VECTOR3_ARRAY) template <typename T> struct GetTypeInfo<T *, typename EnableIf<TypeInherits<Object, T>::value>::type> { - enum { VARIANT_TYPE = Variant::OBJECT }; - + static const Variant::Type VARIANT_TYPE = Variant::OBJECT; static inline PropertyInfo get_class_info() { return PropertyInfo(StringName(T::get_class_static())); } @@ -180,8 +178,7 @@ struct GetTypeInfo<T *, typename EnableIf<TypeInherits<Object, T>::value>::type> template <typename T> struct GetTypeInfo<const T *, typename EnableIf<TypeInherits<Object, T>::value>::type> { - enum { VARIANT_TYPE = Variant::OBJECT }; - + static const Variant::Type VARIANT_TYPE = Variant::OBJECT; static inline PropertyInfo get_class_info() { return PropertyInfo(StringName(T::get_class_static())); } @@ -190,7 +187,7 @@ struct GetTypeInfo<const T *, typename EnableIf<TypeInherits<Object, T>::value>: #define TEMPL_MAKE_ENUM_TYPE_INFO(m_enum, m_impl) \ template <> \ struct GetTypeInfo<m_impl> { \ - enum { VARIANT_TYPE = Variant::INT }; \ + static const Variant::Type VARIANT_TYPE = Variant::INT; \ static inline PropertyInfo get_class_info() { \ return PropertyInfo(Variant::INT, String(), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_CLASS_IS_ENUM, String(#m_enum).replace("::", ".")); \ } \ diff --git a/core/ustring.cpp b/core/ustring.cpp index ee07c7b11b..8273ed144b 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -588,7 +588,7 @@ String String::camelcase_to_underscore(bool lowercase) const { const char a = 'a', z = 'z'; int start_index = 0; - for (size_t i = 1; i < this->size(); i++) { + for (int i = 1; i < this->size(); i++) { bool is_upper = cstr[i] >= A && cstr[i] <= Z; bool is_number = cstr[i] >= '0' && cstr[i] <= '9'; bool are_next_2_lower = false; @@ -3655,12 +3655,12 @@ String String::sprintf(const Array &values, bool *error) const { CharType *self = (CharType *)c_str(); bool in_format = false; int value_index = 0; - int min_chars; - int min_decimals; - bool in_decimals; - bool pad_with_zeroes; - bool left_justified; - bool show_sign; + int min_chars = 0; + int min_decimals = 0; + bool in_decimals = false; + bool pad_with_zeroes = false; + bool left_justified = false; + bool show_sign = false; *error = true; @@ -3687,12 +3687,12 @@ String String::sprintf(const Array &values, bool *error) const { } int64_t value = values[value_index]; - int base; + int base = 16; bool capitalize = false; switch (c) { case 'd': base = 10; break; case 'o': base = 8; break; - case 'x': base = 16; break; + case 'x': break; case 'X': base = 16; capitalize = true; @@ -3842,7 +3842,7 @@ String String::sprintf(const Array &values, bool *error) const { } break; } - case '.': { // Float separtor. + case '.': { // Float separator. if (in_decimals) { return "too many decimal points in format"; } @@ -3851,7 +3851,7 @@ String String::sprintf(const Array &values, bool *error) const { break; } - case '*': { // Dyanmic width, based on value. + case '*': { // Dynamic width, based on value. if (value_index >= values.size()) { return "not enough arguments for format string"; } diff --git a/core/variant_call.cpp b/core/variant_call.cpp index ad15f8f5cb..dc1c24d234 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -481,6 +481,7 @@ struct _VariantCall { VCALL_LOCALMEM1(Array, erase); VCALL_LOCALMEM0(Array, sort); VCALL_LOCALMEM2(Array, sort_custom); + VCALL_LOCALMEM0R(Array, duplicate); VCALL_LOCALMEM0(Array, invert); static void _call_PoolByteArray_get_string_from_ascii(Variant &r_ret, Variant &p_self, const Variant **p_args) { @@ -1575,6 +1576,7 @@ void register_variant_methods() { ADDFUNC0(ARRAY, NIL, Array, sort, varray()); ADDFUNC2(ARRAY, NIL, Array, sort_custom, OBJECT, "obj", STRING, "func", varray()); ADDFUNC0(ARRAY, NIL, Array, invert, varray()); + ADDFUNC0(ARRAY, ARRAY, Array, duplicate, varray()); ADDFUNC0(POOL_BYTE_ARRAY, INT, PoolByteArray, size, varray()); ADDFUNC2(POOL_BYTE_ARRAY, NIL, PoolByteArray, set, INT, "idx", INT, "byte", varray()); diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 65c7b7cfec..d60d10cd3a 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "variant_parser.h" +#include "core/string_buffer.h" #include "io/resource_loader.h" #include "os/input_event.h" #include "os/keyboard.h" @@ -176,14 +177,15 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri }; case '#': { - String color_str = "#"; + StringBuffer color_str; + color_str += '#'; while (true) { CharType ch = p_stream->get_char(); if (p_stream->is_eof()) { r_token.type = TK_EOF; return OK; } else if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F')) { - color_str += String::chr(ch); + color_str += ch; } else { p_stream->saved = ch; @@ -191,7 +193,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri } } - r_token.value = Color::html(color_str); + r_token.value = Color::html(color_str.as_string()); r_token.type = TK_COLOR; return OK; }; @@ -296,7 +298,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri if (cchar == '-' || (cchar >= '0' && cchar <= '9')) { //a number - String num; + StringBuffer num; #define READING_SIGN 0 #define READING_INT 1 #define READING_DEC 2 @@ -359,7 +361,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri if (reading == READING_DONE) break; - num += String::chr(c); + num += c; c = p_stream->get_char(); } @@ -368,19 +370,19 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri r_token.type = TK_NUMBER; if (is_float) - r_token.value = num.to_double(); + r_token.value = num.as_double(); else - r_token.value = num.to_int(); + r_token.value = num.as_int(); return OK; } else if ((cchar >= 'A' && cchar <= 'Z') || (cchar >= 'a' && cchar <= 'z') || cchar == '_') { - String id; + StringBuffer id; bool first = true; while ((cchar >= 'A' && cchar <= 'Z') || (cchar >= 'a' && cchar <= 'z') || cchar == '_' || (!first && cchar >= '0' && cchar <= '9')) { - id += String::chr(cchar); + id += cchar; cchar = p_stream->get_char(); first = false; } @@ -388,7 +390,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri p_stream->saved = cchar; r_token.type = TK_IDENTIFIER; - r_token.value = id; + r_token.value = id.as_string(); return OK; } else { r_err_str = "Unexpected character."; diff --git a/core/vmap.h b/core/vmap.h index f0977341ec..8165a919b6 100644 --- a/core/vmap.h +++ b/core/vmap.h @@ -60,9 +60,13 @@ class VMap { int low = 0; int high = _data.size() - 1; - int middle; const _Pair *a = &_data[0]; + int middle = 0; +#if DEBUG_ENABLED + if (low > high) + ERR_PRINT("low > high, this may be a bug"); +#endif while (low <= high) { middle = (low + high) / 2; diff --git a/core/vset.h b/core/vset.h index 7b12ae0b25..67af6c1a4c 100644 --- a/core/vset.h +++ b/core/vset.h @@ -46,8 +46,13 @@ class VSet { int low = 0; int high = _data.size() - 1; - int middle; const T *a = &_data[0]; + int middle = 0; + +#if DEBUG_ENABLED + if (low > high) + ERR_PRINT("low > high, this may be a bug"); +#endif while (low <= high) { middle = (low + high) / 2; diff --git a/doc/base/classes.xml b/doc/base/classes.xml index e0b1ea3870..adb191cac1 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -31,6 +31,7 @@ <argument index="1" name="alpha" type="float"> </argument> <description> + Make a color from color name (color_names.inc) and alpha ranging from 0 to 1. </description> </method> <method name="abs"> @@ -61,7 +62,7 @@ </description> </method> <method name="assert"> - <return type="Nil"> + <return type="void"> </return> <argument index="0" name="condition" type="bool"> </argument> @@ -113,6 +114,7 @@ <argument index="0" name="ascii" type="int"> </argument> <description> + Returns a character as String of the given ASCII code. </description> </method> <method name="clamp"> @@ -262,7 +264,7 @@ </description> </method> <method name="funcref"> - <return type="FuncRef"> + <return type="Object"> </return> <argument index="0" name="instance" type="Object"> </argument> @@ -275,7 +277,7 @@ <method name="hash"> <return type="int"> </return> - <argument index="0" name="var:Variant" type="Variant"> + <argument index="0" name="var" type="Variant"> </argument> <description> Hash the variable passed and return an integer. @@ -299,6 +301,22 @@ Get an object by its ID. </description> </method> + <method name="inverse_lerp"> + <return type="float"> + </return> + <argument index="0" name="from" type="float"> + </argument> + <argument index="1" name="to" type="float"> + </argument> + <argument index="2" name="value" type="float"> + </argument> + <description> + Returns a normalized value considering the given range. + [codeblock] + inverse_lerp(3, 5, 4) # return 0.5 + [/codeblock] + </description> + </method> <method name="is_inf"> <return type="float"> </return> @@ -317,6 +335,15 @@ Returns whether s is a NaN (Not-A-Number) value. </description> </method> + <method name="len"> + <return type="int"> + </return> + <argument index="0" name="var" type="Variant"> + </argument> + <description> + Returns the length of the given Variant if applicable. It will return character count of a String, element count of an Array, etc. + </description> + </method> <method name="lerp"> <return type="float"> </return> @@ -340,7 +367,7 @@ </description> </method> <method name="load"> - <return type="Resource"> + <return type="Object"> </return> <argument index="0" name="path" type="String"> </argument> @@ -418,64 +445,44 @@ Preload a resource from the filesystem. The resource is loaded during script parsing. </description> </method> - <method name="print"> - <return type="Nil"> + <method name="print" qualifiers="vararg"> + <return type="void"> </return> - <argument index="0" name="what" type="Variant"> - </argument> - <argument index="1" name="..." type="Variant"> - </argument> <description> Print one or more arguments to strings in the best way possible to a console line. </description> </method> <method name="print_stack"> - <return type="Nil"> + <return type="void"> </return> <description> Print a stack track at code location, only works when running with debugger turned on. </description> </method> - <method name="printerr"> - <return type="Nil"> + <method name="printerr" qualifiers="vararg"> + <return type="void"> </return> - <argument index="0" name="what" type="Variant"> - </argument> - <argument index="1" name="..." type="Variant"> - </argument> <description> Print one or more arguments to strings in the best way possible to standard error line. </description> </method> - <method name="printraw"> - <return type="Nil"> + <method name="printraw" qualifiers="vararg"> + <return type="void"> </return> - <argument index="0" name="what" type="Variant"> - </argument> - <argument index="1" name="..." type="Variant"> - </argument> <description> Print one or more arguments to strings in the best way possible to console. No newline is added at the end. </description> </method> - <method name="prints"> - <return type="Nil"> + <method name="prints" qualifiers="vararg"> + <return type="void"> </return> - <argument index="0" name="what" type="Variant"> - </argument> - <argument index="1" name="..." type="Variant"> - </argument> <description> Print one or more arguments to the console with a space between each argument. </description> </method> - <method name="printt"> - <return type="Nil"> + <method name="printt" qualifiers="vararg"> + <return type="void"> </return> - <argument index="0" name="what" type="Variant"> - </argument> - <argument index="1" name="..." type="Variant"> - </argument> <description> Print one or more arguments to the console with a tab between each argument. </description> @@ -524,21 +531,39 @@ </description> </method> <method name="randomize"> - <return type="Nil"> + <return type="void"> </return> <description> Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. </description> </method> - <method name="range"> + <method name="range" qualifiers="vararg"> <return type="Array"> </return> - <argument index="0" name="..." type="Variant"> - </argument> <description> Return an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial, final-1, increment). </description> </method> + <method name="range_lerp"> + <return type="float"> + </return> + <argument index="0" name="value" type="float"> + </argument> + <argument index="1" name="istart" type="float"> + </argument> + <argument index="2" name="istop" type="float"> + </argument> + <argument index="3" name="ostart" type="float"> + </argument> + <argument index="4" name="ostop" type="float"> + </argument> + <description> + Maps a value from range [istart, istop] to [ostart, ostop]. + [codeblock] + range_lerp(75, 0, 100, -1, 1) # returns 0.5 + [/codeblock] + </description> + </method> <method name="round"> <return type="float"> </return> @@ -549,7 +574,7 @@ </description> </method> <method name="seed"> - <return type="Nil"> + <return type="void"> </return> <argument index="0" name="seed" type="int"> </argument> @@ -604,13 +629,9 @@ Snap float value to a given step. </description> </method> - <method name="str"> + <method name="str" qualifiers="vararg"> <return type="String"> </return> - <argument index="0" name="what" type="Variant"> - </argument> - <argument index="1" name="..." type="Variant"> - </argument> <description> Convert one or more arguments to string in the best way possible. </description> @@ -645,7 +666,7 @@ <method name="to_json"> <return type="String"> </return> - <argument index="0" name="var:Variant" type="Variant"> + <argument index="0" name="var" type="Variant"> </argument> <description> Convert a Variant to json text. @@ -657,6 +678,11 @@ <argument index="0" name="type" type="String"> </argument> <description> + Returns whether the given class is exist in [ClassDB]. + [codeblock] + type_exists("Sprite") # returns true + type_exists("Variant") # returns false + [/codeblock] </description> </method> <method name="typeof"> @@ -669,7 +695,7 @@ </description> </method> <method name="validate_json"> - <return type="Variant"> + <return type="String"> </return> <argument index="0" name="json" type="String"> </argument> @@ -696,7 +722,7 @@ </description> </method> <method name="weakref"> - <return type="WeakRef"> + <return type="Object"> </return> <argument index="0" name="obj" type="Object"> </argument> @@ -719,13 +745,13 @@ </method> </methods> <constants> - <constant name="PI" value="3.141593"> + <constant name="PI" value="3.141593" enum=""> Constant that represents how many times the diameter of a circumference fits around its perimeter. </constant> - <constant name="INF" value="inf"> + <constant name="INF" value="inf" enum=""> A positive infinity. (For negative infinity, use -INF). </constant> - <constant name="NAN" value="nan"> + <constant name="NAN" value="nan" enum=""> Macro constant that expands to an expression of type float that represents a NaN. The NaN values are used to identify undefined or non-representable values for floating-point elements, such as the square root of negative numbers or the result of 0/0. </constant> @@ -742,6 +768,9 @@ <methods> </methods> <members> + <member name="ARVRServer" type="ARVRServer" setter="" getter="" brief=""> + [ARVRServer] singleton + </member> <member name="AudioServer" type="AudioServer" setter="" getter="" brief=""> [AudioServer] singleton </member> @@ -754,9 +783,6 @@ <member name="Geometry" type="Geometry" setter="" getter="" brief=""> [Geometry] singleton </member> - <member name="ProjectSettings" type="ProjectSettings" setter="" getter="" brief=""> - [ProjectSettings] singleton - </member> <member name="IP" type="IP" setter="" getter="" brief=""> [IP] singleton </member> @@ -781,6 +807,9 @@ <member name="PhysicsServer" type="PhysicsServer" setter="" getter="" brief=""> [PhysicsServer] singleton </member> + <member name="ProjectSettings" type="ProjectSettings" setter="" getter="" brief=""> + [ProjectSettings] singleton + </member> <member name="ResourceLoader" type="ResourceLoader" setter="" getter="" brief=""> [ResourceLoader] singleton </member> @@ -831,7 +860,7 @@ <constant name="VALIGN_BOTTOM" value="2"> Vertical bottom alignment, usually for text-derived classes. </constant> - <constant name="SPKEY" value="16777216"> + <constant name="SPKEY" value="16777216" enum=""> Scancodes with this bit applied are non printable. </constant> <constant name="KEY_ESCAPE" value="16777217"> @@ -1496,191 +1525,191 @@ </constant> <constant name="KEY_MASK_GROUP_SWITCH" value="1073741824"> </constant> - <constant name="BUTTON_LEFT" value="1"> + <constant name="BUTTON_LEFT" value="1" enum=""> Left Mouse Button </constant> - <constant name="BUTTON_RIGHT" value="2"> + <constant name="BUTTON_RIGHT" value="2" enum=""> Right Mouse Button </constant> - <constant name="BUTTON_MIDDLE" value="3"> + <constant name="BUTTON_MIDDLE" value="3" enum=""> Middle Mouse Button </constant> - <constant name="BUTTON_WHEEL_UP" value="4"> + <constant name="BUTTON_WHEEL_UP" value="4" enum=""> Mouse wheel up </constant> - <constant name="BUTTON_WHEEL_DOWN" value="5"> + <constant name="BUTTON_WHEEL_DOWN" value="5" enum=""> Mouse wheel down </constant> - <constant name="BUTTON_WHEEL_LEFT" value="6"> + <constant name="BUTTON_WHEEL_LEFT" value="6" enum=""> Mouse wheel left button </constant> - <constant name="BUTTON_WHEEL_RIGHT" value="7"> + <constant name="BUTTON_WHEEL_RIGHT" value="7" enum=""> Mouse wheel right button </constant> - <constant name="BUTTON_MASK_LEFT" value="1"> + <constant name="BUTTON_MASK_LEFT" value="1" enum=""> </constant> - <constant name="BUTTON_MASK_RIGHT" value="2"> + <constant name="BUTTON_MASK_RIGHT" value="2" enum=""> </constant> - <constant name="BUTTON_MASK_MIDDLE" value="4"> + <constant name="BUTTON_MASK_MIDDLE" value="4" enum=""> </constant> - <constant name="JOY_BUTTON_0" value="0"> + <constant name="JOY_BUTTON_0" value="0" enum=""> Joypad Button 0 </constant> - <constant name="JOY_BUTTON_1" value="1"> + <constant name="JOY_BUTTON_1" value="1" enum=""> Joypad Button 1 </constant> - <constant name="JOY_BUTTON_2" value="2"> + <constant name="JOY_BUTTON_2" value="2" enum=""> Joypad Button 2 </constant> - <constant name="JOY_BUTTON_3" value="3"> + <constant name="JOY_BUTTON_3" value="3" enum=""> Joypad Button 3 </constant> - <constant name="JOY_BUTTON_4" value="4"> + <constant name="JOY_BUTTON_4" value="4" enum=""> Joypad Button 4 </constant> - <constant name="JOY_BUTTON_5" value="5"> + <constant name="JOY_BUTTON_5" value="5" enum=""> Joypad Button 5 </constant> - <constant name="JOY_BUTTON_6" value="6"> + <constant name="JOY_BUTTON_6" value="6" enum=""> Joypad Button 6 </constant> - <constant name="JOY_BUTTON_7" value="7"> + <constant name="JOY_BUTTON_7" value="7" enum=""> Joypad Button 7 </constant> - <constant name="JOY_BUTTON_8" value="8"> + <constant name="JOY_BUTTON_8" value="8" enum=""> Joypad Button 8 </constant> - <constant name="JOY_BUTTON_9" value="9"> + <constant name="JOY_BUTTON_9" value="9" enum=""> Joypad Button 9 </constant> - <constant name="JOY_BUTTON_10" value="10"> + <constant name="JOY_BUTTON_10" value="10" enum=""> Joypad Button 10 </constant> - <constant name="JOY_BUTTON_11" value="11"> + <constant name="JOY_BUTTON_11" value="11" enum=""> Joypad Button 11 </constant> - <constant name="JOY_BUTTON_12" value="12"> + <constant name="JOY_BUTTON_12" value="12" enum=""> Joypad Button 12 </constant> - <constant name="JOY_BUTTON_13" value="13"> + <constant name="JOY_BUTTON_13" value="13" enum=""> Joypad Button 13 </constant> - <constant name="JOY_BUTTON_14" value="14"> + <constant name="JOY_BUTTON_14" value="14" enum=""> Joypad Button 14 </constant> - <constant name="JOY_BUTTON_15" value="15"> + <constant name="JOY_BUTTON_15" value="15" enum=""> Joypad Button 15 </constant> - <constant name="JOY_BUTTON_MAX" value="16"> + <constant name="JOY_BUTTON_MAX" value="16" enum=""> Joypad Button 16 </constant> - <constant name="JOY_SONY_CIRCLE" value="1"> + <constant name="JOY_SONY_CIRCLE" value="1" enum=""> DUALSHOCK circle button </constant> - <constant name="JOY_SONY_X" value="0"> + <constant name="JOY_SONY_X" value="0" enum=""> DUALSHOCK X button </constant> - <constant name="JOY_SONY_SQUARE" value="2"> + <constant name="JOY_SONY_SQUARE" value="2" enum=""> DUALSHOCK square button </constant> - <constant name="JOY_SONY_TRIANGLE" value="3"> + <constant name="JOY_SONY_TRIANGLE" value="3" enum=""> DUALSHOCK triangle button </constant> - <constant name="JOY_XBOX_B" value="1"> + <constant name="JOY_XBOX_B" value="1" enum=""> XBOX controller B button </constant> - <constant name="JOY_XBOX_A" value="0"> + <constant name="JOY_XBOX_A" value="0" enum=""> XBOX controller A button </constant> - <constant name="JOY_XBOX_X" value="2"> + <constant name="JOY_XBOX_X" value="2" enum=""> XBOX controller X button </constant> - <constant name="JOY_XBOX_Y" value="3"> + <constant name="JOY_XBOX_Y" value="3" enum=""> XBOX controller Y button </constant> - <constant name="JOY_DS_A" value="1"> + <constant name="JOY_DS_A" value="1" enum=""> </constant> - <constant name="JOY_DS_B" value="0"> + <constant name="JOY_DS_B" value="0" enum=""> </constant> - <constant name="JOY_DS_X" value="3"> + <constant name="JOY_DS_X" value="3" enum=""> </constant> - <constant name="JOY_DS_Y" value="2"> + <constant name="JOY_DS_Y" value="2" enum=""> </constant> - <constant name="JOY_SELECT" value="10"> + <constant name="JOY_SELECT" value="10" enum=""> Joypad Button Select </constant> - <constant name="JOY_START" value="11"> + <constant name="JOY_START" value="11" enum=""> Joypad Button Start </constant> - <constant name="JOY_DPAD_UP" value="12"> + <constant name="JOY_DPAD_UP" value="12" enum=""> Joypad DPad Up </constant> - <constant name="JOY_DPAD_DOWN" value="13"> + <constant name="JOY_DPAD_DOWN" value="13" enum=""> Joypad DPad Down </constant> - <constant name="JOY_DPAD_LEFT" value="14"> + <constant name="JOY_DPAD_LEFT" value="14" enum=""> Joypad DPad Left </constant> - <constant name="JOY_DPAD_RIGHT" value="15"> + <constant name="JOY_DPAD_RIGHT" value="15" enum=""> Joypad DPad Right </constant> - <constant name="JOY_L" value="4"> + <constant name="JOY_L" value="4" enum=""> Joypad Left Shoulder Button </constant> - <constant name="JOY_L2" value="6"> + <constant name="JOY_L2" value="6" enum=""> Joypad Left Trigger </constant> - <constant name="JOY_L3" value="8"> + <constant name="JOY_L3" value="8" enum=""> Joypad Left Stick Click </constant> - <constant name="JOY_R" value="5"> + <constant name="JOY_R" value="5" enum=""> Joypad Right Shoulder Button </constant> - <constant name="JOY_R2" value="7"> + <constant name="JOY_R2" value="7" enum=""> Joypad Right Trigger </constant> - <constant name="JOY_R3" value="9"> + <constant name="JOY_R3" value="9" enum=""> Joypad Right Stick Click </constant> - <constant name="JOY_AXIS_0" value="0"> + <constant name="JOY_AXIS_0" value="0" enum=""> Joypad Left Stick Horizontal Axis </constant> - <constant name="JOY_AXIS_1" value="1"> + <constant name="JOY_AXIS_1" value="1" enum=""> Joypad Left Stick Vertical Axis </constant> - <constant name="JOY_AXIS_2" value="2"> + <constant name="JOY_AXIS_2" value="2" enum=""> Joypad Right Stick Horizontal Axis </constant> - <constant name="JOY_AXIS_3" value="3"> + <constant name="JOY_AXIS_3" value="3" enum=""> Joypad Right Stick Vertical Axis </constant> - <constant name="JOY_AXIS_4" value="4"> + <constant name="JOY_AXIS_4" value="4" enum=""> </constant> - <constant name="JOY_AXIS_5" value="5"> + <constant name="JOY_AXIS_5" value="5" enum=""> </constant> - <constant name="JOY_AXIS_6" value="6"> + <constant name="JOY_AXIS_6" value="6" enum=""> Joypad Left Trigger Analog Axis </constant> - <constant name="JOY_AXIS_7" value="7"> + <constant name="JOY_AXIS_7" value="7" enum=""> Joypad Right Trigger Analog Axis </constant> - <constant name="JOY_AXIS_MAX" value="8"> + <constant name="JOY_AXIS_MAX" value="8" enum=""> </constant> - <constant name="JOY_ANALOG_LX" value="0"> + <constant name="JOY_ANALOG_LX" value="0" enum=""> Joypad Left Stick Horizontal Axis </constant> - <constant name="JOY_ANALOG_LY" value="1"> + <constant name="JOY_ANALOG_LY" value="1" enum=""> Joypad Left Stick Vertical Axis </constant> - <constant name="JOY_ANALOG_RX" value="2"> + <constant name="JOY_ANALOG_RX" value="2" enum=""> Joypad Right Stick Horizontal Axis </constant> - <constant name="JOY_ANALOG_RY" value="3"> + <constant name="JOY_ANALOG_RY" value="3" enum=""> Joypad Right Stick Vertical Axis </constant> - <constant name="JOY_ANALOG_L2" value="6"> + <constant name="JOY_ANALOG_L2" value="6" enum=""> </constant> - <constant name="JOY_ANALOG_R2" value="7"> + <constant name="JOY_ANALOG_R2" value="7" enum=""> </constant> <constant name="OK" value="0"> Functions that return Error return OK when everything went ok. Most functions don't return error anyway and/or just print errors to stdout. @@ -1932,24 +1961,31 @@ Variable is of type [Array]. </constant> <constant name="TYPE_RAW_ARRAY" value="20"> + Variable is of type [PoolByteArray]. </constant> <constant name="TYPE_INT_ARRAY" value="21"> + Variable is of type [PoolIntArray]. </constant> <constant name="TYPE_REAL_ARRAY" value="22"> + Variable is of type [PoolRealArray]. </constant> <constant name="TYPE_STRING_ARRAY" value="23"> + Variable is of type [PoolStringArray]. </constant> <constant name="TYPE_VECTOR2_ARRAY" value="24"> + Variable is of type [PoolVector2Array]. </constant> <constant name="TYPE_VECTOR3_ARRAY" value="25"> + Variable is of type [PoolVector3Array]. </constant> <constant name="TYPE_COLOR_ARRAY" value="26"> + Variable is of type [PoolColorArray]. </constant> <constant name="TYPE_MAX" value="27"> </constant> </constants> </class> -<class name="@Native" category="Core"> +<class name="@NativeScript" category="Core"> <brief_description> </brief_description> <description> @@ -1969,6 +2005,542 @@ <constants> </constants> </class> +<class name="ARVRAnchor" inherits="Spatial" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_anchor_id" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_anchor_name" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_is_active" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_size" qualifiers="const"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="set_anchor_id"> + <return type="void"> + </return> + <argument index="0" name="anchor_id" type="int"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="anchor_id" type="int" setter="set_anchor_id" getter="get_anchor_id" brief=""> + </member> + </members> + <constants> + </constants> +</class> +<class name="ARVRCamera" inherits="Camera" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + </methods> + <constants> + </constants> +</class> +<class name="ARVRController" inherits="Spatial" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_controller_id" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_controller_name" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_is_active" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_joystick_axis" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="axis" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_joystick_id" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="is_button_pressed" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="button" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_controller_id"> + <return type="void"> + </return> + <argument index="0" name="controller_id" type="int"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="controller_id" type="int" setter="set_controller_id" getter="get_controller_id" brief=""> + </member> + </members> + <signals> + <signal name="button_pressed"> + <argument index="0" name="button" type="int"> + </argument> + <description> + </description> + </signal> + <signal name="button_release"> + <argument index="0" name="button" type="int"> + </argument> + <description> + </description> + </signal> + </signals> + <constants> + </constants> +</class> +<class name="ARVRInterface" inherits="Reference" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_name" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_recommended_render_targetsize"> + <return type="Vector2"> + </return> + <description> + </description> + </method> + <method name="hmd_is_present"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="initialize"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_initialized"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_installed"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_primary"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="set_is_primary"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="supports_hmd"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="uninitialize"> + <return type="void"> + </return> + <description> + </description> + </method> + </methods> + <members> + <member name="primary" type="bool" setter="set_is_primary" getter="is_primary" brief=""> + </member> + </members> + <constants> + <constant name="EYE_MONO" value="0"> + </constant> + <constant name="EYE_LEFT" value="1"> + </constant> + <constant name="EYE_RIGHT" value="2"> + </constant> + </constants> +</class> +<class name="ARVROrigin" inherits="Spatial" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_world_scale" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="set_world_scale"> + <return type="void"> + </return> + <argument index="0" name="world_scale" type="float"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="world_scale" type="float" setter="set_world_scale" getter="get_world_scale" brief=""> + </member> + </members> + <constants> + </constants> +</class> +<class name="ARVRPositionalTracker" inherits="Object" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_joy_id" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_name" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_orientation" qualifiers="const"> + <return type="Basis"> + </return> + <description> + </description> + </method> + <method name="get_position" qualifiers="const"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="get_tracks_orientation" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_tracks_position" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_transform" qualifiers="const"> + <return type="Transform"> + </return> + <argument index="0" name="adjust_by_reference_frame" type="bool"> + </argument> + <description> + </description> + </method> + <method name="get_type" qualifiers="const"> + <return type="int" enum="ARVRServer.TrackerType"> + </return> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> +<class name="ARVRScriptInterface" inherits="ARVRInterface" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="_get_projection_for_eye" qualifiers="virtual"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="commit_for_eye" qualifiers="virtual"> + <return type="void"> + </return> + <argument index="0" name="eye" type="int"> + </argument> + <argument index="1" name="render_target" type="RID"> + </argument> + <description> + </description> + </method> + <method name="get_recommended_render_targetsize" qualifiers="virtual"> + <return type="Vector2"> + </return> + <description> + </description> + </method> + <method name="get_transform_for_eye" qualifiers="virtual"> + <return type="Transform"> + </return> + <argument index="0" name="eye" type="int"> + </argument> + <argument index="1" name="cam_transform" type="Transform"> + </argument> + <description> + </description> + </method> + <method name="hmd_is_present" qualifiers="virtual"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="initialize" qualifiers="virtual"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_initialized" qualifiers="virtual"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_installed" qualifiers="virtual"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_stereo" qualifiers="virtual"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="process" qualifiers="virtual"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="supports_hmd" qualifiers="virtual"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="uninitialize" qualifiers="virtual"> + <return type="void"> + </return> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> +<class name="ARVRServer" inherits="Object" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="add_interface"> + <return type="void"> + </return> + <argument index="0" name="arg0" type="ARVRInterface"> + </argument> + <description> + </description> + </method> + <method name="find_interface" qualifiers="const"> + <return type="ARVRInterface"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="get_interface" qualifiers="const"> + <return type="ARVRInterface"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_interface_count" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_reference_frame" qualifiers="const"> + <return type="Transform"> + </return> + <description> + </description> + </method> + <method name="get_tracker" qualifiers="const"> + <return type="ARVRPositionalTracker"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_tracker_count" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_world_scale" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="remove_interface"> + <return type="void"> + </return> + <argument index="0" name="arg0" type="ARVRInterface"> + </argument> + <description> + </description> + </method> + <method name="request_reference_frame"> + <return type="void"> + </return> + <argument index="0" name="ignore_tilt" type="bool"> + </argument> + <argument index="1" name="keep_height" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_primary_interface"> + <return type="void"> + </return> + <argument index="0" name="arg0" type="ARVRInterface"> + </argument> + <description> + </description> + </method> + <method name="set_world_scale"> + <return type="void"> + </return> + <argument index="0" name="arg0" type="float"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="world_scale" type="float" setter="set_world_scale" getter="get_world_scale" brief=""> + </member> + </members> + <signals> + <signal name="interface_added"> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </signal> + <signal name="interface_removed"> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </signal> + <signal name="tracker_added"> + <argument index="0" name="name" type="String"> + </argument> + <argument index="1" name="type" type="int"> + </argument> + <description> + </description> + </signal> + <signal name="tracker_removed"> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </signal> + </signals> + <constants> + <constant name="TRACKER_CONTROLLER" value="1"> + </constant> + <constant name="TRACKER_BASESTATION" value="2"> + </constant> + <constant name="TRACKER_ANCHOR" value="4"> + </constant> + <constant name="TRACKER_UNKNOWN" value="128"> + </constant> + <constant name="TRACKER_ANY_KNOWN" value="127"> + </constant> + <constant name="TRACKER_ANY" value="255"> + </constant> + </constants> +</class> <class name="AStar" inherits="Reference" category="Core"> <brief_description> AStar class representation that uses vectors as edges. @@ -1979,6 +2551,8 @@ </description> <methods> <method name="_compute_cost" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="from_id" type="int"> </argument> <argument index="1" name="to_id" type="int"> @@ -1987,6 +2561,8 @@ </description> </method> <method name="_estimate_cost" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="from_id" type="int"> </argument> <argument index="1" name="to_id" type="int"> @@ -1995,11 +2571,13 @@ </description> </method> <method name="add_point"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="pos" type="Vector3"> </argument> - <argument index="2" name="weight_scale" type="float" default="1"> + <argument index="2" name="weight_scale" type="float" default="1.0"> </argument> <description> Add a new point at the given position [code]pos[/code] with the given identifier [code]id[/code]. The [code]weight_scale[/code] has to be 1 or larger. @@ -2017,11 +2595,15 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clear all the points and segments from AStar instance. </description> </method> <method name="connect_points"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="to_id" type="int"> @@ -2033,6 +2615,8 @@ </description> </method> <method name="disconnect_points"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="to_id" type="int"> @@ -2115,6 +2699,8 @@ </description> </method> <method name="remove_point"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> @@ -2164,14 +2750,14 @@ </description> </method> <method name="get_label"> - <return type="Object"> + <return type="Label"> </return> <description> Return the label used for built-in text. </description> </method> <method name="get_ok"> - <return type="Object"> + <return type="Button"> </return> <description> Return the OK Button. @@ -2185,15 +2771,17 @@ </description> </method> <method name="register_text_enter"> - <return type="LineEdit"> + <return type="void"> </return> - <argument index="0" name="line_edit" type="Object"> + <argument index="0" name="line_edit" type="Node"> </argument> <description> Register a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted. </description> </method> <method name="set_hide_on_ok"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -2201,6 +2789,8 @@ </description> </method> <method name="set_text"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> @@ -2296,6 +2886,8 @@ </description> </method> <method name="play"> + <return type="void"> + </return> <argument index="0" name="anim" type="String" default=""""> </argument> <description> @@ -2303,6 +2895,8 @@ </description> </method> <method name="set_animation"> + <return type="void"> + </return> <argument index="0" name="animation" type="String"> </argument> <description> @@ -2310,6 +2904,8 @@ </description> </method> <method name="set_centered"> + <return type="void"> + </return> <argument index="0" name="centered" type="bool"> </argument> <description> @@ -2317,6 +2913,8 @@ </description> </method> <method name="set_flip_h"> + <return type="void"> + </return> <argument index="0" name="flip_h" type="bool"> </argument> <description> @@ -2324,6 +2922,8 @@ </description> </method> <method name="set_flip_v"> + <return type="void"> + </return> <argument index="0" name="flip_v" type="bool"> </argument> <description> @@ -2331,6 +2931,8 @@ </description> </method> <method name="set_frame"> + <return type="void"> + </return> <argument index="0" name="frame" type="int"> </argument> <description> @@ -2338,6 +2940,8 @@ </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> @@ -2345,6 +2949,8 @@ </description> </method> <method name="set_sprite_frames"> + <return type="void"> + </return> <argument index="0" name="sprite_frames" type="SpriteFrames"> </argument> <description> @@ -2352,6 +2958,8 @@ </description> </method> <method name="stop"> + <return type="void"> + </return> <description> Stop the current animation (does not reset the frame counter). </description> @@ -2425,6 +3033,8 @@ </description> </method> <method name="play"> + <return type="void"> + </return> <argument index="0" name="anim" type="String" default=""""> </argument> <description> @@ -2432,6 +3042,8 @@ </description> </method> <method name="set_animation"> + <return type="void"> + </return> <argument index="0" name="animation" type="String"> </argument> <description> @@ -2439,6 +3051,8 @@ </description> </method> <method name="set_frame"> + <return type="void"> + </return> <argument index="0" name="frame" type="int"> </argument> <description> @@ -2446,6 +3060,8 @@ </description> </method> <method name="set_sprite_frames"> + <return type="void"> + </return> <argument index="0" name="sprite_frames" type="SpriteFrames"> </argument> <description> @@ -2453,6 +3069,8 @@ </description> </method> <method name="stop"> + <return type="void"> + </return> <description> Stop the current animation (does not reset the frame counter). </description> @@ -2490,7 +3108,7 @@ <method name="add_track"> <return type="int"> </return> - <argument index="0" name="type" type="int"> + <argument index="0" name="type" type="int" enum="Animation.TrackType"> </argument> <argument index="1" name="at_pos" type="int" default="-1"> </argument> @@ -2499,6 +3117,8 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clear the animation (clear all tracks and reset all). </description> @@ -2576,6 +3196,8 @@ </description> </method> <method name="remove_track"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -2583,6 +3205,8 @@ </description> </method> <method name="set_length"> + <return type="void"> + </return> <argument index="0" name="time_sec" type="float"> </argument> <description> @@ -2590,6 +3214,8 @@ </description> </method> <method name="set_loop"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -2597,6 +3223,8 @@ </description> </method> <method name="set_step"> + <return type="void"> + </return> <argument index="0" name="size_sec" type="float"> </argument> <description> @@ -2625,7 +3253,7 @@ </description> </method> <method name="track_get_interpolation_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Animation.InterpolationType"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -2665,6 +3293,8 @@ </description> </method> <method name="track_get_key_value" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> @@ -2683,7 +3313,7 @@ </description> </method> <method name="track_get_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Animation.TrackType"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -2692,6 +3322,8 @@ </description> </method> <method name="track_insert_key"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="time" type="float"> @@ -2714,6 +3346,8 @@ </description> </method> <method name="track_move_down"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -2721,6 +3355,8 @@ </description> </method> <method name="track_move_up"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -2728,6 +3364,8 @@ </description> </method> <method name="track_remove_key"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> @@ -2737,6 +3375,8 @@ </description> </method> <method name="track_remove_key_at_pos"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="pos" type="float"> @@ -2746,6 +3386,8 @@ </description> </method> <method name="track_set_imported"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="imported" type="bool"> @@ -2755,6 +3397,8 @@ </description> </method> <method name="track_set_interpolation_loop_wrap"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="interpolation" type="bool"> @@ -2763,15 +3407,19 @@ </description> </method> <method name="track_set_interpolation_type"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="interpolation" type="int"> + <argument index="1" name="interpolation" type="int" enum="Animation.InterpolationType"> </argument> <description> Set the interpolation type of a given track, from the INTERPOLATION_* enum. </description> </method> <method name="track_set_key_transition"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="key_idx" type="int"> @@ -2783,6 +3431,8 @@ </description> </method> <method name="track_set_key_value"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="key" type="int"> @@ -2794,6 +3444,8 @@ </description> </method> <method name="track_set_path"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="path" type="NodePath"> @@ -2844,19 +3496,23 @@ </description> </method> <method name="value_track_get_update_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Animation.UpdateMode"> </return> <argument index="0" name="idx" type="int"> </argument> <description> + Return the update mode of a value track. </description> </method> <method name="value_track_set_update_mode"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="Animation.UpdateMode"> </argument> <description> + Set the update mode (UPDATE_*) of a value track. </description> </method> </methods> @@ -2880,10 +3536,13 @@ Cubic interpolation. </constant> <constant name="UPDATE_CONTINUOUS" value="0"> + Update between keyframes. </constant> <constant name="UPDATE_DISCRETE" value="1"> + Update at the keyframes and hold the value. </constant> <constant name="UPDATE_TRIGGER" value="2"> + Update at the keyframes. </constant> </constants> </class> @@ -2896,7 +3555,7 @@ </description> <methods> <method name="add_animation"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="name" type="String"> </argument> @@ -2907,6 +3566,8 @@ </description> </method> <method name="advance"> + <return type="void"> + </return> <argument index="0" name="delta" type="float"> </argument> <description> @@ -2919,22 +3580,30 @@ <argument index="0" name="anim_from" type="String"> </argument> <description> + Return the name of the next animation in the queue. </description> </method> <method name="animation_set_next"> + <return type="void"> + </return> <argument index="0" name="anim_from" type="String"> </argument> <argument index="1" name="anim_to" type="String"> </argument> <description> + Set the name of an animation that will be played after. </description> </method> <method name="clear_caches"> + <return type="void"> + </return> <description> The animation player creates caches for faster access to the nodes it will animate. However, if a specific node is removed, it may not notice it, so clear_caches will force the player to search for the nodes again. </description> </method> <method name="clear_queue"> + <return type="void"> + </return> <description> If animations are queued to play, clear them. </description> @@ -2965,7 +3634,7 @@ </description> </method> <method name="get_animation_process_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="AnimationPlayer.AnimationProcessMode"> </return> <description> Return the mode in which the animation player processes. See [method set_animation_process_mode]. @@ -3062,11 +3731,13 @@ </description> </method> <method name="play"> + <return type="void"> + </return> <argument index="0" name="name" type="String" default=""""> </argument> <argument index="1" name="custom_blend" type="float" default="-1"> </argument> - <argument index="2" name="custom_speed" type="float" default="1"> + <argument index="2" name="custom_speed" type="float" default="1.0"> </argument> <argument index="3" name="from_end" type="bool" default="false"> </argument> @@ -3075,6 +3746,8 @@ </description> </method> <method name="play_backwards"> + <return type="void"> + </return> <argument index="0" name="name" type="String" default=""""> </argument> <argument index="1" name="custom_blend" type="float" default="-1"> @@ -3084,6 +3757,8 @@ </description> </method> <method name="queue"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -3091,6 +3766,8 @@ </description> </method> <method name="remove_animation"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -3098,6 +3775,8 @@ </description> </method> <method name="rename_animation"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="newname" type="String"> @@ -3107,6 +3786,8 @@ </description> </method> <method name="seek"> + <return type="void"> + </return> <argument index="0" name="pos_sec" type="float"> </argument> <argument index="1" name="update" type="bool" default="false"> @@ -3116,6 +3797,8 @@ </description> </method> <method name="set_active"> + <return type="void"> + </return> <argument index="0" name="active" type="bool"> </argument> <description> @@ -3123,13 +3806,17 @@ </description> </method> <method name="set_animation_process_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="AnimationPlayer.AnimationProcessMode"> </argument> <description> Set the mode in which the animation player processes. By default, it processes on idle time (framerate dependent), but using fixed time works well for animating static collision bodies in 2D and 3D. See enum ANIMATION_PROCESS_*. </description> </method> <method name="set_autoplay"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -3137,6 +3824,8 @@ </description> </method> <method name="set_blend_time"> + <return type="void"> + </return> <argument index="0" name="anim_from" type="String"> </argument> <argument index="1" name="anim_to" type="String"> @@ -3148,6 +3837,8 @@ </description> </method> <method name="set_current_animation"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> <description> @@ -3155,6 +3846,8 @@ </description> </method> <method name="set_default_blend_time"> + <return type="void"> + </return> <argument index="0" name="sec" type="float"> </argument> <description> @@ -3162,6 +3855,8 @@ </description> </method> <method name="set_root"> + <return type="void"> + </return> <argument index="0" name="path" type="NodePath"> </argument> <description> @@ -3169,6 +3864,8 @@ </description> </method> <method name="set_speed_scale"> + <return type="void"> + </return> <argument index="0" name="speed" type="float"> </argument> <description> @@ -3176,6 +3873,8 @@ </description> </method> <method name="stop"> + <return type="void"> + </return> <argument index="0" name="reset" type="bool" default="true"> </argument> <description> @@ -3183,6 +3882,8 @@ </description> </method> <method name="stop_all"> + <return type="void"> + </return> <description> Stop playback of animations (deprecated). </description> @@ -3191,7 +3892,7 @@ <members> <member name="playback_default_blend_time" type="float" setter="set_default_blend_time" getter="get_default_blend_time" brief=""> </member> - <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" brief=""> + <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" brief="" enum="AnimationPlayer.AnimationProcessMode"> </member> <member name="root_node" type="NodePath" setter="set_root" getter="get_root" brief=""> </member> @@ -3239,7 +3940,9 @@ </description> <methods> <method name="add_node"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="AnimationTreePlayer.NodeType"> </argument> <argument index="1" name="id" type="String"> </argument> @@ -3248,6 +3951,8 @@ </description> </method> <method name="advance"> + <return type="void"> + </return> <argument index="0" name="delta" type="float"> </argument> <description> @@ -3259,6 +3964,7 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns an animation given its name. </description> </method> <method name="animation_node_get_master_animation" qualifiers="const"> @@ -3270,6 +3976,8 @@ </description> </method> <method name="animation_node_set_animation"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="animation" type="Animation"> @@ -3279,6 +3987,8 @@ </description> </method> <method name="animation_node_set_filter_path"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="path" type="NodePath"> @@ -3289,6 +3999,8 @@ </description> </method> <method name="animation_node_set_master_animation"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="source" type="String"> @@ -3306,6 +4018,7 @@ <argument index="2" name="dst_input_idx" type="int"> </argument> <description> + Returns whether node [code]id[/code] and [code]dst_id[/code] are connected at the specified slot. </description> </method> <method name="blend2_node_get_amount" qualifiers="const"> @@ -3314,17 +4027,23 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns the blend amount of a Blend2 node given its name. </description> </method> <method name="blend2_node_set_amount"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="blend" type="float"> </argument> <description> + Sets the blend amount of a Blend2 node given its name and value. </description> </method> <method name="blend2_node_set_filter_path"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="path" type="NodePath"> @@ -3340,14 +4059,18 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns the blend amount of a Blend3 node given its name. </description> </method> <method name="blend3_node_set_amount"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="blend" type="float"> </argument> <description> + Sets the blend amount of a Blend3 node given its name and value. </description> </method> <method name="blend4_node_get_amount" qualifiers="const"> @@ -3356,18 +4079,22 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns the blend amount of a Blend4 node given its name. </description> </method> <method name="blend4_node_set_amount"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="blend" type="Vector2"> </argument> <description> + Sets the blend amount of a Blend4 node given its name and value. </description> </method> <method name="connect_nodes"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="id" type="String"> </argument> @@ -3376,20 +4103,25 @@ <argument index="2" name="dst_input_idx" type="int"> </argument> <description> + Connects node [code]id[/code] to [code]dst_id[/code] at the specified input slot. </description> </method> <method name="disconnect_nodes"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="dst_input_idx" type="int"> </argument> <description> + Disconnects nodes connected to [code]id[/code] at the specified input slot. </description> </method> <method name="get_animation_process_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="AnimationTreePlayer.AnimationProcessMode"> </return> <description> + Returns playback process mode of this AnimationTreePlayer. </description> </method> <method name="get_base_path" qualifiers="const"> @@ -3408,12 +4140,14 @@ <return type="PoolStringArray"> </return> <description> + Returns a PoolStringArray containing the name of all nodes. </description> </method> <method name="is_active" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether this AnimationTreePlayer is active. </description> </method> <method name="mix_node_get_amount" qualifiers="const"> @@ -3422,14 +4156,18 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns mix amount of a Mix node given its name. </description> </method> <method name="mix_node_set_amount"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="ratio" type="float"> </argument> <description> + Sets mix amount of a Mix node given its name and value. </description> </method> <method name="node_exists" qualifiers="const"> @@ -3467,10 +4205,11 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns position of a node in the graph given its name. </description> </method> <method name="node_get_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="AnimationTreePlayer.NodeType"> </return> <argument index="0" name="id" type="String"> </argument> @@ -3479,7 +4218,7 @@ </description> </method> <method name="node_rename"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="node" type="String"> </argument> @@ -3490,11 +4229,14 @@ </description> </method> <method name="node_set_pos"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="screen_pos" type="Vector2"> </argument> <description> + Sets position of a node in the graph given its name and position. </description> </method> <method name="oneshot_node_get_autorestart_delay" qualifiers="const"> @@ -3503,6 +4245,7 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns autostart delay of a OneShot node given its name. </description> </method> <method name="oneshot_node_get_autorestart_random_delay" qualifiers="const"> @@ -3511,6 +4254,7 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns autostart random delay of a OneShot node given its name. </description> </method> <method name="oneshot_node_get_fadein_time" qualifiers="const"> @@ -3519,6 +4263,7 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns fade in time of a OneShot node given its name. </description> </method> <method name="oneshot_node_get_fadeout_time" qualifiers="const"> @@ -3527,6 +4272,7 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns fade out time of a OneShot node given its name. </description> </method> <method name="oneshot_node_has_autorestart" qualifiers="const"> @@ -3535,6 +4281,7 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns whether a OneShot node will auto restart given its name. </description> </method> <method name="oneshot_node_is_active" qualifiers="const"> @@ -3543,49 +4290,67 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns whether a OneShot node is active given its name. </description> </method> <method name="oneshot_node_set_autorestart"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="enable" type="bool"> </argument> <description> + Sets autorestart property of a OneShot node given its name and value. </description> </method> <method name="oneshot_node_set_autorestart_delay"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="delay_sec" type="float"> </argument> <description> + Sets autorestart delay of a OneShot node given its name and value in seconds. </description> </method> <method name="oneshot_node_set_autorestart_random_delay"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="rand_sec" type="float"> </argument> <description> + Sets autorestart random delay of a OneShot node given its name and value in seconds. </description> </method> <method name="oneshot_node_set_fadein_time"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="time_sec" type="float"> </argument> <description> + Sets fade in time of a OneShot node given its name and value in seconds. </description> </method> <method name="oneshot_node_set_fadeout_time"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="time_sec" type="float"> </argument> <description> + Sets fade out time of a OneShot node given its name and value in seconds. </description> </method> <method name="oneshot_node_set_filter_path"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="path" type="NodePath"> @@ -3596,50 +4361,74 @@ </description> </method> <method name="oneshot_node_start"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <description> + Starts a OneShot node given its name. </description> </method> <method name="oneshot_node_stop"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <description> + Stops a OneShot node given its name. </description> </method> <method name="recompute_caches"> + <return type="void"> + </return> <description> </description> </method> <method name="remove_node"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <description> </description> </method> <method name="reset"> + <return type="void"> + </return> <description> + Resets this AnimationTreePlayer. </description> </method> <method name="set_active"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> + Sets whether this AnimationTreePlayer is active. AnimationTreePlayer will start processing if set to active. </description> </method> <method name="set_animation_process_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="AnimationTreePlayer.AnimationProcessMode"> </argument> <description> + Sets process mode (ANIMATION_PROCESS_*) of this AnimationTreePlayer. </description> </method> <method name="set_base_path"> + <return type="void"> + </return> <argument index="0" name="path" type="NodePath"> </argument> <description> + Sets base path of this AnimationTreePlayer. </description> </method> <method name="set_master_player"> + <return type="void"> + </return> <argument index="0" name="nodepath" type="NodePath"> </argument> <description> @@ -3651,25 +4440,34 @@ <argument index="0" name="id" type="String"> </argument> <description> + Returns time scale value of a TimeScale node given its name. </description> </method> <method name="timescale_node_set_scale"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="scale" type="float"> </argument> <description> + Sets time scale value of a TimeScale node given its name and value. </description> </method> <method name="timeseek_node_seek"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="pos_sec" type="float"> </argument> <description> + Sets time seek value of a TimeSeek node given its name and value. </description> </method> <method name="transition_node_delete_input"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="input_idx" type="int"> @@ -3712,6 +4510,8 @@ </description> </method> <method name="transition_node_set_current"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="input_idx" type="int"> @@ -3720,6 +4520,8 @@ </description> </method> <method name="transition_node_set_input_auto_advance"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="input_idx" type="int"> @@ -3730,6 +4532,8 @@ </description> </method> <method name="transition_node_set_input_count"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="count" type="int"> @@ -3738,6 +4542,8 @@ </description> </method> <method name="transition_node_set_xfade_time"> + <return type="void"> + </return> <argument index="0" name="id" type="String"> </argument> <argument index="1" name="time_sec" type="float"> @@ -3747,29 +4553,39 @@ </method> </methods> <members> - <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" brief=""> + <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" brief="" enum="AnimationTreePlayer.AnimationProcessMode"> </member> </members> <constants> <constant name="NODE_OUTPUT" value="0"> + Output node. </constant> <constant name="NODE_ANIMATION" value="1"> + Animation node. </constant> <constant name="NODE_ONESHOT" value="2"> + OneShot node. </constant> <constant name="NODE_MIX" value="3"> + Mix node. </constant> <constant name="NODE_BLEND2" value="4"> + Blend2 node. </constant> <constant name="NODE_BLEND3" value="5"> + Blend3 node. </constant> <constant name="NODE_BLEND4" value="6"> + Blend4 node. </constant> <constant name="NODE_TIMESCALE" value="7"> + TimeScale node. </constant> <constant name="NODE_TIMESEEK" value="8"> + TimeSeek node. </constant> <constant name="NODE_TRANSITION" value="9"> + Transition node. </constant> </constants> </class> @@ -3894,7 +4710,7 @@ </description> </method> <method name="get_space_override_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Area.SpaceOverride"> </return> <description> Return the space override mode. @@ -3936,7 +4752,7 @@ <method name="overlaps_area" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="area" type="Object"> + <argument index="0" name="area" type="Node"> </argument> <description> Return whether the area passed is totally or partially inside this area. @@ -3945,13 +4761,15 @@ <method name="overlaps_body" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="body" type="Object"> + <argument index="0" name="body" type="Node"> </argument> <description> Return whether the body passed is totally or partially inside this area. </description> </method> <method name="set_angular_damp"> + <return type="void"> + </return> <argument index="0" name="angular_damp" type="float"> </argument> <description> @@ -3960,18 +4778,24 @@ </description> </method> <method name="set_audio_bus"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="set_audio_bus_override"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="collision_layer" type="int"> </argument> <description> @@ -3981,6 +4805,8 @@ </description> </method> <method name="set_collision_layer_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -3990,6 +4816,8 @@ </description> </method> <method name="set_collision_mask"> + <return type="void"> + </return> <argument index="0" name="collision_mask" type="int"> </argument> <description> @@ -3997,6 +4825,8 @@ </description> </method> <method name="set_collision_mask_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -4006,6 +4836,8 @@ </description> </method> <method name="set_gravity"> + <return type="void"> + </return> <argument index="0" name="gravity" type="float"> </argument> <description> @@ -4014,6 +4846,8 @@ </description> </method> <method name="set_gravity_distance_scale"> + <return type="void"> + </return> <argument index="0" name="distance_scale" type="float"> </argument> <description> @@ -4021,6 +4855,8 @@ </description> </method> <method name="set_gravity_is_point"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -4028,6 +4864,8 @@ </description> </method> <method name="set_gravity_vector"> + <return type="void"> + </return> <argument index="0" name="vector" type="Vector3"> </argument> <description> @@ -4036,6 +4874,8 @@ </description> </method> <method name="set_linear_damp"> + <return type="void"> + </return> <argument index="0" name="linear_damp" type="float"> </argument> <description> @@ -4044,6 +4884,8 @@ </description> </method> <method name="set_monitorable"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -4051,6 +4893,8 @@ </description> </method> <method name="set_monitoring"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -4058,33 +4902,43 @@ </description> </method> <method name="set_priority"> + <return type="void"> + </return> <argument index="0" name="priority" type="float"> </argument> <description> - Set the order in which the area is processed. Greater values mean the area gets processed first. This is useful for areas which have an space override different from AREA_SPACE_OVERRIDE_DISABLED or AREA_SPACE_OVERRIDE_COMBINE, as they replace values, and are thus order-dependent. + Set the order in which the area is processed. Greater values mean the area gets processed first. This is useful for areas which have a space override different from AREA_SPACE_OVERRIDE_DISABLED or AREA_SPACE_OVERRIDE_COMBINE, as they replace values, and are thus order-dependent. Areas with the same priority value get evaluated in an unpredictable order, and should be differentiated if evaluation order is to be important. </description> </method> <method name="set_reverb_amount"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_reverb_bus"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="set_reverb_uniformity"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_space_override_mode"> - <argument index="0" name="enable" type="int"> + <return type="void"> + </return> + <argument index="0" name="enable" type="int" enum="Area.SpaceOverride"> </argument> <description> Set the space override mode. This mode controls how an area affects gravity and damp. @@ -4096,6 +4950,8 @@ </description> </method> <method name="set_use_reverb_bus"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -4127,7 +4983,7 @@ </member> <member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring" brief=""> </member> - <member name="priority" type="int" setter="set_priority" getter="get_priority" brief=""> + <member name="priority" type="float" setter="set_priority" getter="get_priority" brief=""> </member> <member name="reverb_bus_amount" type="float" setter="set_reverb_amount" getter="get_reverb_amount" brief=""> </member> @@ -4137,7 +4993,7 @@ </member> <member name="reverb_bus_uniformity" type="float" setter="set_reverb_uniformity" getter="get_reverb_uniformity" brief=""> </member> - <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" brief=""> + <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" brief="" enum="Area.SpaceOverride"> </member> </members> <signals> @@ -4227,10 +5083,10 @@ </class> <class name="Area2D" inherits="CollisionObject2D" category="Core"> <brief_description> - General purpose area detection and influence for 2D physics. + 2D area that detects nodes that enter or exit it. Can override 2D physics properties within range. </brief_description> <description> - General purpose area detection for 2D physics. Areas can be used for detection of objects that enter/exit them, as well as overriding space parameters (changing gravity, damping, etc). For this, use any space override different from AREA_SPACE_OVERRIDE_DISABLE and point gravity at the center of mass. + 2D area that detects nodes that enter or exit it. Change the 'space_override' property SPACE_OVERRIDE_* to override physics parameters for nodes like [Rigidbody2D]. E.g. gravity, damping... See [CollisionObject2D] for usage. </description> <methods> <method name="get_angular_damp" qualifiers="const"> @@ -4259,14 +5115,14 @@ <argument index="0" name="bit" type="int"> </argument> <description> - Return an individual bit on the layer mask. + Return an individual bit on the layer mask. Describes whether other areas will collide with this one on the given layer. </description> </method> <method name="get_collision_mask" qualifiers="const"> <return type="int"> </return> <description> - Return the physics layers this area can scan for collisions. + Return the physics layers this area will scan to determine collisions. </description> </method> <method name="get_collision_mask_bit" qualifiers="const"> @@ -4275,7 +5131,7 @@ <argument index="0" name="bit" type="int"> </argument> <description> - Return an individual bit on the collision mask. + Return an individual bit on the collision mask. Describes whether this area will collide with others on the given layer. </description> </method> <method name="get_gravity" qualifiers="const"> @@ -4310,14 +5166,14 @@ <return type="Array"> </return> <description> - Return a list of the areas that are totally or partially inside this area. + Returns a list of the [Area2D]s that intersect with this area. </description> </method> <method name="get_overlapping_bodies" qualifiers="const"> <return type="Array"> </return> <description> - Return a list of the bodies ([PhysicsBody2D]) that are totally or partially inside this area. + Return a list of the [PhysicsBody2D]s that intersect with this area. </description> </method> <method name="get_priority" qualifiers="const"> @@ -4328,7 +5184,7 @@ </description> </method> <method name="get_space_override_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Area2D.SpaceOverride"> </return> <description> Return the space override mode. @@ -4364,7 +5220,7 @@ <method name="overlaps_area" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="area" type="Object"> + <argument index="0" name="area" type="Node"> </argument> <description> Return whether the area passed is totally or partially inside this area. @@ -4373,13 +5229,15 @@ <method name="overlaps_body" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="body" type="Object"> + <argument index="0" name="body" type="Node"> </argument> <description> Return whether the body passed is totally or partially inside this area. </description> </method> <method name="set_angular_damp"> + <return type="void"> + </return> <argument index="0" name="angular_damp" type="float"> </argument> <description> @@ -4388,18 +5246,24 @@ </description> </method> <method name="set_audio_bus"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="set_audio_bus_override"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="collision_layer" type="int"> </argument> <description> @@ -4409,6 +5273,8 @@ </description> </method> <method name="set_collision_layer_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -4418,6 +5284,8 @@ </description> </method> <method name="set_collision_mask"> + <return type="void"> + </return> <argument index="0" name="collision_mask" type="int"> </argument> <description> @@ -4425,6 +5293,8 @@ </description> </method> <method name="set_collision_mask_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -4434,6 +5304,8 @@ </description> </method> <method name="set_gravity"> + <return type="void"> + </return> <argument index="0" name="gravity" type="float"> </argument> <description> @@ -4442,6 +5314,8 @@ </description> </method> <method name="set_gravity_distance_scale"> + <return type="void"> + </return> <argument index="0" name="distance_scale" type="float"> </argument> <description> @@ -4449,6 +5323,8 @@ </description> </method> <method name="set_gravity_is_point"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -4456,6 +5332,8 @@ </description> </method> <method name="set_gravity_vector"> + <return type="void"> + </return> <argument index="0" name="vector" type="Vector2"> </argument> <description> @@ -4464,6 +5342,8 @@ </description> </method> <method name="set_linear_damp"> + <return type="void"> + </return> <argument index="0" name="linear_damp" type="float"> </argument> <description> @@ -4472,6 +5352,8 @@ </description> </method> <method name="set_monitorable"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -4479,6 +5361,8 @@ </description> </method> <method name="set_monitoring"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -4486,15 +5370,19 @@ </description> </method> <method name="set_priority"> + <return type="void"> + </return> <argument index="0" name="priority" type="float"> </argument> <description> - Set the order in which the area is processed. Greater values mean the area gets processed first. This is useful for areas which have an space override different from AREA_SPACE_OVERRIDE_DISABLED or AREA_SPACE_OVERRIDE_COMBINE, as they replace values, and are thus order-dependent. + Set the order in which the area is processed. Greater values mean the area gets processed first. This is useful for areas which have a space override different from AREA_SPACE_OVERRIDE_DISABLED or AREA_SPACE_OVERRIDE_COMBINE, as they replace values, and are thus order-dependent. Areas with the same priority value get evaluated in an unpredictable order, and should be differentiated if evaluation order is to be important. </description> </method> <method name="set_space_override_mode"> - <argument index="0" name="enable" type="int"> + <return type="void"> + </return> + <argument index="0" name="enable" type="int" enum="Area2D.SpaceOverride"> </argument> <description> Set the space override mode. This mode controls how an area affects gravity and damp. @@ -4507,33 +5395,50 @@ </method> </methods> <members> - <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief=""> + <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief="rate of spin loss"> + The rate at which objects stop spinning in this area. Represents the amount of speed lost per second. If 1.0, physics bodies in the area stop rotating immediately. If 0.0, they never slow down. Does not incorporate external forces. The physics-update's rate affects 'angular_damp'. </member> - <member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus" brief=""> + <member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus" brief="name of audio bus"> + The name of the Area2D's audio bus. </member> - <member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" brief=""> + <member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" brief="Whether to override audio bus"> + If [code]true[/code], overrides the default audio bus with the Area2D's. Defaults to [code]false[/code]. </member> - <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> + <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="others-collide-with-this layers"> + The physics layer this Area2D is in. + Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask]. + A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. </member> - <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief=""> + <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief="this-collides-with-others layers"> + The physics layers this Area2D scans to determine collision detections. </member> - <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" brief=""> + <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" brief="internal gravity intensity"> + The gravity intensity within the Area2D (ranges -1024 to 1024). This is useful to alter the force of gravity without altering its direction. + This value multiplies the gravity vector, whether it is the given vector ([method set_gravity_vector]), or a calculated one (when using a center of gravity). </member> - <member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale" brief=""> + <member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale" brief="gravity drop rate"> + The falloff factor for point gravity. The greater this value is, the faster the strength of gravity decreases with the square of distance. </member> - <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" brief=""> + <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" brief="is gravity a point?"> + If [code]true[/code], calculates gravity from a particular point during a space override (see [method set_space_override_mode]). If a point, [Vector2] position is set with [method set_gravity_vector]. Defaults to [code]false[/code]. </member> - <member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector" brief=""> + <member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector" brief="gravity non-normalized vector or center-point"> + The gravitational direction/strength as a vector (not normalized). If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center. </member> - <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" brief=""> + <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" brief="rate of movement loss"> + The rate at which objects stop spinning in this area. Represents the amount of speed lost per second. If 1.0, physics bodies in the area stop rotating immediately. If 0.0, they never slow down. Does not incorporate external forces. The physics-update's rate affects 'angular_damp'. </member> - <member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" brief=""> + <member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" brief="others cannot detect this?"> + If [code]true[/code], other monitoring areas can detect this Area2D (is it undetectable at the moment?). Defaults to [code]true[/code]. </member> - <member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring" brief=""> + <member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring" brief="this cannot detect others?"> + If [code]true[/code], this detects bodies/areas entering/exiting it (can it detect others at the moment?). Defaults to [code]true[/code]. </member> - <member name="priority" type="int" setter="set_priority" getter="get_priority" brief=""> + <member name="priority" type="float" setter="set_priority" getter="get_priority" brief="(high) process before others (low)"> + The processing order for this priority. Ranges from 0 to 128. Defaults to 0. Higher priorities are processed first. </member> - <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" brief=""> + <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" brief="how to override gravity/damping" enum="Area2D.SpaceOverride"> + How to override gravity and damping calculations within this Area2D, if at all. Consult the SPACE_OVERRIDE_* constants for available options. </member> </members> <signals> @@ -4619,6 +5524,11 @@ </signal> </signals> <constants> + <constant name="SPACE_OVERRIDE_DISABLED" value="0" enum="Area2D.SpaceOverride">This area does not affect gravity/damp. These are areas that exist only to detect collisions and objects entering or exiting them.</constant> + <constant name="SPACE_OVERRIDE_COMBINE" value="1" enum="Area2D.SpaceOverride">This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects.</constant> + <constant name="SPACE_OVERRIDE_COMBINE_REPLACE" value="2" enum="Area2D.SpaceOverride">This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one.</constant> + <constant name="SPACE_OVERRIDE_REPLACE" value="3" enum="Area2D.SpaceOverride">This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.</constant> + <constant name="SPACE_OVERRIDE_REPLACE_COMBINE" value="4" enum="Area2D.SpaceOverride">This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.</constant> </constants> </class> <class name="Array" category="Built-In Types"> @@ -4860,7 +5770,7 @@ <argument index="1" name="func" type="String"> </argument> <description> - Sort the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return true if the first argument is less than the second, and return false otherwise. + Sort the array using a custom method. The arguments are an object that holds the method and the name of such method. The custom method receives two arguments (a pair of elements from the array) and must return true if the first argument is less than the second, and return false otherwise. Note: you cannot randomize the return value as the heapsort algorithm expects a deterministic result. Doing so will result in unexpected behavior. </description> </method> </methods> @@ -4874,17 +5784,21 @@ </description> <methods> <method name="add_blend_shape"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="add_surface_from_arrays"> - <argument index="0" name="primitive" type="int"> + <return type="void"> + </return> + <argument index="0" name="primitive" type="int" enum="Mesh.PrimitiveType"> </argument> <argument index="1" name="arrays" type="Array"> </argument> - <argument index="2" name="blend_shapes" type="Array" default="[]"> + <argument index="2" name="blend_shapes" type="Array" default="[ ]"> </argument> <argument index="3" name="compress_flags" type="int" default="97792"> </argument> @@ -4894,10 +5808,14 @@ </description> </method> <method name="center_geometry"> + <return type="void"> + </return> <description> </description> </method> <method name="clear_blend_shapes"> + <return type="void"> + </return> <description> </description> </method> @@ -4908,7 +5826,7 @@ </description> </method> <method name="get_blend_shape_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Mesh.BlendShapeMode"> </return> <description> </description> @@ -4935,16 +5853,22 @@ </description> </method> <method name="regen_normalmaps"> + <return type="void"> + </return> <description> </description> </method> <method name="set_blend_shape_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Mesh.BlendShapeMode"> </argument> <description> </description> </method> <method name="set_custom_aabb"> + <return type="void"> + </return> <argument index="0" name="aabb" type="Rect3"> </argument> <description> @@ -4995,7 +5919,7 @@ </description> </method> <method name="surface_get_primitive_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Mesh.PrimitiveType"> </return> <argument index="0" name="surf_idx" type="int"> </argument> @@ -5004,6 +5928,8 @@ </description> </method> <method name="surface_remove"> + <return type="void"> + </return> <argument index="0" name="surf_idx" type="int"> </argument> <description> @@ -5011,6 +5937,8 @@ </description> </method> <method name="surface_set_material"> + <return type="void"> + </return> <argument index="0" name="surf_idx" type="int"> </argument> <argument index="1" name="material" type="Material"> @@ -5019,6 +5947,8 @@ </description> </method> <method name="surface_set_name"> + <return type="void"> + </return> <argument index="0" name="surf_idx" type="int"> </argument> <argument index="1" name="name" type="String"> @@ -5029,10 +5959,10 @@ </method> </methods> <constants> - <constant name="NO_INDEX_ARRAY" value="-1"> + <constant name="NO_INDEX_ARRAY" value="-1" enum=""> Default value used for index_array_len when no indices are present. </constant> - <constant name="ARRAY_WEIGHTS_SIZE" value="4"> + <constant name="ARRAY_WEIGHTS_SIZE" value="4" enum=""> Amount of weights/bone indices per vertex (always 4). </constant> <constant name="ARRAY_VERTEX" value="0"> @@ -5062,6 +5992,8 @@ <constant name="ARRAY_INDEX" value="8"> Array of integers, used as indices referencing vertices. No index can be beyond the vertex array size. </constant> + <constant name="ARRAY_MAX" value="9"> + </constant> <constant name="ARRAY_FORMAT_VERTEX" value="1"> Array format will include vertices (mandatory). </constant> @@ -5116,18 +6048,24 @@ </description> </method> <method name="set_atlas"> + <return type="void"> + </return> <argument index="0" name="atlas" type="Texture"> </argument> <description> </description> </method> <method name="set_margin"> + <return type="void"> + </return> <argument index="0" name="margin" type="Rect2"> </argument> <description> </description> </method> <method name="set_region"> + <return type="void"> + </return> <argument index="0" name="region" type="Rect2"> </argument> <description> @@ -5142,12 +6080,6 @@ <member name="region" type="Rect2" setter="set_region" getter="get_region" brief=""> </member> </members> - <signals> - <signal name="atlas_changed"> - <description> - </description> - </signal> - </signals> <constants> </constants> </class> @@ -5184,6 +6116,8 @@ </description> </method> <method name="set_volume_db"> + <return type="void"> + </return> <argument index="0" name="volume" type="float"> </argument> <description> @@ -5290,18 +6224,24 @@ </description> </method> <method name="set_dry"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_voice_count"> + <return type="void"> + </return> <argument index="0" name="voices" type="int"> </argument> <description> </description> </method> <method name="set_voice_cutoff_hz"> + <return type="void"> + </return> <argument index="0" name="voice_idx" type="int"> </argument> <argument index="1" name="cutoff_hz" type="float"> @@ -5310,6 +6250,8 @@ </description> </method> <method name="set_voice_delay_ms"> + <return type="void"> + </return> <argument index="0" name="voice_idx" type="int"> </argument> <argument index="1" name="delay_ms" type="float"> @@ -5318,6 +6260,8 @@ </description> </method> <method name="set_voice_depth_ms"> + <return type="void"> + </return> <argument index="0" name="voice_idx" type="int"> </argument> <argument index="1" name="depth_ms" type="float"> @@ -5326,6 +6270,8 @@ </description> </method> <method name="set_voice_level_db"> + <return type="void"> + </return> <argument index="0" name="voice_idx" type="int"> </argument> <argument index="1" name="level_db" type="float"> @@ -5334,6 +6280,8 @@ </description> </method> <method name="set_voice_pan"> + <return type="void"> + </return> <argument index="0" name="voice_idx" type="int"> </argument> <argument index="1" name="pan" type="float"> @@ -5342,6 +6290,8 @@ </description> </method> <method name="set_voice_rate_hz"> + <return type="void"> + </return> <argument index="0" name="voice_idx" type="int"> </argument> <argument index="1" name="rate_hz" type="float"> @@ -5350,6 +6300,8 @@ </description> </method> <method name="set_wet"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> @@ -5464,42 +6416,56 @@ </description> </method> <method name="set_attack_us"> + <return type="void"> + </return> <argument index="0" name="attack_us" type="float"> </argument> <description> </description> </method> <method name="set_gain"> + <return type="void"> + </return> <argument index="0" name="gain" type="float"> </argument> <description> </description> </method> <method name="set_mix"> + <return type="void"> + </return> <argument index="0" name="mix" type="float"> </argument> <description> </description> </method> <method name="set_ratio"> + <return type="void"> + </return> <argument index="0" name="ratio" type="float"> </argument> <description> </description> </method> <method name="set_release_ms"> + <return type="void"> + </return> <argument index="0" name="release_ms" type="float"> </argument> <description> </description> </method> <method name="set_sidechain"> + <return type="void"> + </return> <argument index="0" name="sidechain" type="String"> </argument> <description> </description> </method> <method name="set_threshold"> + <return type="void"> + </return> <argument index="0" name="threshold" type="float"> </argument> <description> @@ -5517,7 +6483,7 @@ </member> <member name="release_ms" type="float" setter="set_release_ms" getter="get_release_ms" brief=""> </member> - <member name="sidechain" type="float" setter="set_sidechain" getter="get_sidechain" brief=""> + <member name="sidechain" type="String" setter="set_sidechain" getter="get_sidechain" brief=""> </member> <member name="threshold" type="float" setter="set_threshold" getter="get_threshold" brief=""> </member> @@ -5610,78 +6576,104 @@ </description> </method> <method name="set_dry"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_feedback_active"> + <return type="void"> + </return> <argument index="0" name="amount" type="bool"> </argument> <description> </description> </method> <method name="set_feedback_delay_ms"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_feedback_level_db"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_feedback_lowpass"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_tap1_active"> + <return type="void"> + </return> <argument index="0" name="amount" type="bool"> </argument> <description> </description> </method> <method name="set_tap1_delay_ms"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_tap1_level_db"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_tap1_pan"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_tap2_active"> + <return type="void"> + </return> <argument index="0" name="amount" type="bool"> </argument> <description> </description> </method> <method name="set_tap2_delay_ms"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_tap2_level_db"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_tap2_pan"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> @@ -5738,7 +6730,7 @@ </description> </method> <method name="get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="AudioEffectDistortion.Mode"> </return> <description> </description> @@ -5756,30 +6748,40 @@ </description> </method> <method name="set_drive"> + <return type="void"> + </return> <argument index="0" name="drive" type="float"> </argument> <description> </description> </method> <method name="set_keep_hf_hz"> + <return type="void"> + </return> <argument index="0" name="keep_hf_hz" type="float"> </argument> <description> </description> </method> <method name="set_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="AudioEffectDistortion.Mode"> </argument> <description> </description> </method> <method name="set_post_gain"> + <return type="void"> + </return> <argument index="0" name="post_gain" type="float"> </argument> <description> </description> </method> <method name="set_pre_gain"> + <return type="void"> + </return> <argument index="0" name="pre_gain" type="float"> </argument> <description> @@ -5791,7 +6793,7 @@ </member> <member name="keep_hf_hz" type="float" setter="set_keep_hf_hz" getter="get_keep_hf_hz" brief=""> </member> - <member name="mode" type="int" setter="set_mode" getter="get_mode" brief=""> + <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="" enum="AudioEffectDistortion.Mode"> </member> <member name="post_gain" type="float" setter="set_post_gain" getter="get_post_gain" brief=""> </member> @@ -5822,6 +6824,8 @@ </description> </method> <method name="set_band_gain_db"> + <return type="void"> + </return> <argument index="0" name="band_idx" type="int"> </argument> <argument index="1" name="volume_db" type="float"> @@ -5876,7 +6880,7 @@ </description> </method> <method name="get_db" qualifiers="const"> - <return type="int"> + <return type="int" enum="AudioEffectFilter.FilterDB"> </return> <description> </description> @@ -5894,24 +6898,32 @@ </description> </method> <method name="set_cutoff"> + <return type="void"> + </return> <argument index="0" name="freq" type="float"> </argument> <description> </description> </method> <method name="set_db"> - <argument index="0" name="amount" type="int"> + <return type="void"> + </return> + <argument index="0" name="amount" type="int" enum="AudioEffectFilter.FilterDB"> </argument> <description> </description> </method> <method name="set_gain"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_resonance"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> @@ -5921,7 +6933,7 @@ <members> <member name="cutoff_hz" type="float" setter="set_cutoff" getter="get_cutoff" brief=""> </member> - <member name="dB" type="int" setter="set_db" getter="get_db" brief=""> + <member name="dB" type="int" setter="set_db" getter="get_db" brief="" enum="AudioEffectFilter.FilterDB"> </member> <member name="gain" type="float" setter="set_gain" getter="get_gain" brief=""> </member> @@ -5982,24 +6994,32 @@ </description> </method> <method name="set_ceiling_db"> + <return type="void"> + </return> <argument index="0" name="ceiling" type="float"> </argument> <description> </description> </method> <method name="set_soft_clip_db"> + <return type="void"> + </return> <argument index="0" name="soft_clip" type="float"> </argument> <description> </description> </method> <method name="set_soft_clip_ratio"> + <return type="void"> + </return> <argument index="0" name="soft_clip" type="float"> </argument> <description> </description> </method> <method name="set_threshold_db"> + <return type="void"> + </return> <argument index="0" name="threshold" type="float"> </argument> <description> @@ -6062,6 +7082,8 @@ </description> </method> <method name="set_pan"> + <return type="void"> + </return> <argument index="0" name="cpanume" type="float"> </argument> <description> @@ -6112,30 +7134,40 @@ </description> </method> <method name="set_depth"> + <return type="void"> + </return> <argument index="0" name="depth" type="float"> </argument> <description> </description> </method> <method name="set_feedback"> + <return type="void"> + </return> <argument index="0" name="fbk" type="float"> </argument> <description> </description> </method> <method name="set_range_max_hz"> + <return type="void"> + </return> <argument index="0" name="hz" type="float"> </argument> <description> </description> </method> <method name="set_range_min_hz"> + <return type="void"> + </return> <argument index="0" name="hz" type="float"> </argument> <description> </description> </method> <method name="set_rate_hz"> + <return type="void"> + </return> <argument index="0" name="hz" type="float"> </argument> <description> @@ -6170,6 +7202,8 @@ </description> </method> <method name="set_pitch_scale"> + <return type="void"> + </return> <argument index="0" name="rate" type="float"> </argument> <description> @@ -6238,48 +7272,64 @@ </description> </method> <method name="set_damping"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_dry"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_hpf"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_predelay_feedback"> + <return type="void"> + </return> <argument index="0" name="feedback" type="float"> </argument> <description> </description> </method> <method name="set_predelay_msec"> + <return type="void"> + </return> <argument index="0" name="msec" type="float"> </argument> <description> </description> </method> <method name="set_room_size"> + <return type="void"> + </return> <argument index="0" name="size" type="float"> </argument> <description> </description> </method> <method name="set_spread"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_wet"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> @@ -6332,18 +7382,24 @@ </description> </method> <method name="set_pan_pullout"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_surround"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_time_pullout"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> @@ -6370,17 +7426,21 @@ </description> <methods> <method name="add_bus"> + <return type="void"> + </return> <argument index="0" name="at_pos" type="int" default="-1"> </argument> <description> </description> </method> <method name="add_bus_effect"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="effect" type="AudioEffect"> </argument> - <argument index="2" name="arg2" type="int" default="-1"> + <argument index="2" name="at_pos" type="int" default="-1"> </argument> <description> </description> @@ -6408,12 +7468,10 @@ </description> </method> <method name="get_bus_effect_count"> + <return type="int"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> - <argument index="1" name="arg1" type="Object"> - </argument> - <argument index="2" name="arg2" type="int"> - </argument> <description> </description> </method> @@ -6476,7 +7534,7 @@ </description> </method> <method name="get_speaker_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="AudioServer.SpeakerMode"> </return> <description> </description> @@ -6516,10 +7574,14 @@ </description> </method> <method name="lock"> + <return type="void"> + </return> <description> </description> </method> <method name="move_bus"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <argument index="1" name="to_index" type="int"> @@ -6528,12 +7590,16 @@ </description> </method> <method name="remove_bus"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <description> </description> </method> <method name="remove_bus_effect"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="effect_idx" type="int"> @@ -6542,6 +7608,8 @@ </description> </method> <method name="set_bus_bypass_effects"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="enable" type="bool"> @@ -6550,12 +7618,16 @@ </description> </method> <method name="set_bus_count"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> </description> </method> <method name="set_bus_effect_enabled"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="effect_idx" type="int"> @@ -6566,12 +7638,16 @@ </description> </method> <method name="set_bus_layout"> + <return type="void"> + </return> <argument index="0" name="bus_layout" type="AudioBusLayout"> </argument> <description> </description> </method> <method name="set_bus_mute"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="enable" type="bool"> @@ -6580,6 +7656,8 @@ </description> </method> <method name="set_bus_name"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="name" type="String"> @@ -6588,6 +7666,8 @@ </description> </method> <method name="set_bus_send"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="send" type="String"> @@ -6596,6 +7676,8 @@ </description> </method> <method name="set_bus_solo"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="enable" type="bool"> @@ -6604,6 +7686,8 @@ </description> </method> <method name="set_bus_volume_db"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="volume_db" type="float"> @@ -6612,6 +7696,8 @@ </description> </method> <method name="swap_bus_effects"> + <return type="void"> + </return> <argument index="0" name="bus_idx" type="int"> </argument> <argument index="1" name="effect_idx" type="int"> @@ -6622,6 +7708,8 @@ </description> </method> <method name="unlock"> + <return type="void"> + </return> <description> </description> </method> @@ -6661,6 +7749,12 @@ <description> </description> </method> + <method name="get_loop_offset" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="has_loop" qualifiers="const"> <return type="bool"> </return> @@ -6668,23 +7762,37 @@ </description> </method> <method name="set_data"> + <return type="void"> + </return> <argument index="0" name="data" type="PoolByteArray"> </argument> <description> </description> </method> <method name="set_loop"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> + <method name="set_loop_offset"> + <return type="void"> + </return> + <argument index="0" name="seconds" type="float"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="data" type="PoolByteArray" setter="set_data" getter="get_data" brief=""> </member> <member name="loop" type="bool" setter="set_loop" getter="has_loop" brief=""> </member> + <member name="loop_offset" type="float" setter="set_loop_offset" getter="get_loop_offset" brief=""> + </member> </members> <constants> </constants> @@ -6712,7 +7820,7 @@ </description> </method> <method name="get_mix_target" qualifiers="const"> - <return type="int"> + <return type="int" enum="AudioStreamPlayer.MixTarget"> </return> <description> </description> @@ -6724,7 +7832,7 @@ </description> </method> <method name="get_stream" qualifiers="const"> - <return type="Object"> + <return type="AudioStream"> </return> <description> </description> @@ -6748,48 +7856,64 @@ </description> </method> <method name="play"> - <argument index="0" name="from_pos" type="float" default="0"> + <return type="void"> + </return> + <argument index="0" name="from_pos" type="float" default="0.0"> </argument> <description> </description> </method> <method name="seek"> + <return type="void"> + </return> <argument index="0" name="to_pos" type="float"> </argument> <description> </description> </method> <method name="set_autoplay"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_bus"> + <return type="void"> + </return> <argument index="0" name="bus" type="String"> </argument> <description> </description> </method> <method name="set_mix_target"> - <argument index="0" name="mix_target" type="int"> + <return type="void"> + </return> + <argument index="0" name="mix_target" type="int" enum="AudioStreamPlayer.MixTarget"> </argument> <description> </description> </method> <method name="set_stream"> + <return type="void"> + </return> <argument index="0" name="stream" type="AudioStream"> </argument> <description> </description> </method> <method name="set_volume_db"> + <return type="void"> + </return> <argument index="0" name="volume_db" type="float"> </argument> <description> </description> </method> <method name="stop"> + <return type="void"> + </return> <description> </description> </method> @@ -6799,7 +7923,7 @@ </member> <member name="bus" type="String" setter="set_bus" getter="get_bus" brief=""> </member> - <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" brief=""> + <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" brief="" enum="AudioStreamPlayer.MixTarget"> </member> <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief=""> </member> @@ -6808,6 +7932,12 @@ <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief=""> </member> </members> + <signals> + <signal name="finished"> + <description> + </description> + </signal> + </signals> <constants> </constants> </class> @@ -6848,7 +7978,7 @@ </description> </method> <method name="get_stream" qualifiers="const"> - <return type="Object"> + <return type="AudioStream"> </return> <description> </description> @@ -6872,60 +8002,80 @@ </description> </method> <method name="play"> - <argument index="0" name="from_pos" type="float" default="0"> + <return type="void"> + </return> + <argument index="0" name="from_pos" type="float" default="0.0"> </argument> <description> </description> </method> <method name="seek"> + <return type="void"> + </return> <argument index="0" name="to_pos" type="float"> </argument> <description> </description> </method> <method name="set_area_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> </description> </method> <method name="set_attenuation"> + <return type="void"> + </return> <argument index="0" name="curve" type="float"> </argument> <description> </description> </method> <method name="set_autoplay"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_bus"> + <return type="void"> + </return> <argument index="0" name="bus" type="String"> </argument> <description> </description> </method> <method name="set_max_distance"> + <return type="void"> + </return> <argument index="0" name="pixels" type="float"> </argument> <description> </description> </method> <method name="set_stream"> + <return type="void"> + </return> <argument index="0" name="stream" type="AudioStream"> </argument> <description> </description> </method> <method name="set_volume_db"> + <return type="void"> + </return> <argument index="0" name="volume_db" type="float"> </argument> <description> </description> </method> <method name="stop"> + <return type="void"> + </return> <description> </description> </method> @@ -6948,6 +8098,12 @@ <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief=""> </member> </members> + <signals> + <signal name="finished"> + <description> + </description> + </signal> + </signals> <constants> </constants> </class> @@ -6976,7 +8132,7 @@ </description> </method> <method name="get_attenuation_model" qualifiers="const"> - <return type="int"> + <return type="int" enum="AudioStreamPlayer3D.AttenuationModel"> </return> <description> </description> @@ -6988,7 +8144,7 @@ </description> </method> <method name="get_doppler_tracking" qualifiers="const"> - <return type="int"> + <return type="int" enum="AudioStreamPlayer3D.DopplerTracking"> </return> <description> </description> @@ -7018,7 +8174,7 @@ </description> </method> <method name="get_out_of_range_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="AudioStreamPlayer3D.OutOfRangeMode"> </return> <description> </description> @@ -7030,7 +8186,7 @@ </description> </method> <method name="get_stream" qualifiers="const"> - <return type="Object"> + <return type="AudioStream"> </return> <description> </description> @@ -7066,114 +8222,152 @@ </description> </method> <method name="play"> - <argument index="0" name="from_pos" type="float" default="0"> + <return type="void"> + </return> + <argument index="0" name="from_pos" type="float" default="0.0"> </argument> <description> </description> </method> <method name="seek"> + <return type="void"> + </return> <argument index="0" name="to_pos" type="float"> </argument> <description> </description> </method> <method name="set_area_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> </description> </method> <method name="set_attenuation_filter_cutoff_hz"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> </description> </method> <method name="set_attenuation_filter_db"> + <return type="void"> + </return> <argument index="0" name="db" type="float"> </argument> <description> </description> </method> <method name="set_attenuation_model"> - <argument index="0" name="model" type="int"> + <return type="void"> + </return> + <argument index="0" name="model" type="int" enum="AudioStreamPlayer3D.AttenuationModel"> </argument> <description> </description> </method> <method name="set_autoplay"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_bus"> + <return type="void"> + </return> <argument index="0" name="bus" type="String"> </argument> <description> </description> </method> <method name="set_doppler_tracking"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="AudioStreamPlayer3D.DopplerTracking"> </argument> <description> </description> </method> <method name="set_emission_angle"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> </description> </method> <method name="set_emission_angle_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_emission_angle_filter_attenuation_db"> + <return type="void"> + </return> <argument index="0" name="db" type="float"> </argument> <description> </description> </method> <method name="set_max_db"> + <return type="void"> + </return> <argument index="0" name="max_db" type="float"> </argument> <description> </description> </method> <method name="set_max_distance"> + <return type="void"> + </return> <argument index="0" name="metres" type="float"> </argument> <description> </description> </method> <method name="set_out_of_range_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="AudioStreamPlayer3D.OutOfRangeMode"> </argument> <description> </description> </method> <method name="set_stream"> + <return type="void"> + </return> <argument index="0" name="stream" type="AudioStream"> </argument> <description> </description> </method> <method name="set_unit_db"> + <return type="void"> + </return> <argument index="0" name="unit_db" type="float"> </argument> <description> </description> </method> <method name="set_unit_size"> + <return type="void"> + </return> <argument index="0" name="unit_size" type="float"> </argument> <description> </description> </method> <method name="stop"> + <return type="void"> + </return> <description> </description> </method> @@ -7185,13 +8379,13 @@ </member> <member name="attenuation_filter_db" type="float" setter="set_attenuation_filter_db" getter="get_attenuation_filter_db" brief=""> </member> - <member name="attenuation_model" type="int" setter="set_attenuation_model" getter="get_attenuation_model" brief=""> + <member name="attenuation_model" type="int" setter="set_attenuation_model" getter="get_attenuation_model" brief="" enum="AudioStreamPlayer3D.AttenuationModel"> </member> <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" brief=""> </member> <member name="bus" type="String" setter="set_bus" getter="get_bus" brief=""> </member> - <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" brief=""> + <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" brief="" enum="AudioStreamPlayer3D.DopplerTracking"> </member> <member name="emission_angle_degrees" type="float" setter="set_emission_angle" getter="get_emission_angle" brief=""> </member> @@ -7203,7 +8397,7 @@ </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" brief=""> </member> - <member name="out_of_range_mode" type="int" setter="set_out_of_range_mode" getter="get_out_of_range_mode" brief=""> + <member name="out_of_range_mode" type="int" setter="set_out_of_range_mode" getter="get_out_of_range_mode" brief="" enum="AudioStreamPlayer3D.OutOfRangeMode"> </member> <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief=""> </member> @@ -7214,6 +8408,12 @@ <member name="unit_size" type="float" setter="set_unit_size" getter="get_unit_size" brief=""> </member> </members> + <signals> + <signal name="finished"> + <description> + </description> + </signal> + </signals> <constants> <constant name="ATTENUATION_INVERSE_DISTANCE" value="0"> </constant> @@ -7240,7 +8440,7 @@ </description> <methods> <method name="get_audio_stream" qualifiers="const"> - <return type="Object"> + <return type="AudioStream"> </return> <description> </description> @@ -7252,12 +8452,16 @@ </description> </method> <method name="set_audio_stream"> - <argument index="0" name="stream" type="Object"> + <return type="void"> + </return> + <argument index="0" name="stream" type="AudioStream"> </argument> <description> </description> </method> <method name="set_random_pitch"> + <return type="void"> + </return> <argument index="0" name="scale" type="float"> </argument> <description> @@ -7286,7 +8490,7 @@ </description> </method> <method name="get_format" qualifiers="const"> - <return type="int"> + <return type="int" enum="AudioStreamSample.Format"> </return> <description> </description> @@ -7304,7 +8508,7 @@ </description> </method> <method name="get_loop_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="AudioStreamSample.LoopMode"> </return> <description> </description> @@ -7322,42 +8526,56 @@ </description> </method> <method name="set_data"> + <return type="void"> + </return> <argument index="0" name="data" type="PoolByteArray"> </argument> <description> </description> </method> <method name="set_format"> - <argument index="0" name="format" type="int"> + <return type="void"> + </return> + <argument index="0" name="format" type="int" enum="AudioStreamSample.Format"> </argument> <description> </description> </method> <method name="set_loop_begin"> + <return type="void"> + </return> <argument index="0" name="loop_begin" type="int"> </argument> <description> </description> </method> <method name="set_loop_end"> + <return type="void"> + </return> <argument index="0" name="loop_end" type="int"> </argument> <description> </description> </method> <method name="set_loop_mode"> - <argument index="0" name="loop_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="loop_mode" type="int" enum="AudioStreamSample.LoopMode"> </argument> <description> </description> </method> <method name="set_mix_rate"> + <return type="void"> + </return> <argument index="0" name="mix_rate" type="int"> </argument> <description> </description> </method> <method name="set_stereo"> + <return type="void"> + </return> <argument index="0" name="stereo" type="bool"> </argument> <description> @@ -7367,13 +8585,13 @@ <members> <member name="data" type="PoolByteArray" setter="set_data" getter="get_data" brief=""> </member> - <member name="format" type="int" setter="set_format" getter="get_format" brief=""> + <member name="format" type="int" setter="set_format" getter="get_format" brief="" enum="AudioStreamSample.Format"> </member> <member name="loop_begin" type="int" setter="set_loop_begin" getter="get_loop_begin" brief=""> </member> <member name="loop_end" type="int" setter="set_loop_end" getter="get_loop_end" brief=""> </member> - <member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" brief=""> + <member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" brief="" enum="AudioStreamSample.LoopMode"> </member> <member name="mix_rate" type="int" setter="set_mix_rate" getter="get_mix_rate" brief=""> </member> @@ -7392,7 +8610,7 @@ </description> <methods> <method name="get_copy_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="BackBufferCopy.CopyMode"> </return> <description> Return the copy mode currently applied to the BackBufferCopy (refer to constants section). @@ -7406,13 +8624,17 @@ </description> </method> <method name="set_copy_mode"> - <argument index="0" name="copy_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="copy_mode" type="int" enum="BackBufferCopy.CopyMode"> </argument> <description> Set the copy mode of the BackBufferCopy (refer to constants section). </description> </method> <method name="set_rect"> + <return type="void"> + </return> <argument index="0" name="rect" type="Rect2"> </argument> <description> @@ -7421,7 +8643,7 @@ </method> </methods> <members> - <member name="copy_mode" type="int" setter="set_copy_mode" getter="get_copy_mode" brief=""> + <member name="copy_mode" type="int" setter="set_copy_mode" getter="get_copy_mode" brief="" enum="BackBufferCopy.CopyMode"> </member> <member name="rect" type="Rect2" setter="set_rect" getter="get_rect" brief=""> </member> @@ -7447,11 +8669,15 @@ </description> <methods> <method name="_pressed" qualifiers="virtual"> + <return type="void"> + </return> <description> Called when button is pressed. </description> </method> <method name="_toggled" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="pressed" type="bool"> </argument> <description> @@ -7459,34 +8685,34 @@ </description> </method> <method name="get_action_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="BaseButton.ActionMode"> </return> <description> Return the current mode of action (see [method set_action_mode]) (one of the ACTION_MODE_* constants). </description> </method> <method name="get_button_group" qualifiers="const"> - <return type="Object"> + <return type="ButtonGroup"> </return> <description> </description> </method> <method name="get_draw_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="BaseButton.DrawMode"> </return> <description> Return the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding _draw() or connecting to "draw" signal. The visual state of the button is defined by the DRAW_* enum. </description> </method> <method name="get_enabled_focus_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Control.FocusMode"> </return> <description> Returns focus access mode used when switching between enabled/disabled (see [method Control.set_focus_mode] and [method set_disabled]). </description> </method> <method name="get_shortcut" qualifiers="const"> - <return type="Object"> + <return type="ShortCut"> </return> <description> </description> @@ -7520,19 +8746,25 @@ </description> </method> <method name="set_action_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="BaseButton.ActionMode"> </argument> <description> Set the current mode of action, determining when the button is considered clicked (see the ACTION_MODE_* constants). </description> </method> <method name="set_button_group"> - <argument index="0" name="button_group" type="Object"> + <return type="void"> + </return> + <argument index="0" name="button_group" type="ButtonGroup"> </argument> <description> </description> </method> <method name="set_disabled"> + <return type="void"> + </return> <argument index="0" name="disabled" type="bool"> </argument> <description> @@ -7540,13 +8772,17 @@ </description> </method> <method name="set_enabled_focus_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Control.FocusMode"> </argument> <description> Sets the focus access mode to use when switching between enabled/disabled (see [method Control.set_focus_mode] and [method set_disabled]). </description> </method> <method name="set_pressed"> + <return type="void"> + </return> <argument index="0" name="pressed" type="bool"> </argument> <description> @@ -7554,12 +8790,16 @@ </description> </method> <method name="set_shortcut"> - <argument index="0" name="shortcut" type="Object"> + <return type="void"> + </return> + <argument index="0" name="shortcut" type="ShortCut"> </argument> <description> </description> </method> <method name="set_toggle_mode"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -7568,15 +8808,15 @@ </method> </methods> <members> - <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" brief=""> + <member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" brief="" enum="BaseButton.ActionMode"> </member> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> </member> - <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" brief=""> + <member name="enabled_focus_mode" type="int" setter="set_enabled_focus_mode" getter="get_enabled_focus_mode" brief="" enum="Control.FocusMode"> </member> <member name="group" type="ButtonGroup" setter="set_button_group" getter="get_button_group" brief=""> </member> - <member name="is_pressed" type="bool" setter="set_pressed" getter="is_pressed" brief=""> + <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief=""> </member> <member name="shortcut" type="ShortCut" setter="set_shortcut" getter="get_shortcut" brief=""> </member> @@ -7807,20 +9047,28 @@ </class> <class name="BitMap" inherits="Resource" category="Core"> <brief_description> + Boolean matrix. </brief_description> <description> + A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates. </description> <methods> <method name="create"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> + Creates a bitmap with the specified size, filled with false. </description> </method> <method name="create_from_image_alpha"> - <argument index="0" name="image" type="Object"> + <return type="void"> + </return> + <argument index="0" name="image" type="Image"> </argument> <description> + Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to false if the alpha value of the image at that position is 0, and true in other case. </description> </method> <method name="get_bit" qualifiers="const"> @@ -7829,34 +9077,43 @@ <argument index="0" name="pos" type="Vector2"> </argument> <description> + Returns bitmap's value at the specified position. </description> </method> <method name="get_size" qualifiers="const"> <return type="Vector2"> </return> <description> + Returns bitmap's dimensions. </description> </method> <method name="get_true_bit_count" qualifiers="const"> <return type="int"> </return> <description> + Returns the amount of bitmap elements that are set to true. </description> </method> <method name="set_bit"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <argument index="1" name="bit" type="bool"> </argument> <description> + Sets the bitmap's element at the specified position, to the specified value. </description> </method> <method name="set_bit_rect"> + <return type="void"> + </return> <argument index="0" name="p_rect" type="Rect2"> </argument> <argument index="1" name="bit" type="bool"> </argument> <description> + Sets a rectangular portion of the bitmap to the specified value. </description> </method> </methods> @@ -7874,13 +9131,15 @@ </description> <methods> <method name="add_char"> + <return type="void"> + </return> <argument index="0" name="character" type="int"> </argument> <argument index="1" name="texture" type="int"> </argument> <argument index="2" name="rect" type="Rect2"> </argument> - <argument index="3" name="align" type="Vector2" default="Vector2(0, 0)"> + <argument index="3" name="align" type="Vector2" default="Vector2( 0, 0 )"> </argument> <argument index="4" name="advance" type="float" default="-1"> </argument> @@ -7889,6 +9148,8 @@ </description> </method> <method name="add_kerning_pair"> + <return type="void"> + </return> <argument index="0" name="char_a" type="int"> </argument> <argument index="1" name="char_b" type="int"> @@ -7900,6 +9161,8 @@ </description> </method> <method name="add_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> @@ -7907,12 +9170,14 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clear all the font data. </description> </method> <method name="create_from_fnt"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -7931,7 +9196,7 @@ </description> </method> <method name="get_fallback" qualifiers="const"> - <return type="Object"> + <return type="BitmapFont"> </return> <description> </description> @@ -7962,6 +9227,8 @@ </description> </method> <method name="set_ascent"> + <return type="void"> + </return> <argument index="0" name="px" type="float"> </argument> <description> @@ -7969,18 +9236,24 @@ </description> </method> <method name="set_distance_field_hint"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_fallback"> - <argument index="0" name="fallback" type="Object"> + <return type="void"> + </return> + <argument index="0" name="fallback" type="BitmapFont"> </argument> <description> </description> </method> <method name="set_height"> + <return type="void"> + </return> <argument index="0" name="px" type="float"> </argument> <description> @@ -8019,12 +9292,16 @@ <return type="String"> </return> <description> + Returns the name of the bone node attached to. </description> </method> <method name="set_bone_name"> + <return type="void"> + </return> <argument index="0" name="bone_name" type="String"> </argument> <description> + Changes the name of the bone node </description> </method> </methods> @@ -8040,6 +9317,8 @@ </description> <methods> <method name="add_spacer"> + <return type="void"> + </return> <argument index="0" name="begin" type="bool"> </argument> <description> @@ -8048,14 +9327,16 @@ </description> </method> <method name="get_alignment" qualifiers="const"> - <return type="int"> + <return type="int" enum="BoxContainer.AlignMode"> </return> <description> Return the alignment of children in the container. </description> </method> <method name="set_alignment"> - <argument index="0" name="alignment" type="int"> + <return type="void"> + </return> + <argument index="0" name="alignment" type="int" enum="BoxContainer.AlignMode"> </argument> <description> Set the alignment of children in the container(Must be one of ALIGN_BEGIN, ALIGN_CENTER or ALIGN_END). @@ -8063,7 +9344,7 @@ </method> </methods> <members> - <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" brief=""> + <member name="alignment" type="int" setter="set_alignment" getter="get_alignment" brief="" enum="BoxContainer.AlignMode"> </member> </members> <constants> @@ -8094,6 +9375,8 @@ </description> </method> <method name="set_extents"> + <return type="void"> + </return> <argument index="0" name="extents" type="Vector3"> </argument> <description> @@ -8120,83 +9403,88 @@ <return type="Texture"> </return> <description> - Return the button icon. </description> </method> <method name="get_clip_text" qualifiers="const"> <return type="bool"> </return> <description> - Return the state of the [i]clip_text[/i] property (see [method set_clip_text]) </description> </method> <method name="get_text" qualifiers="const"> <return type="String"> </return> <description> - Return the button text. </description> </method> <method name="get_text_align" qualifiers="const"> - <return type="int"> + <return type="int" enum="Button.TextAlign"> </return> <description> - Return the text alignment policy. </description> </method> <method name="is_flat" qualifiers="const"> <return type="bool"> </return> <description> - Return the state of the [i]flat[/i] property (see [method set_flat]). </description> </method> <method name="set_button_icon"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> - Set the icon that will be displayed next to the text inside the button area. </description> </method> <method name="set_clip_text"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> - Set the [i]clip_text[/i] property of a Button. When this property is enabled, text that is too large to fit the button is clipped, when disabled (default) the Button will always be wide enough to hold the text. </description> </method> <method name="set_flat"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> - Set the [i]flat[/i] property of a Button. Flat buttons don't display decoration unless hovered or pressed. </description> </method> <method name="set_text"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> - Set the button text, which will be displayed inside the button area. </description> </method> <method name="set_text_align"> - <argument index="0" name="align" type="int"> + <return type="void"> + </return> + <argument index="0" name="align" type="int" enum="Button.TextAlign"> </argument> <description> - Set the text alignment policy, using one of the ALIGN_* constants. </description> </method> </methods> <members> - <member name="align" type="int" setter="set_text_align" getter="get_text_align" brief=""> + <member name="align" type="int" setter="set_text_align" getter="get_text_align" brief="" enum="Button.TextAlign"> + Text alignment policy for the button's text, use one of the ALIGN_* constants. </member> <member name="clip_text" type="bool" setter="set_clip_text" getter="get_clip_text" brief=""> + When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. This property is disabled by default. </member> - <member name="flat" type="bool" setter="set_flat" getter="is_flat" brief=""> + <member name="flat" type="bool" setter="set_flat" getter="is_flat" brief="button decoration mode"> + Flat buttons don't display decoration. </member> <member name="icon" type="Texture" setter="set_button_icon" getter="get_button_icon" brief=""> + Button's icon, if text is present the icon will be placed before the text. </member> <member name="text" type="String" setter="set_text" getter="get_text" brief=""> + The button's text that will be displayed inside the button's area. </member> </members> <constants> @@ -8204,7 +9492,7 @@ Align the text to the left. </constant> <constant name="ALIGN_CENTER" value="1"> - Center the text. + Align the text to the center. </constant> <constant name="ALIGN_RIGHT" value="2"> Align the text to the right. @@ -8267,6 +9555,8 @@ </description> <methods> <method name="clear_current"> + <return type="void"> + </return> <description> </description> </method> @@ -8284,7 +9574,7 @@ </description> </method> <method name="get_doppler_tracking" qualifiers="const"> - <return type="int"> + <return type="int" enum="Camera.DopplerTracking"> </return> <description> </description> @@ -8308,13 +9598,13 @@ </description> </method> <method name="get_keep_aspect_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Camera.KeepAspect"> </return> <description> </description> </method> <method name="get_projection" qualifiers="const"> - <return type="int"> + <return type="int" enum="Camera.Projection"> </return> <description> </description> @@ -8359,6 +9649,8 @@ </description> </method> <method name="make_current"> + <return type="void"> + </return> <description> Make this camera the current Camera for the [Viewport] (see class description). If the Camera Node is outside the scene tree, it will attempt to become current once it's added. </description> @@ -8398,36 +9690,48 @@ </description> </method> <method name="set_cull_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> </description> </method> <method name="set_doppler_tracking"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Camera.DopplerTracking"> </argument> <description> </description> </method> <method name="set_environment"> + <return type="void"> + </return> <argument index="0" name="env" type="Environment"> </argument> <description> </description> </method> <method name="set_h_offset"> + <return type="void"> + </return> <argument index="0" name="ofs" type="float"> </argument> <description> </description> </method> <method name="set_keep_aspect_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Camera.KeepAspect"> </argument> <description> </description> </method> <method name="set_orthogonal"> + <return type="void"> + </return> <argument index="0" name="size" type="float"> </argument> <argument index="1" name="z_near" type="float"> @@ -8439,6 +9743,8 @@ </description> </method> <method name="set_perspective"> + <return type="void"> + </return> <argument index="0" name="fov" type="float"> </argument> <argument index="1" name="z_near" type="float"> @@ -8450,6 +9756,8 @@ </description> </method> <method name="set_v_offset"> + <return type="void"> + </return> <argument index="0" name="ofs" type="float"> </argument> <description> @@ -8494,21 +9802,27 @@ </description> <methods> <method name="align"> + <return type="void"> + </return> <description> Align the camera to the tracked node </description> </method> <method name="clear_current"> + <return type="void"> + </return> <description> </description> </method> <method name="force_update_scroll"> + <return type="void"> + </return> <description> Force the camera to update scroll immediately. </description> </method> <method name="get_anchor_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Camera2D.AnchorMode"> </return> <description> </description> @@ -8527,7 +9841,7 @@ </description> </method> <method name="get_custom_viewport" qualifiers="const"> - <return type="Viewport"> + <return type="Node"> </return> <description> </description> @@ -8535,7 +9849,7 @@ <method name="get_drag_margin" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> Return the margins needed to drag the camera (see [method set_drag_margin]). @@ -8556,7 +9870,7 @@ <method name="get_limit" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> Return the scrolling limit in pixels. @@ -8637,30 +9951,40 @@ </description> </method> <method name="make_current"> + <return type="void"> + </return> <description> Make this the current 2D camera for the scene (viewport and layer), in case there's many cameras in the scene. </description> </method> <method name="reset_smoothing"> + <return type="void"> + </return> <description> Set the camera's position immediately to its current smoothing destination. This has no effect if smoothing is disabled. </description> </method> <method name="set_anchor_mode"> - <argument index="0" name="anchor_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="anchor_mode" type="int" enum="Camera2D.AnchorMode"> </argument> <description> </description> </method> <method name="set_custom_viewport"> - <argument index="0" name="viewport" type="Viewport"> + <return type="void"> + </return> + <argument index="0" name="viewport" type="Node"> </argument> <description> </description> </method> <method name="set_drag_margin"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <argument index="1" name="drag_margin" type="float"> </argument> @@ -8669,31 +9993,41 @@ </description> </method> <method name="set_enable_follow_smoothing"> + <return type="void"> + </return> <argument index="0" name="follow_smoothing" type="bool"> </argument> <description> </description> </method> <method name="set_follow_smoothing"> + <return type="void"> + </return> <argument index="0" name="follow_smoothing" type="float"> </argument> <description> </description> </method> <method name="set_h_drag_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_h_offset"> + <return type="void"> + </return> <argument index="0" name="ofs" type="float"> </argument> <description> </description> </method> <method name="set_limit"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <argument index="1" name="limit" type="int"> </argument> @@ -8702,12 +10036,16 @@ </description> </method> <method name="set_limit_drawing_enabled"> + <return type="void"> + </return> <argument index="0" name="limit_drawing_enabled" type="bool"> </argument> <description> </description> </method> <method name="set_limit_smoothing_enabled"> + <return type="void"> + </return> <argument index="0" name="limit_smoothing_enabled" type="bool"> </argument> <description> @@ -8716,12 +10054,16 @@ </description> </method> <method name="set_margin_drawing_enabled"> + <return type="void"> + </return> <argument index="0" name="margin_drawing_enabled" type="bool"> </argument> <description> </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> @@ -8729,30 +10071,40 @@ </description> </method> <method name="set_rotating"> + <return type="void"> + </return> <argument index="0" name="rotating" type="bool"> </argument> <description> </description> </method> <method name="set_screen_drawing_enabled"> + <return type="void"> + </return> <argument index="0" name="screen_drawing_enabled" type="bool"> </argument> <description> </description> </method> <method name="set_v_drag_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_v_offset"> + <return type="void"> + </return> <argument index="0" name="ofs" type="float"> </argument> <description> </description> </method> <method name="set_zoom"> + <return type="void"> + </return> <argument index="0" name="zoom" type="Vector2"> </argument> <description> @@ -8760,7 +10112,7 @@ </method> </methods> <members> - <member name="anchor_mode" type="int" setter="set_anchor_mode" getter="get_anchor_mode" brief=""> + <member name="anchor_mode" type="int" setter="set_anchor_mode" getter="get_anchor_mode" brief="" enum="Camera2D.AnchorMode"> </member> <member name="current" type="bool" setter="_set_current" getter="is_current" brief=""> </member> @@ -8823,6 +10175,8 @@ </description> <methods> <method name="_draw" qualifiers="virtual"> + <return type="void"> + </return> <description> Called (if exists) to draw the canvas item. </description> @@ -8838,13 +10192,15 @@ </argument> <argument index="3" name="next" type="String"> </argument> - <argument index="4" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <description> Draw a string character using a custom font. Returns the advance, depending on the char width and kerning with an optional next char. </description> </method> <method name="draw_circle"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <argument index="1" name="radius" type="float"> @@ -8856,28 +10212,34 @@ </description> </method> <method name="draw_colored_polygon"> + <return type="void"> + </return> <argument index="0" name="points" type="PoolVector2Array"> </argument> <argument index="1" name="color" type="Color"> </argument> - <argument index="2" name="uvs" type="PoolVector2Array" default="PoolVector2Array([])"> + <argument index="2" name="uvs" type="PoolVector2Array" default="PoolVector2Array( )"> </argument> - <argument index="3" name="texture" type="Texture" default="NULL"> + <argument index="3" name="texture" type="Texture" default="null"> </argument> - <argument index="4" name="normal_map" type="Texture" default="NULL"> + <argument index="4" name="normal_map" type="Texture" default="null"> + </argument> + <argument index="5" name="antialiased" type="bool" default="false"> </argument> <description> Draw a colored polygon of any amount of points, convex or concave. </description> </method> <method name="draw_line"> + <return type="void"> + </return> <argument index="0" name="from" type="Vector2"> </argument> <argument index="1" name="to" type="Vector2"> </argument> <argument index="2" name="color" type="Color"> </argument> - <argument index="3" name="width" type="float" default="1"> + <argument index="3" name="width" type="float" default="1.0"> </argument> <argument index="4" name="antialiased" type="bool" default="false"> </argument> @@ -8886,26 +10248,32 @@ </description> </method> <method name="draw_polygon"> + <return type="void"> + </return> <argument index="0" name="points" type="PoolVector2Array"> </argument> <argument index="1" name="colors" type="PoolColorArray"> </argument> - <argument index="2" name="uvs" type="PoolVector2Array" default="PoolVector2Array([])"> + <argument index="2" name="uvs" type="PoolVector2Array" default="PoolVector2Array( )"> </argument> - <argument index="3" name="texture" type="Texture" default="NULL"> + <argument index="3" name="texture" type="Texture" default="null"> </argument> - <argument index="4" name="normal_map" type="Texture" default="NULL"> + <argument index="4" name="normal_map" type="Texture" default="null"> + </argument> + <argument index="5" name="antialiased" type="bool" default="false"> </argument> <description> Draw a polygon of any amount of points, convex or concave. </description> </method> <method name="draw_polyline"> + <return type="void"> + </return> <argument index="0" name="points" type="PoolVector2Array"> </argument> <argument index="1" name="color" type="Color"> </argument> - <argument index="2" name="width" type="float" default="1"> + <argument index="2" name="width" type="float" default="1.0"> </argument> <argument index="3" name="antialiased" type="bool" default="false"> </argument> @@ -8913,11 +10281,13 @@ </description> </method> <method name="draw_polyline_colors"> + <return type="void"> + </return> <argument index="0" name="points" type="PoolVector2Array"> </argument> <argument index="1" name="colors" type="PoolColorArray"> </argument> - <argument index="2" name="width" type="float" default="1"> + <argument index="2" name="width" type="float" default="1.0"> </argument> <argument index="3" name="antialiased" type="bool" default="false"> </argument> @@ -8925,23 +10295,27 @@ </description> </method> <method name="draw_primitive"> + <return type="void"> + </return> <argument index="0" name="points" type="PoolVector2Array"> </argument> <argument index="1" name="colors" type="PoolColorArray"> </argument> <argument index="2" name="uvs" type="PoolVector2Array"> </argument> - <argument index="3" name="texture" type="Texture" default="NULL"> + <argument index="3" name="texture" type="Texture" default="null"> </argument> - <argument index="4" name="width" type="float" default="1"> + <argument index="4" name="width" type="float" default="1.0"> </argument> - <argument index="5" name="normal_map" type="Texture" default="NULL"> + <argument index="5" name="normal_map" type="Texture" default="null"> </argument> <description> Draw a custom primitive, 1 point for a point, 2 points for a line, 3 points for a triangle and 4 points for a quad. </description> </method> <method name="draw_rect"> + <return type="void"> + </return> <argument index="0" name="rect" type="Rect2"> </argument> <argument index="1" name="color" type="Color"> @@ -8953,6 +10327,8 @@ </description> </method> <method name="draw_set_transform"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <argument index="1" name="rot" type="float"> @@ -8964,19 +10340,23 @@ </description> </method> <method name="draw_set_transform_matrix"> + <return type="void"> + </return> <argument index="0" name="xform" type="Transform2D"> </argument> <description> </description> </method> <method name="draw_string"> + <return type="void"> + </return> <argument index="0" name="font" type="Font"> </argument> <argument index="1" name="pos" type="Vector2"> </argument> <argument index="2" name="text" type="String"> </argument> - <argument index="3" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <argument index="4" name="clip_w" type="int" default="-1"> </argument> @@ -8985,6 +10365,8 @@ </description> </method> <method name="draw_style_box"> + <return type="void"> + </return> <argument index="0" name="style_box" type="StyleBox"> </argument> <argument index="1" name="rect" type="Rect2"> @@ -8994,47 +10376,53 @@ </description> </method> <method name="draw_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <argument index="1" name="pos" type="Vector2"> </argument> - <argument index="2" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="2" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> - <argument index="3" name="normal_map" type="Texture" default="NULL"> + <argument index="3" name="normal_map" type="Texture" default="null"> </argument> <description> Draw a texture at a given position. </description> </method> <method name="draw_texture_rect"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <argument index="1" name="rect" type="Rect2"> </argument> <argument index="2" name="tile" type="bool"> </argument> - <argument index="3" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> - <argument index="5" name="normal_map" type="Texture" default="NULL"> + <argument index="5" name="normal_map" type="Texture" default="null"> </argument> <description> Draw a textured rectangle at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture. </description> </method> <method name="draw_texture_rect_region"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <argument index="1" name="rect" type="Rect2"> </argument> <argument index="2" name="src_rect" type="Rect2"> </argument> - <argument index="3" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> - <argument index="5" name="normal_map" type="Texture" default="NULL"> + <argument index="5" name="normal_map" type="Texture" default="null"> </argument> <argument index="6" name="clip_uv" type="bool" default="true"> </argument> @@ -9050,6 +10438,8 @@ </description> </method> <method name="edit_rotate"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> @@ -9057,12 +10447,16 @@ </description> </method> <method name="edit_set_rect"> + <return type="void"> + </return> <argument index="0" name="rect" type="Rect2"> </argument> <description> </description> </method> <method name="edit_set_state"> + <return type="void"> + </return> <argument index="0" name="state" type="Variant"> </argument> <description> @@ -9189,13 +10583,15 @@ </description> </method> <method name="get_world_2d" qualifiers="const"> - <return type="Object"> + <return type="World2D"> </return> <description> Get the [World2D] where this item is in. </description> </method> <method name="hide"> + <return type="void"> + </return> <description> Hide the CanvasItem currently visible. </description> @@ -9248,14 +10644,16 @@ </description> </method> <method name="make_input_local" qualifiers="const"> - <return type="Object"> + <return type="InputEvent"> </return> - <argument index="0" name="event" type="Object"> + <argument index="0" name="event" type="InputEvent"> </argument> <description> </description> </method> <method name="set_as_toplevel"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -9263,6 +10661,8 @@ </description> </method> <method name="set_draw_behind_parent"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -9270,6 +10670,8 @@ </description> </method> <method name="set_light_mask"> + <return type="void"> + </return> <argument index="0" name="light_mask" type="int"> </argument> <description> @@ -9277,6 +10679,8 @@ </description> </method> <method name="set_material"> + <return type="void"> + </return> <argument index="0" name="material" type="Material"> </argument> <description> @@ -9284,6 +10688,8 @@ </description> </method> <method name="set_modulate"> + <return type="void"> + </return> <argument index="0" name="modulate" type="Color"> </argument> <description> @@ -9291,18 +10697,24 @@ </description> </method> <method name="set_notify_local_transform"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_notify_transform"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_self_modulate"> + <return type="void"> + </return> <argument index="0" name="self_modulate" type="Color"> </argument> <description> @@ -9310,6 +10722,8 @@ </description> </method> <method name="set_use_parent_material"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -9317,7 +10731,9 @@ </description> </method> <method name="set_visible"> - <argument index="0" name="arg0" type="bool"> + <return type="void"> + </return> + <argument index="0" name="visible" type="bool"> </argument> <description> Set whether this item should be visible or not. @@ -9325,11 +10741,15 @@ </description> </method> <method name="show"> + <return type="void"> + </return> <description> Show the CanvasItem currently hidden. </description> </method> <method name="update"> + <return type="void"> + </return> <description> Queue the CanvasItem for update. [code]NOTIFICATION_DRAW[/code] will be called on idle time to request redraw. </description> @@ -9338,7 +10758,7 @@ <members> <member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask" brief=""> </member> - <member name="material" type="ShaderMaterial,CanvasItemMaterial" setter="set_material" getter="get_material" brief=""> + <member name="material" type="Material" setter="set_material" getter="get_material" brief=""> </member> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" brief=""> </member> @@ -9391,19 +10811,19 @@ <constant name="BLEND_MODE_PREMULT_ALPHA" value="4"> Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. </constant> - <constant name="NOTIFICATION_DRAW" value="30"> + <constant name="NOTIFICATION_DRAW" value="30" enum=""> CanvasItem is requested to draw. </constant> - <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="31"> + <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="31" enum=""> Canvas item visibility has changed. </constant> - <constant name="NOTIFICATION_ENTER_CANVAS" value="32"> + <constant name="NOTIFICATION_ENTER_CANVAS" value="32" enum=""> Canvas item has entered the canvas. </constant> - <constant name="NOTIFICATION_EXIT_CANVAS" value="33"> + <constant name="NOTIFICATION_EXIT_CANVAS" value="33" enum=""> Canvas item has exited the canvas. </constant> - <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="29"> + <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="29" enum=""> Canvas item transform has changed. Only received if requested. </constant> </constants> @@ -9415,34 +10835,38 @@ </description> <methods> <method name="get_blend_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="CanvasItemMaterial.BlendMode"> </return> <description> </description> </method> <method name="get_light_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="CanvasItemMaterial.LightMode"> </return> <description> </description> </method> <method name="set_blend_mode"> - <argument index="0" name="blend_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="blend_mode" type="int" enum="CanvasItemMaterial.BlendMode"> </argument> <description> </description> </method> <method name="set_light_mode"> - <argument index="0" name="light_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="light_mode" type="int" enum="CanvasItemMaterial.LightMode"> </argument> <description> </description> </method> </methods> <members> - <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" brief=""> + <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" brief="" enum="CanvasItemMaterial.BlendMode"> </member> - <member name="light_mode" type="int" setter="set_light_mode" getter="get_light_mode" brief=""> + <member name="light_mode" type="int" setter="set_light_mode" getter="get_light_mode" brief="" enum="CanvasItemMaterial.LightMode"> </member> </members> <constants> @@ -9473,7 +10897,7 @@ </description> <methods> <method name="get_custom_viewport" qualifiers="const"> - <return type="Viewport"> + <return type="Node"> </return> <description> </description> @@ -9528,12 +10952,16 @@ </description> </method> <method name="set_custom_viewport"> - <argument index="0" name="viewport" type="Viewport"> + <return type="void"> + </return> + <argument index="0" name="viewport" type="Node"> </argument> <description> </description> </method> <method name="set_layer"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> @@ -9541,6 +10969,8 @@ </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> @@ -9548,6 +10978,8 @@ </description> </method> <method name="set_rotation"> + <return type="void"> + </return> <argument index="0" name="radians" type="float"> </argument> <description> @@ -9555,6 +10987,8 @@ </description> </method> <method name="set_rotationd"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> @@ -9562,6 +10996,8 @@ </description> </method> <method name="set_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="Vector2"> </argument> <description> @@ -9569,6 +11005,8 @@ </description> </method> <method name="set_transform"> + <return type="void"> + </return> <argument index="0" name="transform" type="Transform2D"> </argument> <description> @@ -9605,6 +11043,8 @@ </description> </method> <method name="set_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> @@ -9621,8 +11061,10 @@ </class> <class name="CapsuleMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a capsule-shaped [PrimitiveMesh]. </brief_description> <description> + Class representing a capsule-shaped [PrimitiveMesh]. </description> <methods> <method name="get_mid_height" qualifiers="const"> @@ -9650,24 +11092,32 @@ </description> </method> <method name="set_mid_height"> + <return type="void"> + </return> <argument index="0" name="mid_height" type="float"> </argument> <description> </description> </method> <method name="set_radial_segments"> + <return type="void"> + </return> <argument index="0" name="segments" type="int"> </argument> <description> </description> </method> <method name="set_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> </description> </method> <method name="set_rings"> + <return type="void"> + </return> <argument index="0" name="rings" type="int"> </argument> <description> @@ -9676,12 +11126,16 @@ </methods> <members> <member name="mid_height" type="float" setter="set_mid_height" getter="get_mid_height" brief=""> + Height of the capsule mesh from the center point. Defaults to 1.0. </member> <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" brief=""> + Number of radial segments on the capsule mesh. Defaults to 64. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius" brief=""> + Radius of the capsule mesh. Defaults to 1.0. </member> <member name="rings" type="int" setter="set_rings" getter="get_rings" brief=""> + Number of rings along the height of the capsule. Defaults to 8. </member> </members> <constants> @@ -9710,6 +11164,8 @@ </description> </method> <method name="set_height"> + <return type="void"> + </return> <argument index="0" name="height" type="float"> </argument> <description> @@ -9717,6 +11173,8 @@ </description> </method> <method name="set_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> @@ -9756,6 +11214,8 @@ </description> </method> <method name="set_height"> + <return type="void"> + </return> <argument index="0" name="height" type="float"> </argument> <description> @@ -9763,6 +11223,8 @@ </description> </method> <method name="set_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> @@ -9795,6 +11257,8 @@ </description> </method> <method name="set_use_top_left"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -9913,6 +11377,8 @@ </description> </method> <method name="set_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> @@ -10060,7 +11526,7 @@ </description> </method> <method name="class_set_property" qualifiers="const"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="object" type="Object"> </argument> @@ -10130,6 +11596,8 @@ </description> <methods> <method name="_input_event" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="camera" type="Object"> </argument> <argument index="1" name="event" type="InputEvent"> @@ -10143,12 +11611,6 @@ <description> </description> </method> - <method name="get_capture_input_on_drag" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> <method name="create_shape_owner"> <return type="int"> </return> @@ -10158,6 +11620,12 @@ Creates new holder for the shapes. Argument is a [CollisionShape] node. It will return owner_id which usually you will want to save for later use. </description> </method> + <method name="get_capture_input_on_drag" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="get_rid" qualifiers="const"> <return type="RID"> </return> @@ -10171,14 +11639,80 @@ Shape owner is a node which is holding concrete shape resources. This method will return an array which is holding an integer numbers that are representing unique ID of each owner. You can use those ids when you are using others shape_owner methods. </description> </method> + <method name="is_ray_pickable" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_shape_owner_disabled" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="remove_shape_owner"> + <return type="void"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_capture_input_on_drag"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_ray_pickable"> + <return type="void"> + </return> + <argument index="0" name="ray_pickable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="shape_find_owner" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="shape_index" type="int"> + </argument> + <description> + </description> + </method> + <method name="shape_owner_add_shape"> + <return type="void"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <argument index="1" name="shape" type="Shape"> + </argument> + <description> + </description> + </method> <method name="shape_owner_clear_shapes"> + <return type="void"> + </return> <argument index="0" name="owner_id" type="int"> </argument> <description> Will remove all the shapes associated with given owner. </description> </method> - <method name="shape_owner_get_shape"> + <method name="shape_owner_get_owner" qualifiers="const"> + <return type="Object"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="shape_owner_get_shape" qualifiers="const"> <return type="Shape"> </return> <argument index="0" name="owner_id" type="int"> @@ -10189,7 +11723,7 @@ Will return a [Shape]. First argument owner_id is an integer that can be obtained from [method get_shape_owners]. Shape_id is a position of the shape inside owner; it's a value in range from 0 to [method shape_owner_get_shape_count]. </description> </method> - <method name="shape_owner_get_shape_count"> + <method name="shape_owner_get_shape_count" qualifiers="const"> <return type="int"> </return> <argument index="0" name="owner_id" type="int"> @@ -10198,7 +11732,17 @@ Returns number of shapes to which given owner is associated to. </description> </method> - <method name="shape_owner_get_transform"> + <method name="shape_owner_get_shape_index" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <argument index="1" name="shape_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="shape_owner_get_transform" qualifiers="const"> <return type="Transform"> </return> <argument index="0" name="owner_id" type="int"> @@ -10208,6 +11752,8 @@ </description> </method> <method name="shape_owner_remove_shape"> + <return type="void"> + </return> <argument index="0" name="owner_id" type="int"> </argument> <argument index="1" name="shape_id" type="int"> @@ -10216,20 +11762,22 @@ Removes related shape from the owner. </description> </method> - <method name="is_ray_pickable" qualifiers="const"> - <return type="bool"> + <method name="shape_owner_set_disabled"> + <return type="void"> </return> - <description> - </description> - </method> - <method name="set_capture_input_on_drag"> - <argument index="0" name="enable" type="bool"> + <argument index="0" name="owner_id" type="int"> + </argument> + <argument index="1" name="disabled" type="bool"> </argument> <description> </description> </method> - <method name="set_ray_pickable"> - <argument index="0" name="ray_pickable" type="bool"> + <method name="shape_owner_set_transform"> + <return type="void"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <argument index="1" name="transform" type="Transform"> </argument> <description> </description> @@ -10277,6 +11825,8 @@ </description> <methods> <method name="_input_event" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="viewport" type="Object"> </argument> <argument index="1" name="event" type="InputEvent"> @@ -10309,14 +11859,82 @@ Shape owner is a node which is holding concrete shape resources. This method will return an array which is holding an integer numbers that are representing unique ID of each owner. You can use those ids when you are using others shape_owner methods. </description> </method> + <method name="is_pickable" qualifiers="const"> + <return type="bool"> + </return> + <description> + Return whether this object is pickable. + </description> + </method> + <method name="is_shape_owner_disabled" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="is_shape_owner_one_way_collision_enabled" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="remove_shape_owner"> + <return type="void"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_pickable"> + <return type="void"> + </return> + <argument index="0" name="enabled" type="bool"> + </argument> + <description> + Set whether this object is pickable. A pickable object can detect the mouse pointer enter/leave it and, if the mouse is inside it, report input events. + </description> + </method> + <method name="shape_find_owner" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="shape_index" type="int"> + </argument> + <description> + </description> + </method> + <method name="shape_owner_add_shape"> + <return type="void"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <argument index="1" name="shape" type="Shape2D"> + </argument> + <description> + </description> + </method> <method name="shape_owner_clear_shapes"> + <return type="void"> + </return> <argument index="0" name="owner_id" type="int"> </argument> <description> Will remove all the shapes associated with given owner. </description> </method> - <method name="shape_owner_get_shape"> + <method name="shape_owner_get_owner" qualifiers="const"> + <return type="Object"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="shape_owner_get_shape" qualifiers="const"> <return type="Shape2D"> </return> <argument index="0" name="owner_id" type="int"> @@ -10327,7 +11945,7 @@ Will return a [Shape2D]. First argument owner_id is an integer that can be obtained from [method get_shape_owners]. Shape_id is a position of the shape inside owner; it's a value in range from 0 to [method shape_owner_get_shape_count]. </description> </method> - <method name="shape_owner_get_shape_count"> + <method name="shape_owner_get_shape_count" qualifiers="const"> <return type="int"> </return> <argument index="0" name="owner_id" type="int"> @@ -10336,7 +11954,17 @@ Returns number of shapes to which given owner is associated to. </description> </method> - <method name="shape_owner_get_transform"> + <method name="shape_owner_get_shape_index" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <argument index="1" name="shape_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="shape_owner_get_transform" qualifiers="const"> <return type="Transform2D"> </return> <argument index="0" name="owner_id" type="int"> @@ -10346,6 +11974,8 @@ </description> </method> <method name="shape_owner_remove_shape"> + <return type="void"> + </return> <argument index="0" name="owner_id" type="int"> </argument> <argument index="1" name="shape_id" type="int"> @@ -10354,18 +11984,34 @@ Removes related shape from the owner. </description> </method> - <method name="is_pickable" qualifiers="const"> - <return type="bool"> + <method name="shape_owner_set_disabled"> + <return type="void"> </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <argument index="1" name="disabled" type="bool"> + </argument> <description> - Return whether this object is pickable. </description> </method> - <method name="set_pickable"> - <argument index="0" name="enabled" type="bool"> + <method name="shape_owner_set_one_way_collision"> + <return type="void"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="shape_owner_set_transform"> + <return type="void"> + </return> + <argument index="0" name="owner_id" type="int"> + </argument> + <argument index="1" name="transform" type="Transform2D"> </argument> <description> - Set whether this object is pickable. A pickable object can detect the mouse pointer enter/leave it and, if the mouse is inside it, report input events. </description> </method> </methods> @@ -10423,18 +12069,24 @@ </description> </method> <method name="set_depth"> + <return type="void"> + </return> <argument index="0" name="depth" type="float"> </argument> <description> </description> </method> <method name="set_disabled"> + <return type="void"> + </return> <argument index="0" name="disabled" type="bool"> </argument> <description> </description> </method> <method name="set_polygon"> + <return type="void"> + </return> <argument index="0" name="polygon" type="PoolVector2Array"> </argument> <description> @@ -10461,7 +12113,7 @@ </description> <methods> <method name="get_build_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="CollisionPolygon2D.BuildMode"> </return> <description> Return whether the polygon is a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]). @@ -10487,25 +12139,33 @@ </description> </method> <method name="set_build_mode"> - <argument index="0" name="build_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="build_mode" type="int" enum="CollisionPolygon2D.BuildMode"> </argument> <description> Set whether the polygon is to be a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]). </description> </method> <method name="set_disabled"> + <return type="void"> + </return> <argument index="0" name="disabled" type="bool"> </argument> <description> </description> </method> <method name="set_one_way_collision"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_polygon"> + <return type="void"> + </return> <argument index="0" name="polygon" type="PoolVector2Array"> </argument> <description> @@ -10515,7 +12175,7 @@ </method> </methods> <members> - <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" brief=""> + <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" brief="" enum="CollisionPolygon2D.BuildMode"> </member> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> </member> @@ -10529,12 +12189,14 @@ </class> <class name="CollisionShape" inherits="Spatial" category="Core"> <brief_description> + Node that represents collision shape data in 3D space. </brief_description> <description> + Editor facility for creating and editing collision shapes in 3D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area] to give it a detection shape, or add it to a [PhysicsBody] to give create solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method get_shape] to get the actual shape. </description> <methods> <method name="get_shape" qualifiers="const"> - <return type="Object"> + <return type="Shape"> </return> <description> </description> @@ -10546,23 +12208,33 @@ </description> </method> <method name="make_convex_from_brothers"> + <return type="void"> + </return> <description> + Sets the collision shape's shape to the addition of all its convexed [MeshInstance] siblings geometry. </description> </method> <method name="resource_changed"> - <argument index="0" name="resource" type="Object"> + <return type="void"> + </return> + <argument index="0" name="resource" type="Resource"> </argument> <description> + If this method exists within a script it will be called whenever the shape resource has been modified. </description> </method> <method name="set_disabled"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_shape"> - <argument index="0" name="shape" type="Object"> + <return type="void"> + </return> + <argument index="0" name="shape" type="Shape"> </argument> <description> </description> @@ -10570,8 +12242,10 @@ </methods> <members> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> + A disabled collision shape has no effect in the world. </member> <member name="shape" type="Shape" setter="set_shape" getter="get_shape" brief=""> + The actual shape owned by this collision shape. </member> </members> <constants> @@ -10579,17 +12253,16 @@ </class> <class name="CollisionShape2D" inherits="Node2D" category="Core"> <brief_description> - Editor-only class for easy editing of shapes. + Node that represents collision shape data in 2D space. </brief_description> <description> - Editor-only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code. + Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D] to give it a detection shape, or add it to a [PhysicsBody2D] to give create solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method get_shape] to get the actual shape. </description> <methods> <method name="get_shape" qualifiers="const"> - <return type="Object"> + <return type="Shape2D"> </return> <description> - Return this shape's [Shape2D]. </description> </method> <method name="is_disabled" qualifiers="const"> @@ -10605,31 +12278,39 @@ </description> </method> <method name="set_disabled"> + <return type="void"> + </return> <argument index="0" name="disabled" type="bool"> </argument> <description> </description> </method> <method name="set_one_way_collision"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_shape"> - <argument index="0" name="shape" type="Object"> + <return type="void"> + </return> + <argument index="0" name="shape" type="Shape2D"> </argument> <description> - Set this shape's [Shape2D]. This will not appear as a node, but can be directly edited as a property. </description> </method> </methods> <members> <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> + A disabled collision shape has no effect in the world. </member> <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" brief=""> + Sets whether this collision shape should only detect collision on one side (top or bottom). </member> <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" brief=""> + The actual shape owned by this collision shape. </member> </members> <constants> @@ -10637,10 +12318,10 @@ </class> <class name="Color" category="Built-In Types"> <brief_description> - Color in RGBA format. + Color in RGBA format with some support for ARGB format. </brief_description> <description> - A color is represented as red, green and blue (r,g,b) components. Additionally, "a" represents the alpha component, often used for transparency. Values are in floating point and usually range from 0 to 1. Some methods (such as set_modulate() ) may accept values > 1. + A color is represented as red, green and blue (r,g,b) components. Additionally, "a" represents the alpha component, often used for transparency. Values are in floating point and usually range from 0 to 1. Some methods (such as set_modulate(color)) may accept values > 1. </description> <methods> <method name="Color"> @@ -10655,7 +12336,10 @@ <argument index="3" name="a" type="float"> </argument> <description> - Construct the color from an RGBA profile. + Constructs a color from an RGBA profile using values between 0 and 1 (float). + [codeblock] + var c = Color(0.2, 1.0, .7, .8) # a color of an RGBA(51, 255, 178, 204) + [/codeblock] </description> </method> <method name="Color"> @@ -10668,7 +12352,10 @@ <argument index="2" name="b" type="float"> </argument> <description> - Construct the color from an RGBA profile. + Constructs a color from an RGB profile using values between 0 and 1 (float). Alpha will always be 1. + [codeblock] + var c = Color(0.2, 1.0, .7) # a color of an RGBA(51, 255, 178, 255) + [/codeblock] </description> </method> <method name="Color"> @@ -10677,7 +12364,10 @@ <argument index="0" name="from" type="int"> </argument> <description> - Construct the color from an RGBA profile. + Constructs a color from a 32-bit integer (each byte represents a component of the RGBA profile). + [codeblock] + var c = Color(274) # a color of an RGBA(0, 0, 1, 18) + [/codeblock] </description> </method> <method name="Color"> @@ -10686,7 +12376,19 @@ <argument index="0" name="from" type="String"> </argument> <description> - Construct the color from an RGBA profile. + Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. + The following string formats are supported: + [code]"#ff00ff00"[/code] - ARGB format with '#' + [code]"ff00ff00"[/code] - ARGB format + [code]"#ff00ff"[/code] - RGB format with '#' + [code]"ff00ff"[/code] - RGB format + [codeblock] + # The following code creates the same color of an RGBA(178, 217, 10, 255) + var c1 = Color("#ffb2d90a") # ARGB format with '#' + var c2 = Color("ffb2d90a") # ARGB format + var c3 = Color("#b2d90a") # RGB format with '#' + var c4 = Color("b2d90a") # RGB format + [/codeblock] </description> </method> <method name="blend"> @@ -10695,28 +12397,46 @@ <argument index="0" name="over" type="Color"> </argument> <description> - Return a new color blended with anothor one. + Returns a new color resulting from blending this color over another color. If the color is opaque, the result would also be opaque. The other color could then take a range of values with different alpha values. + [codeblock] + var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50% + var fg = Color(1.0, 0.0, 0.0, .5) # Red with alpha of 50% + var blendedColor = bg.blend(fg) # Brown with alpha of 75% + [/codeblock] </description> </method> <method name="contrasted"> <return type="Color"> </return> <description> - Return the most contrasting color with this one. + Returns the most contrasting color. + [codeblock] + var c = Color(.3, .4, .9) + var contrastedColor = c.contrasted() # a color of an RGBA(204, 229, 102, 255) + [/codeblock] </description> </method> <method name="gray"> <return type="float"> </return> <description> - Convert the color to gray. + Returns the color's grayscale. + The gray is calculated by (r + g + b) / 3. + [codeblock] + var c = Color(0.2, 0.45, 0.82) + var gray = c.gray() # a value of 0.466667 + [/codeblock] </description> </method> <method name="inverted"> <return type="Color"> </return> <description> - Return the inverted color (1-r, 1-g, 1-b, 1-a). + Returns the inverted color (1-r, 1-g, 1-b, 1-a). + [codeblock] + var c = Color(.3, .4, .9) + var invertedColor = c.inverted() # a color of an RGBA(178, 153, 26, 255) + [/codeblock] </description> </method> <method name="linear_interpolate"> @@ -10727,21 +12447,36 @@ <argument index="1" name="t" type="float"> </argument> <description> - Return the linear interpolation with another color. + Returns the color of the linear interpolation with another color. The value t is between 0 and 1 (float). + [codeblock] + var c1 = Color(1.0, 0.0, 0.0) + var c2 = Color(0.0, 1.0, 0.0) + var li_c = c1.linear_interpolate(c2, 0.5) # a color of an RGBA(128, 128, 0, 255) + [/codeblock] </description> </method> <method name="to_32"> <return type="int"> </return> <description> - Convert the color to a 32 its integer (each byte represents a RGBA). + Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). + [codeblock] + var c = Color(1, .5, .2) + print(str(c.to_32())) # prints 4294934323 + [/codeblock] + + [i]This is same as [method to_ARGB32] but may be changed later to support RGBA format instead[/i]. </description> </method> <method name="to_ARGB32"> <return type="int"> </return> <description> - Convert color to ARGB32, more compatible with DirectX. + Returns the color's 32-bit integer in ARGB format (each byte represents a component of the ARGB profile). More compatible with DirectX. + [codeblock] + var c = Color(1, .5, .2) + print(str(c.to_32())) # prints 4294934323 + [/codeblock] </description> </method> <method name="to_html"> @@ -10750,7 +12485,13 @@ <argument index="0" name="with_alpha" type="bool" default="True"> </argument> <description> - Return the HTML hexadecimal color string. + Returns the color's HTML hexadecimal color string in ARGB format (ex: [code]ff34f822[/code]). + Optionally flag 'false' to not include alpha in hexadecimal string. + [codeblock] + var c = Color(1, 1, 1, .5) + var s1 = c.to_html() # Results "7fffffff" + var s2 = c.to_html(false) # Results 'ffffff' + [/codeblock] </description> </method> </methods> @@ -10801,7 +12542,9 @@ </description> <methods> <method name="add_preset"> - <argument index="0" name="arg0" type="Color"> + <return type="void"> + </return> + <argument index="0" name="color" type="Color"> </argument> <description> Adds the current selected to color to a list of colors (presets), the presets will be displayed in the color picker and the user will be able to select them, notice that the presets list is only for this color picker. @@ -10829,6 +12572,8 @@ </description> </method> <method name="set_edit_alpha"> + <return type="void"> + </return> <argument index="0" name="show" type="bool"> </argument> <description> @@ -10836,6 +12581,8 @@ </description> </method> <method name="set_pick_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> @@ -10843,6 +12590,8 @@ </description> </method> <method name="set_raw_mode"> + <return type="void"> + </return> <argument index="0" name="mode" type="bool"> </argument> <description> @@ -10910,6 +12659,8 @@ </description> </method> <method name="set_edit_alpha"> + <return type="void"> + </return> <argument index="0" name="show" type="bool"> </argument> <description> @@ -10917,9 +12668,17 @@ </description> </method> <method name="set_pick_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> + Set new color to ColorRect. + + [codeblock] + var cr = get_node("colorrect_node") + cr.set_frame_color(Color(1, 0, 0, 1)) # Set color rect node to red + [/codeblock] </description> </method> </methods> @@ -10967,20 +12726,34 @@ </class> <class name="ColorRect" inherits="Control" category="Core"> <brief_description> + Colored rect for canvas. </brief_description> <description> + An object that is represented on the canvas as a rect with color. [Color] is used to set or get color info for the rect. </description> <methods> <method name="get_frame_color" qualifiers="const"> <return type="Color"> </return> <description> + Return the color in RGBA format. + [codeblock] + var cr = get_node("colorrect_node") + var c = cr.get_frame_color() # Default color is white + [/codeblock] </description> </method> <method name="set_frame_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> + Set new color to ColorRect. + [codeblock] + var cr = get_node("colorrect_node") + cr.set_frame_color(Color(1, 0, 0, 1)) # Set color rect node to red + [/codeblock] </description> </method> </methods> @@ -11007,6 +12780,8 @@ </description> </method> <method name="set_faces"> + <return type="void"> + </return> <argument index="0" name="faces" type="PoolVector3Array"> </argument> <description> @@ -11034,6 +12809,8 @@ </description> </method> <method name="set_segments"> + <return type="void"> + </return> <argument index="0" name="segments" type="PoolVector2Array"> </argument> <description> @@ -11057,13 +12834,15 @@ <method name="get_param" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="ConeTwistJoint.Param"> </argument> <description> </description> </method> <method name="set_param"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="ConeTwistJoint.Param"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -11120,6 +12899,8 @@ </description> <methods> <method name="erase_section"> + <return type="void"> + </return> <argument index="0" name="section" type="String"> </argument> <description> @@ -11148,7 +12929,7 @@ </argument> <argument index="1" name="key" type="String"> </argument> - <argument index="2" name="default" type="Variant" default="NULL"> + <argument index="2" name="default" type="Variant" default="null"> </argument> <description> Return the current value for the specified section and key. If the section and/or the key do not exist, the method returns the value of the optional [i]default[/i] argument (and thus [code]NULL[/code] if not specified). @@ -11175,7 +12956,7 @@ </description> </method> <method name="load"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -11184,7 +12965,7 @@ </description> </method> <method name="save"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -11194,6 +12975,8 @@ </description> </method> <method name="set_value"> + <return type="void"> + </return> <argument index="0" name="section" type="String"> </argument> <argument index="1" name="key" type="String"> @@ -11237,6 +13020,8 @@ </description> <methods> <method name="fit_child_in_rect"> + <return type="void"> + </return> <argument index="0" name="child" type="Control"> </argument> <argument index="1" name="rect" type="Rect2"> @@ -11246,6 +13031,8 @@ </description> </method> <method name="queue_sort"> + <return type="void"> + </return> <description> Queue resort of the contained children. This is called automatically anyway, but can be called upon request. </description> @@ -11259,44 +13046,50 @@ </signal> </signals> <constants> - <constant name="NOTIFICATION_SORT_CHILDREN" value="50"> + <constant name="NOTIFICATION_SORT_CHILDREN" value="50" enum=""> Notification for when sorting the children, it must be obeyed immediately. </constant> </constants> </class> <class name="Control" inherits="CanvasItem" category="Core"> <brief_description> - Control is the base node for all the GUI components. + Base node for all User Interface components. </brief_description> <description> - Control is the base class Node for all the GUI components. Every GUI component inherits from it, directly or indirectly. In this way, sections of the scene tree made of contiguous control nodes, become user interfaces. - Controls are relative to the parent position and size by using anchors and margins. This ensures that they can adapt easily in most situation to changing dialog and screen sizes. When more flexibility is desired, [Container] derived nodes can be used. + The base class Node for all User Interface components. Every UI node inherits from it. Any scene or portion of a scene tree composed of Control nodes is a User Interface. + Controls use anchors and margins to place themselves relative to their parent. They adapt automatically when their parent or the screen size changes. To build flexible UIs, use built-in [Container] nodes or create your own. Anchors work by defining which margin do they follow, and a value relative to it. Allowed anchoring modes are ANCHOR_BEGIN, where the margin is relative to the top or left margins of the parent (in pixels), ANCHOR_END for the right and bottom margins of the parent and ANCHOR_RATIO, which is a ratio from 0 to 1 in the parent range. - Input device events are first sent to the root controls via the [method Node._input], which distribute it through the tree, then delivers them to the adequate one (under cursor or keyboard focus based) by calling [method MainLoop._input_event]. There is no need to enable input processing on controls to receive such events. To ensure that no one else will receive the event (not even [method Node._unhandled_input]), the control can accept it by calling [method accept_event]. - Only one control can hold the keyboard focus (receiving keyboard events), for that the control must define the focus mode with [method set_focus_mode]. Focus is lost when another control gains it, or the current focus owner is hidden. - It is sometimes desired for a control to ignore mouse/pointer events. This is often the case when placing other controls on top of a button, in such cases. Calling [method set_ignore_mouse] enables this function. - Finally, controls are skinned according to a [Theme]. Setting a [Theme] on a control will propagate all the skinning down the tree. Optionally, skinning can be overridden per each control by calling the add_*_override functions, or from the editor. + Godot sends Input events to the root node first, via [method Node._input]. The method distributes it through the node tree and delivers the input events to the node under the mouse cursor or on focus with the keyboard. To do so, it calls [method MainLoop._input_event]. No need to enable [method Node.set_process_input] on Controls to receive input events. Call [method accept_event] to ensure no other node receives the event, not even [method Node._unhandled_input]. + Only the one Control node in focus receives keyboard events. To do so, the Control must get the focus mode with [method set_focus_mode]. It loses focus when another Control gets it, or if the current Control in focus is hidden. + You'll sometimes want Controls to ignore mouse or touch events. For example, if you place an icon on top of a button. Call [method set_ignore_mouse] for that. + [Theme] resources change the Control's appearance. If you change the [Theme] on a parent Control node, it will propagate to all of its children. You can override parts of the theme on each Control with the add_*_override methods, like [method add_font_override]. You can also override the theme from the editor. </description> <methods> <method name="_get_minimum_size" qualifiers="virtual"> <return type="Vector2"> </return> <description> - Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size. + Returns the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size. </description> </method> <method name="_gui_input" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="event" type="InputEvent"> </argument> <description> </description> </method> <method name="accept_event"> + <return type="void"> + </return> <description> - Handles the event, no other control will receive it and it will not be sent to nodes waiting on [method Node._unhandled_input] or [method Node._unhandled_key_input]. + Marks the input event as handled. No other Control will receive it, and the input event will not propagate. Not even to nodes listening to [method Node._unhandled_input] or [method Node._unhandled_key_input]. </description> </method> <method name="add_color_override"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="color" type="Color"> @@ -11305,6 +13098,8 @@ </description> </method> <method name="add_constant_override"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="constant" type="int"> @@ -11314,6 +13109,8 @@ </description> </method> <method name="add_font_override"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="font" type="Font"> @@ -11323,6 +13120,8 @@ </description> </method> <method name="add_icon_override"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="texture" type="Texture"> @@ -11332,6 +13131,8 @@ </description> </method> <method name="add_shader_override"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="shader" type="Shader"> @@ -11340,6 +13141,8 @@ </description> </method> <method name="add_style_override"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="stylebox" type="StyleBox"> @@ -11359,6 +13162,8 @@ </description> </method> <method name="drop_data" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <argument index="1" name="data" type="Variant"> @@ -11367,17 +13172,19 @@ </description> </method> <method name="force_drag"> + <return type="void"> + </return> <argument index="0" name="data" type="Variant"> </argument> - <argument index="1" name="preview" type="Object"> + <argument index="1" name="preview" type="Control"> </argument> <description> </description> </method> <method name="get_anchor" qualifiers="const"> - <return type="int"> + <return type="float"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> Return the anchor type (ANCHOR_BEGIN, ANCHOR_END, ANCHOR_RATIO) for a given margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). @@ -11416,9 +13223,9 @@ </description> </method> <method name="get_cursor_shape" qualifiers="const"> - <return type="int"> + <return type="int" enum="Control.CursorShape"> </return> - <argument index="0" name="pos" type="Vector2" default="Vector2(0, 0)"> + <argument index="0" name="pos" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> Return the cursor shape at a certain position in the control. @@ -11431,7 +13238,7 @@ </description> </method> <method name="get_default_cursor_shape" qualifiers="const"> - <return type="int"> + <return type="int" enum="Control.CursorShape"> </return> <description> Return the default cursor shape for this control. See enum CURSOR_* for the list of shapes. @@ -11453,7 +13260,7 @@ </description> </method> <method name="get_focus_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Control.FocusMode"> </return> <description> Returns the focus access mode for the control (FOCUS_NONE, FOCUS_CLICK, FOCUS_ALL) (see [method set_focus_mode]). @@ -11462,7 +13269,7 @@ <method name="get_focus_neighbour" qualifiers="const"> <return type="NodePath"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> Return the forced neighbour for moving the input focus to. When pressing TAB or directional/joypad directions focus is moved to the next control in that direction. However, the neighbour to move to can be forced with this function. @@ -11500,7 +13307,7 @@ </description> </method> <method name="get_h_grow_direction" qualifiers="const"> - <return type="int"> + <return type="int" enum="Control.GrowDirection"> </return> <description> </description> @@ -11525,7 +13332,7 @@ <method name="get_margin" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> Return a margin offset. Margin can be one of (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Offset value being returned depends on the anchor mode. @@ -11539,7 +13346,7 @@ </description> </method> <method name="get_mouse_filter" qualifiers="const"> - <return type="int"> + <return type="int" enum="Control.MouseFilter"> </return> <description> Return when the control is ignoring mouse events (even touchpad events send mouse events). @@ -11631,14 +13438,14 @@ <method name="get_tooltip" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="atpos" type="Vector2" default="Vector2(0, 0)"> + <argument index="0" name="atpos" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> Return the tooltip, which will appear when the cursor is resting over this control. </description> </method> <method name="get_v_grow_direction" qualifiers="const"> - <return type="int"> + <return type="int" enum="Control.GrowDirection"> </return> <description> </description> @@ -11651,10 +13458,14 @@ </description> </method> <method name="grab_click_focus"> + <return type="void"> + </return> <description> </description> </method> <method name="grab_focus"> + <return type="void"> + </return> <description> Steal the focus from another control and become the focused control (see [method set_focus_mode]). </description> @@ -11739,6 +13550,8 @@ </description> </method> <method name="has_point" qualifiers="virtual"> + <return type="bool"> + </return> <argument index="0" name="point" type="Vector2"> </argument> <description> @@ -11769,38 +13582,59 @@ </description> </method> <method name="minimum_size_changed"> + <return type="void"> + </return> <description> </description> </method> <method name="release_focus"> + <return type="void"> + </return> <description> Give up the focus, no other control will be able to receive keyboard input. </description> </method> <method name="set_anchor"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> - <argument index="1" name="anchor_mode" type="int"> + <argument index="1" name="anchor" type="float"> </argument> <argument index="2" name="keep_margin" type="bool" default="false"> </argument> + <argument index="3" name="push_opposite_anchor" type="bool" default="true"> + </argument> <description> - Change the anchor (ANCHOR_BEGIN, ANCHOR_END, ANCHOR_RATIO) type for a margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Changing the anchor mode converts the current margin offset from the previous anchor mode to the new one, so margin offsets ([method set_margin]) must be done after setting anchors, or at the same time ([method set_anchor_and_margin]) - Additionally, [code]keep_margin[/code] controls whether margins should be left the same, or changed to keep the same position and size on-screen. </description> </method> <method name="set_anchor_and_margin"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> - <argument index="1" name="anchor_mode" type="int"> + <argument index="1" name="anchor" type="float"> </argument> <argument index="2" name="offset" type="float"> </argument> + <argument index="3" name="push_opposite_anchor" type="bool" default="false"> + </argument> + <description> + </description> + </method> + <method name="set_anchors_preset"> + <return type="void"> + </return> + <argument index="0" name="preset" type="int" enum="Control.LayoutPreset"> + </argument> + <argument index="1" name="keep_margin" type="bool" default="false"> + </argument> <description> - Change the anchor (ANCHOR_BEGIN, ANCHOR_END, ANCHOR_RATIO) type for a margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM), and also set its offset. This is a helper (see [method set_anchor] and [method set_margin]). </description> </method> <method name="set_area_as_parent_rect"> + <return type="void"> + </return> <argument index="0" name="margin" type="int" default="0"> </argument> <description> @@ -11808,6 +13642,8 @@ </description> </method> <method name="set_begin"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <description> @@ -11815,37 +13651,49 @@ </description> </method> <method name="set_clip_contents"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_custom_minimum_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> </description> </method> <method name="set_default_cursor_shape"> - <argument index="0" name="shape" type="int"> + <return type="void"> + </return> + <argument index="0" name="shape" type="int" enum="Control.CursorShape"> </argument> <description> Set the default cursor shape for this control. See enum CURSOR_* for the list of shapes. </description> </method> <method name="set_drag_forwarding"> + <return type="void"> + </return> <argument index="0" name="target" type="Control"> </argument> <description> </description> </method> <method name="set_drag_preview"> + <return type="void"> + </return> <argument index="0" name="control" type="Control"> </argument> <description> </description> </method> <method name="set_end"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <description> @@ -11853,14 +13701,18 @@ </description> </method> <method name="set_focus_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Control.FocusMode"> </argument> <description> Set the focus access mode for the control (FOCUS_NONE, FOCUS_CLICK, FOCUS_ALL). Only one Control can be focused at the same time, and it will receive keyboard signals. </description> </method> <method name="set_focus_neighbour"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <argument index="1" name="neighbour" type="NodePath"> </argument> @@ -11869,6 +13721,8 @@ </description> </method> <method name="set_global_position"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <description> @@ -11876,12 +13730,16 @@ </description> </method> <method name="set_h_grow_direction"> - <argument index="0" name="direction" type="int"> + <return type="void"> + </return> + <argument index="0" name="direction" type="int" enum="Control.GrowDirection"> </argument> <description> </description> </method> <method name="set_h_size_flags"> + <return type="void"> + </return> <argument index="0" name="flags" type="int"> </argument> <description> @@ -11889,7 +13747,9 @@ </description> </method> <method name="set_margin"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <argument index="1" name="offset" type="float"> </argument> @@ -11898,19 +13758,25 @@ </description> </method> <method name="set_mouse_filter"> - <argument index="0" name="filter" type="int"> + <return type="void"> + </return> + <argument index="0" name="filter" type="int" enum="Control.MouseFilter"> </argument> <description> Set when the control is ignoring mouse events (even touchpad events send mouse events). (see the MOUSE_FILTER_* constants) </description> </method> <method name="set_pivot_offset"> + <return type="void"> + </return> <argument index="0" name="pivot_offset" type="Vector2"> </argument> <description> </description> </method> <method name="set_position"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <description> @@ -11918,6 +13784,8 @@ </description> </method> <method name="set_rotation"> + <return type="void"> + </return> <argument index="0" name="radians" type="float"> </argument> <description> @@ -11925,6 +13793,8 @@ </description> </method> <method name="set_rotation_deg"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> @@ -11932,12 +13802,16 @@ </description> </method> <method name="set_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="Vector2"> </argument> <description> </description> </method> <method name="set_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> @@ -11945,6 +13819,8 @@ </description> </method> <method name="set_stretch_ratio"> + <return type="void"> + </return> <argument index="0" name="ratio" type="float"> </argument> <description> @@ -11952,6 +13828,8 @@ </description> </method> <method name="set_theme"> + <return type="void"> + </return> <argument index="0" name="theme" type="Theme"> </argument> <description> @@ -11959,6 +13837,8 @@ </description> </method> <method name="set_tooltip"> + <return type="void"> + </return> <argument index="0" name="tooltip" type="String"> </argument> <description> @@ -11966,12 +13846,16 @@ </description> </method> <method name="set_v_grow_direction"> - <argument index="0" name="direction" type="int"> + <return type="void"> + </return> + <argument index="0" name="direction" type="int" enum="Control.GrowDirection"> </argument> <description> </description> </method> <method name="set_v_size_flags"> + <return type="void"> + </return> <argument index="0" name="flags" type="int"> </argument> <description> @@ -11979,6 +13863,8 @@ </description> </method> <method name="show_modal"> + <return type="void"> + </return> <argument index="0" name="exclusive" type="bool" default="false"> </argument> <description> @@ -11986,6 +13872,8 @@ </description> </method> <method name="warp_mouse"> + <return type="void"> + </return> <argument index="0" name="to_pos" type="Vector2"> </argument> <description> @@ -11993,13 +13881,13 @@ </method> </methods> <members> - <member name="anchor_bottom" type="int" setter="_set_anchor" getter="get_anchor" brief=""> + <member name="anchor_bottom" type="float" setter="_set_anchor" getter="get_anchor" brief=""> </member> - <member name="anchor_left" type="int" setter="_set_anchor" getter="get_anchor" brief=""> + <member name="anchor_left" type="float" setter="_set_anchor" getter="get_anchor" brief=""> </member> - <member name="anchor_right" type="int" setter="_set_anchor" getter="get_anchor" brief=""> + <member name="anchor_right" type="float" setter="_set_anchor" getter="get_anchor" brief=""> </member> - <member name="anchor_top" type="int" setter="_set_anchor" getter="get_anchor" brief=""> + <member name="anchor_top" type="float" setter="_set_anchor" getter="get_anchor" brief=""> </member> <member name="focus_neighbour_bottom" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" brief=""> </member> @@ -12009,21 +13897,21 @@ </member> <member name="focus_neighbour_top" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" brief=""> </member> - <member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" brief=""> + <member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" brief="" enum="Control.GrowDirection"> </member> - <member name="grow_vertical" type="int" setter="set_v_grow_direction" getter="get_v_grow_direction" brief=""> + <member name="grow_vertical" type="int" setter="set_v_grow_direction" getter="get_v_grow_direction" brief="" enum="Control.GrowDirection"> </member> <member name="hint_tooltip" type="String" setter="set_tooltip" getter="_get_tooltip" brief=""> </member> - <member name="margin_bottom" type="int" setter="set_margin" getter="get_margin" brief=""> + <member name="margin_bottom" type="float" setter="set_margin" getter="get_margin" brief=""> </member> - <member name="margin_left" type="int" setter="set_margin" getter="get_margin" brief=""> + <member name="margin_left" type="float" setter="set_margin" getter="get_margin" brief=""> </member> - <member name="margin_right" type="int" setter="set_margin" getter="get_margin" brief=""> + <member name="margin_right" type="float" setter="set_margin" getter="get_margin" brief=""> </member> - <member name="margin_top" type="int" setter="set_margin" getter="get_margin" brief=""> + <member name="margin_top" type="float" setter="set_margin" getter="get_margin" brief=""> </member> - <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" brief=""> + <member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" brief="" enum="Control.MouseFilter"> </member> <member name="rect_clip_content" type="bool" setter="set_clip_contents" getter="is_clipping_contents" brief=""> </member> @@ -12041,7 +13929,7 @@ </member> <member name="size_flags_horizontal" type="int" setter="set_h_size_flags" getter="get_h_size_flags" brief=""> </member> - <member name="size_flags_stretch_ratio" type="int" setter="set_stretch_ratio" getter="get_stretch_ratio" brief=""> + <member name="size_flags_stretch_ratio" type="float" setter="set_stretch_ratio" getter="get_stretch_ratio" brief=""> </member> <member name="size_flags_vertical" type="int" setter="set_v_size_flags" getter="get_v_size_flags" brief=""> </member> @@ -12051,12 +13939,12 @@ <signals> <signal name="focus_entered"> <description> - Emitted when keyboard focus is gained. + Emitted when the node gains keyboard focus. </description> </signal> <signal name="focus_exited"> <description> - Emitted when the keyboard focus is lost. + Emitted when the node loses keyboard focus. </description> </signal> <signal name="gui_input"> @@ -12067,7 +13955,7 @@ </signal> <signal name="minimum_size_changed"> <description> - Emitted when the minimum size of the control changed. + Emitted when the node's minimum size changes. </description> </signal> <signal name="modal_closed"> @@ -12076,34 +13964,26 @@ </signal> <signal name="mouse_entered"> <description> - Emitted when the mouse enters the control area. + Emitted when the mouse enters the control's area. </description> </signal> <signal name="mouse_exited"> <description> - Emitted when the mouse left the control area. + Emitted when the mouse leaves the control's area. </description> </signal> <signal name="resized"> <description> - Emitted when the control changed size. + Emitted when the control changes size. </description> </signal> <signal name="size_flags_changed"> <description> - Emitted when the size flags changed. + Emitted when the size flags change. </description> </signal> </signals> <constants> - <constant name="ANCHOR_BEGIN" value="0"> - X is relative to MARGIN_LEFT, Y is relative to MARGIN_TOP. - </constant> - <constant name="ANCHOR_END" value="1"> - X is relative to -MARGIN_RIGHT, Y is relative to -MARGIN_BOTTOM. - </constant> - <constant name="ANCHOR_CENTER" value="2"> - </constant> <constant name="FOCUS_NONE" value="0"> Control can't acquire focus. </constant> @@ -12113,25 +13993,25 @@ <constant name="FOCUS_ALL" value="2"> Control can acquire focus if clicked, or by pressing TAB/Directionals in the keyboard from another Control. </constant> - <constant name="NOTIFICATION_RESIZED" value="40"> + <constant name="NOTIFICATION_RESIZED" value="40" enum=""> Control changed size (get_size() reports the new size). </constant> - <constant name="NOTIFICATION_MOUSE_ENTER" value="41"> + <constant name="NOTIFICATION_MOUSE_ENTER" value="41" enum=""> Mouse pointer entered the area of the Control. </constant> - <constant name="NOTIFICATION_MOUSE_EXIT" value="42"> + <constant name="NOTIFICATION_MOUSE_EXIT" value="42" enum=""> Mouse pointer exited the area of the Control. </constant> - <constant name="NOTIFICATION_FOCUS_ENTER" value="43"> + <constant name="NOTIFICATION_FOCUS_ENTER" value="43" enum=""> Control gained focus. </constant> - <constant name="NOTIFICATION_FOCUS_EXIT" value="44"> + <constant name="NOTIFICATION_FOCUS_EXIT" value="44" enum=""> Control lost focus. </constant> - <constant name="NOTIFICATION_THEME_CHANGED" value="45"> + <constant name="NOTIFICATION_THEME_CHANGED" value="45" enum=""> Theme changed. Redrawing is desired. </constant> - <constant name="NOTIFICATION_MODAL_CLOSE" value="46"> + <constant name="NOTIFICATION_MODAL_CLOSE" value="46" enum=""> Modal control was closed. </constant> <constant name="CURSOR_ARROW" value="0"> @@ -12168,6 +14048,38 @@ </constant> <constant name="CURSOR_HELP" value="16"> </constant> + <constant name="PRESET_TOP_LEFT" value="0"> + </constant> + <constant name="PRESET_TOP_RIGHT" value="1"> + </constant> + <constant name="PRESET_BOTTOM_LEFT" value="2"> + </constant> + <constant name="PRESET_BOTTOM_RIGHT" value="3"> + </constant> + <constant name="PRESET_CENTER_LEFT" value="4"> + </constant> + <constant name="PRESET_CENTER_TOP" value="5"> + </constant> + <constant name="PRESET_CENTER_RIGHT" value="6"> + </constant> + <constant name="PRESET_CENTER_BOTTOM" value="7"> + </constant> + <constant name="PRESET_CENTER" value="8"> + </constant> + <constant name="PRESET_LEFT_WIDE" value="9"> + </constant> + <constant name="PRESET_TOP_WIDE" value="10"> + </constant> + <constant name="PRESET_RIGHT_WIDE" value="11"> + </constant> + <constant name="PRESET_BOTTOM_WIDE" value="12"> + </constant> + <constant name="PRESET_VCENTER_WIDE" value="13"> + </constant> + <constant name="PRESET_HCENTER_WIDE" value="14"> + </constant> + <constant name="PRESET_WIDE" value="15"> + </constant> <constant name="SIZE_EXPAND" value="2"> </constant> <constant name="SIZE_FILL" value="1"> @@ -12188,6 +14100,12 @@ </constant> <constant name="GROW_DIRECTION_END" value="1"> </constant> + <constant name="ANCHOR_BEGIN" value="0"> + X is relative to MARGIN_LEFT, Y is relative to MARGIN_TOP. + </constant> + <constant name="ANCHOR_END" value="1"> + X is relative to -MARGIN_RIGHT, Y is relative to -MARGIN_BOTTOM. + </constant> </constants> </class> <class name="ConvexPolygonShape" inherits="Shape" category="Core"> @@ -12205,6 +14123,8 @@ </description> </method> <method name="set_points"> + <return type="void"> + </return> <argument index="0" name="points" type="PoolVector3Array"> </argument> <description> @@ -12212,7 +14132,7 @@ </method> </methods> <members> - <member name="points" type="Array" setter="set_points" getter="get_points" brief=""> + <member name="points" type="PoolVector3Array" setter="set_points" getter="get_points" brief=""> </member> </members> <constants> @@ -12235,6 +14155,8 @@ </description> </method> <method name="set_point_cloud"> + <return type="void"> + </return> <argument index="0" name="point_cloud" type="PoolVector2Array"> </argument> <description> @@ -12242,6 +14164,8 @@ </description> </method> <method name="set_points"> + <return type="void"> + </return> <argument index="0" name="points" type="PoolVector2Array"> </argument> <description> @@ -12281,15 +14205,15 @@ </description> </method> <method name="get_side" qualifiers="const"> - <return type="Object"> + <return type="Image"> </return> - <argument index="0" name="side" type="int"> + <argument index="0" name="side" type="int" enum="CubeMap.Side"> </argument> <description> </description> </method> <method name="get_storage" qualifiers="const"> - <return type="int"> + <return type="int" enum="CubeMap.Storage"> </return> <description> </description> @@ -12301,27 +14225,35 @@ </description> </method> <method name="set_flags"> + <return type="void"> + </return> <argument index="0" name="flags" type="int"> </argument> <description> </description> </method> <method name="set_lossy_storage_quality"> + <return type="void"> + </return> <argument index="0" name="quality" type="float"> </argument> <description> </description> </method> <method name="set_side"> - <argument index="0" name="side" type="int"> + <return type="void"> + </return> + <argument index="0" name="side" type="int" enum="CubeMap.Side"> </argument> - <argument index="1" name="image" type="Object"> + <argument index="1" name="image" type="Image"> </argument> <description> </description> </method> <method name="set_storage"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="CubeMap.Storage"> </argument> <description> </description> @@ -12358,8 +14290,10 @@ </class> <class name="CubeMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Generate an axis-aligned cuboid [PrimitiveMesh]. </brief_description> <description> + Generate an axis-aligned cuboid [PrimitiveMesh]. </description> <methods> <method name="get_size" qualifiers="const"> @@ -12387,24 +14321,32 @@ </description> </method> <method name="set_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector3"> </argument> <description> </description> </method> <method name="set_subdivide_depth"> + <return type="void"> + </return> <argument index="0" name="divisions" type="int"> </argument> <description> </description> </method> <method name="set_subdivide_height"> + <return type="void"> + </return> <argument index="0" name="divisions" type="int"> </argument> <description> </description> </method> <method name="set_subdivide_width"> + <return type="void"> + </return> <argument index="0" name="subdivide" type="int"> </argument> <description> @@ -12412,13 +14354,17 @@ </method> </methods> <members> - <member name="size" type="Vector2" setter="set_size" getter="get_size" brief=""> + <member name="size" type="Vector3" setter="set_size" getter="get_size" brief=""> + Size of the cuboid mesh. Defaults to (2, 2, 2). </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" brief=""> + Number of extra edge loops inserted along the z-axis. Defaults to 0. </member> <member name="subdivide_height" type="int" setter="set_subdivide_height" getter="get_subdivide_height" brief=""> + Number of extra edge loops inserted along the y-axis. Defaults to 0. </member> <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" brief=""> + Number of extra edge loops inserted along the x-axis. Defaults to 0. </member> </members> <constants> @@ -12439,22 +14385,28 @@ </argument> <argument index="2" name="right_tangent" type="float" default="0"> </argument> - <argument index="3" name="left_mode" type="int" default="0"> + <argument index="3" name="left_mode" type="int" enum="Curve.TangentMode" default="0"> </argument> - <argument index="4" name="right_mode" type="int" default="0"> + <argument index="4" name="right_mode" type="int" enum="Curve.TangentMode" default="0"> </argument> <description> </description> </method> <method name="bake"> + <return type="void"> + </return> <description> </description> </method> <method name="clean_dupes"> + <return type="void"> + </return> <description> </description> </method> <method name="clear_points"> + <return type="void"> + </return> <description> </description> </method> @@ -12477,7 +14429,7 @@ </description> </method> <method name="get_point_left_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Curve.TangentMode"> </return> <argument index="0" name="index" type="int"> </argument> @@ -12501,7 +14453,7 @@ </description> </method> <method name="get_point_right_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Curve.TangentMode"> </return> <argument index="0" name="index" type="int"> </argument> @@ -12533,38 +14485,50 @@ </description> </method> <method name="remove_point"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <description> </description> </method> <method name="set_bake_resolution"> + <return type="void"> + </return> <argument index="0" name="resolution" type="int"> </argument> <description> </description> </method> <method name="set_max_value"> + <return type="void"> + </return> <argument index="0" name="max" type="float"> </argument> <description> </description> </method> <method name="set_min_value"> + <return type="void"> + </return> <argument index="0" name="min" type="float"> </argument> <description> </description> </method> <method name="set_point_left_mode"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="Curve.TangentMode"> </argument> <description> </description> </method> <method name="set_point_left_tangent"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <argument index="1" name="tangent" type="float"> @@ -12573,6 +14537,8 @@ </description> </method> <method name="set_point_offset"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <argument index="1" name="offset" type="float"> @@ -12581,14 +14547,18 @@ </description> </method> <method name="set_point_right_mode"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="Curve.TangentMode"> </argument> <description> </description> </method> <method name="set_point_right_tangent"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <argument index="1" name="tangent" type="float"> @@ -12597,6 +14567,8 @@ </description> </method> <method name="set_point_value"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <argument index="1" name="y" type="float"> @@ -12606,7 +14578,7 @@ </method> </methods> <members> - <member name="_data" type="int" setter="_set_data" getter="_get_data" brief=""> + <member name="_data" type="Array" setter="_set_data" getter="_get_data" brief=""> </member> <member name="bake_resolution" type="int" setter="set_bake_resolution" getter="get_bake_resolution" brief=""> </member> @@ -12634,11 +14606,13 @@ </description> <methods> <method name="add_point"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> - <argument index="1" name="in" type="Vector2" default="Vector2(0, 0)"> + <argument index="1" name="in" type="Vector2" default="Vector2( 0, 0 )"> </argument> - <argument index="2" name="out" type="Vector2" default="Vector2(0, 0)"> + <argument index="2" name="out" type="Vector2" default="Vector2( 0, 0 )"> </argument> <argument index="3" name="atpos" type="int" default="-1"> </argument> @@ -12648,6 +14622,8 @@ </description> </method> <method name="clear_points"> + <return type="void"> + </return> <description> </description> </method> @@ -12741,6 +14717,8 @@ </description> </method> <method name="remove_point"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -12748,6 +14726,8 @@ </description> </method> <method name="set_bake_interval"> + <return type="void"> + </return> <argument index="0" name="distance" type="float"> </argument> <description> @@ -12755,6 +14735,8 @@ </description> </method> <method name="set_point_in"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="pos" type="Vector2"> @@ -12764,6 +14746,8 @@ </description> </method> <method name="set_point_out"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="pos" type="Vector2"> @@ -12773,6 +14757,8 @@ </description> </method> <method name="set_point_pos"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="pos" type="Vector2"> @@ -12781,7 +14767,7 @@ Sets the position for the vertex "idx". If the index is out of bounds, the function sends an error to the console. </description> </method> - <method name="tesselate" qualifiers="const"> + <method name="tessellate" qualifiers="const"> <return type="PoolVector2Array"> </return> <argument index="0" name="max_stages" type="int" default="5"> @@ -12797,7 +14783,7 @@ </method> </methods> <members> - <member name="_data" type="int" setter="_set_data" getter="_get_data" brief=""> + <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" brief=""> </member> <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval" brief=""> </member> @@ -12815,11 +14801,13 @@ </description> <methods> <method name="add_point"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector3"> </argument> - <argument index="1" name="in" type="Vector3" default="Vector3(0, 0, 0)"> + <argument index="1" name="in" type="Vector3" default="Vector3( 0, 0, 0 )"> </argument> - <argument index="2" name="out" type="Vector3" default="Vector3(0, 0, 0)"> + <argument index="2" name="out" type="Vector3" default="Vector3( 0, 0, 0 )"> </argument> <argument index="3" name="atpos" type="int" default="-1"> </argument> @@ -12829,6 +14817,8 @@ </description> </method> <method name="clear_points"> + <return type="void"> + </return> <description> </description> </method> @@ -12938,6 +14928,8 @@ </description> </method> <method name="remove_point"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -12945,6 +14937,8 @@ </description> </method> <method name="set_bake_interval"> + <return type="void"> + </return> <argument index="0" name="distance" type="float"> </argument> <description> @@ -12952,6 +14946,8 @@ </description> </method> <method name="set_point_in"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="pos" type="Vector3"> @@ -12961,6 +14957,8 @@ </description> </method> <method name="set_point_out"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="pos" type="Vector3"> @@ -12970,6 +14968,8 @@ </description> </method> <method name="set_point_pos"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="pos" type="Vector3"> @@ -12979,6 +14979,8 @@ </description> </method> <method name="set_point_tilt"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="tilt" type="float"> @@ -12988,7 +14990,7 @@ The tilt controls the rotation along the look-at axis an object traveling the path would have. In the case of a curve controlling a [PathFollow], this tilt is an offset over the natural tilt the PathFollow calculates. </description> </method> - <method name="tesselate" qualifiers="const"> + <method name="tessellate" qualifiers="const"> <return type="PoolVector3Array"> </return> <argument index="0" name="max_stages" type="int" default="5"> @@ -13004,7 +15006,7 @@ </method> </methods> <members> - <member name="_data" type="int" setter="_set_data" getter="_get_data" brief=""> + <member name="_data" type="Dictionary" setter="_set_data" getter="_get_data" brief=""> </member> <member name="bake_interval" type="float" setter="set_bake_interval" getter="get_bake_interval" brief=""> </member> @@ -13025,12 +15027,16 @@ </description> </method> <method name="set_curve"> + <return type="void"> + </return> <argument index="0" name="curve" type="Curve"> </argument> <description> </description> </method> <method name="set_width"> + <return type="void"> + </return> <argument index="0" name="width" type="int"> </argument> <description> @@ -13048,8 +15054,10 @@ </class> <class name="CylinderMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a cylindrical [PrimitiveMesh]. </brief_description> <description> + Class representing a cylindrical [PrimitiveMesh]. </description> <methods> <method name="get_bottom_radius" qualifiers="const"> @@ -13083,30 +15091,40 @@ </description> </method> <method name="set_bottom_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> </description> </method> <method name="set_height"> + <return type="void"> + </return> <argument index="0" name="height" type="float"> </argument> <description> </description> </method> <method name="set_radial_segments"> + <return type="void"> + </return> <argument index="0" name="segments" type="int"> </argument> <description> </description> </method> <method name="set_rings"> + <return type="void"> + </return> <argument index="0" name="rings" type="int"> </argument> <description> </description> </method> <method name="set_top_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> @@ -13115,14 +15133,19 @@ </methods> <members> <member name="bottom_radius" type="float" setter="set_bottom_radius" getter="get_bottom_radius" brief=""> + Bottom radius of the cylinder. Defaults to 1.0. </member> <member name="height" type="float" setter="set_height" getter="get_height" brief=""> + Full height of the cylinder. Defaults to 2.0. </member> <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" brief=""> + Number of radial segments on the cylinder. Defaults to 64. </member> <member name="rings" type="int" setter="set_rings" getter="get_rings" brief=""> + Number of edge rings along the height of the cylinder. Defaults to 4. </member> <member name="top_radius" type="float" setter="set_top_radius" getter="get_top_radius" brief=""> + Top radius of the cylinder. Defaults to 1.0. </member> </members> <constants> @@ -13165,6 +15188,8 @@ </description> </method> <method name="set_damping"> + <return type="void"> + </return> <argument index="0" name="damping" type="float"> </argument> <description> @@ -13172,6 +15197,8 @@ </description> </method> <method name="set_length"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> @@ -13179,6 +15206,8 @@ </description> </method> <method name="set_rest_length"> + <return type="void"> + </return> <argument index="0" name="rest_length" type="float"> </argument> <description> @@ -13186,6 +15215,8 @@ </description> </method> <method name="set_stiffness"> + <return type="void"> + </return> <argument index="0" name="stiffness" type="float"> </argument> <description> @@ -13292,7 +15323,7 @@ </description> <methods> <method name="get_shadow_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="DirectionalLight.ShadowMode"> </return> <description> </description> @@ -13304,22 +15335,28 @@ </description> </method> <method name="set_blend_splits"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_shadow_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="DirectionalLight.ShadowMode"> </argument> <description> </description> </method> </methods> <members> + <member name="directional_shadow_bias_split_scale" type="float" setter="set_param" getter="get_param" brief=""> + </member> <member name="directional_shadow_blend_splits" type="bool" setter="set_blend_splits" getter="is_blend_splits_enabled" brief=""> </member> - <member name="directional_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" brief=""> + <member name="directional_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" brief="" enum="DirectionalLight.ShadowMode"> </member> <member name="directional_shadow_normal_bias" type="float" setter="set_param" getter="get_param" brief=""> </member> @@ -13364,7 +15401,7 @@ </description> <methods> <method name="change_dir"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="todir" type="String"> </argument> @@ -13374,7 +15411,7 @@ </description> </method> <method name="copy"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="from" type="String"> </argument> @@ -13455,7 +15492,7 @@ </description> </method> <method name="list_dir_begin"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="skip_navigational" type="bool" default="false"> </argument> @@ -13468,12 +15505,14 @@ </description> </method> <method name="list_dir_end"> + <return type="void"> + </return> <description> Close the current stream opened with [method list_dir_begin] (whether it has been fully processed with [method get_next] or not does not matter). </description> </method> <method name="make_dir"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -13483,7 +15522,7 @@ </description> </method> <method name="make_dir_recursive"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -13493,7 +15532,7 @@ </description> </method> <method name="open"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -13503,7 +15542,7 @@ </description> </method> <method name="remove"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -13513,7 +15552,7 @@ </description> </method> <method name="rename"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="from" type="String"> </argument> @@ -13535,6 +15574,8 @@ </description> <methods> <method name="add_fallback"> + <return type="void"> + </return> <argument index="0" name="data" type="DynamicFontData"> </argument> <description> @@ -13587,12 +15628,16 @@ </description> </method> <method name="remove_fallback"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> </description> </method> <method name="set_fallback"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="data" type="DynamicFontData"> @@ -13601,18 +15646,24 @@ </description> </method> <method name="set_font_data"> + <return type="void"> + </return> <argument index="0" name="data" type="DynamicFontData"> </argument> <description> </description> </method> <method name="set_size"> + <return type="void"> + </return> <argument index="0" name="data" type="int"> </argument> <description> </description> </method> <method name="set_spacing"> + <return type="void"> + </return> <argument index="0" name="type" type="int"> </argument> <argument index="1" name="value" type="int"> @@ -13621,12 +15672,16 @@ </description> </method> <method name="set_use_filter"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_use_mipmaps"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -13675,6 +15730,8 @@ </description> </method> <method name="set_font_path"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> @@ -13695,17 +15752,21 @@ </description> <methods> <method name="add_filter"> + <return type="void"> + </return> <argument index="0" name="filter" type="String"> </argument> <description> </description> </method> <method name="clear_filters"> + <return type="void"> + </return> <description> </description> </method> <method name="get_access" qualifiers="const"> - <return type="int"> + <return type="int" enum="EditorFileDialog.Access"> </return> <description> </description> @@ -13729,13 +15790,13 @@ </description> </method> <method name="get_display_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="EditorFileDialog.DisplayMode"> </return> <description> </description> </method> <method name="get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="EditorFileDialog.Mode"> </return> <description> </description> @@ -13747,6 +15808,8 @@ </description> </method> <method name="invalidate"> + <return type="void"> + </return> <description> </description> </method> @@ -13763,48 +15826,64 @@ </description> </method> <method name="set_access"> - <argument index="0" name="access" type="int"> + <return type="void"> + </return> + <argument index="0" name="access" type="int" enum="EditorFileDialog.Access"> </argument> <description> </description> </method> <method name="set_current_dir"> + <return type="void"> + </return> <argument index="0" name="dir" type="String"> </argument> <description> </description> </method> <method name="set_current_file"> + <return type="void"> + </return> <argument index="0" name="file" type="String"> </argument> <description> </description> </method> <method name="set_current_path"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> </description> </method> <method name="set_disable_overwrite_warning"> + <return type="void"> + </return> <argument index="0" name="disable" type="bool"> </argument> <description> </description> </method> <method name="set_display_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="EditorFileDialog.DisplayMode"> </argument> <description> </description> </method> <method name="set_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="EditorFileDialog.Mode"> </argument> <description> </description> </method> <method name="set_show_hidden_files"> + <return type="void"> + </return> <argument index="0" name="show" type="bool"> </argument> <description> @@ -13897,16 +15976,22 @@ </description> </method> <method name="scan"> + <return type="void"> + </return> <description> Scan the filesystem for changes. </description> </method> <method name="scan_sources"> + <return type="void"> + </return> <description> Check if the source of any imported resource changed. </description> </method> <method name="update_file"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> @@ -13920,6 +16005,12 @@ Emitted if the filesystem changed. </description> </signal> + <signal name="resources_reimported"> + <argument index="0" name="resources" type="PoolStringArray"> + </argument> + <description> + </description> + </signal> <signal name="sources_changed"> <argument index="0" name="exist" type="bool"> </argument> @@ -13968,6 +16059,14 @@ <description> </description> </method> + <method name="get_file_import_is_valid" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + </description> + </method> <method name="get_file_path" qualifiers="const"> <return type="String"> </return> @@ -14003,7 +16102,7 @@ </description> </method> <method name="get_subdir"> - <return type="Object"> + <return type="EditorFileSystemDirectory"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -14108,6 +16207,130 @@ <constants> </constants> </class> +<class name="EditorInterface" inherits="Node" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="edit_resource"> + <return type="void"> + </return> + <argument index="0" name="resource" type="Resource"> + </argument> + <description> + </description> + </method> + <method name="get_base_control"> + <return type="Control"> + </return> + <description> + </description> + </method> + <method name="get_edited_scene_root"> + <return type="Node"> + </return> + <description> + </description> + </method> + <method name="get_editor_settings"> + <return type="EditorSettings"> + </return> + <description> + </description> + </method> + <method name="get_editor_viewport"> + <return type="Control"> + </return> + <description> + </description> + </method> + <method name="get_open_scenes" qualifiers="const"> + <return type="Array"> + </return> + <description> + </description> + </method> + <method name="get_resource_filesystem"> + <return type="EditorFileSystem"> + </return> + <description> + </description> + </method> + <method name="get_resource_previewer"> + <return type="EditorResourcePreview"> + </return> + <description> + </description> + </method> + <method name="get_script_editor"> + <return type="ScriptEditor"> + </return> + <description> + </description> + </method> + <method name="get_selection"> + <return type="EditorSelection"> + </return> + <description> + </description> + </method> + <method name="inspect_object"> + <return type="void"> + </return> + <argument index="0" name="object" type="Object"> + </argument> + <argument index="1" name="for_property" type="String" default=""""> + </argument> + <description> + </description> + </method> + <method name="make_mesh_previews"> + <return type="Array"> + </return> + <argument index="0" name="arg0" type="Array"> + </argument> + <argument index="1" name="arg1" type="int"> + </argument> + <description> + </description> + </method> + <method name="open_scene_from_path"> + <return type="void"> + </return> + <argument index="0" name="scene_filepath" type="String"> + </argument> + <description> + </description> + </method> + <method name="reload_scene_from_path"> + <return type="void"> + </return> + <argument index="0" name="scene_filepath" type="String"> + </argument> + <description> + </description> + </method> + <method name="save_scene"> + <return type="int" enum="Error"> + </return> + <description> + </description> + </method> + <method name="save_scene_as"> + <return type="void"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <argument index="1" name="with_preview" type="bool" default="true"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> <class name="EditorPlugin" inherits="Node" category="Core"> <brief_description> Used by the editor to extend its functionality. @@ -14128,7 +16351,9 @@ </description> </method> <method name="add_control_to_container"> - <argument index="0" name="container" type="int"> + <return type="void"> + </return> + <argument index="0" name="container" type="int" enum="EditorPlugin.CustomControlContainer"> </argument> <argument index="1" name="control" type="Control"> </argument> @@ -14139,7 +16364,9 @@ </description> </method> <method name="add_control_to_dock"> - <argument index="0" name="slot" type="int"> + <return type="void"> + </return> + <argument index="0" name="slot" type="int" enum="EditorPlugin.DockSlot"> </argument> <argument index="1" name="control" type="Control"> </argument> @@ -14150,6 +16377,8 @@ </description> </method> <method name="add_custom_type"> + <return type="void"> + </return> <argument index="0" name="type" type="String"> </argument> <argument index="1" name="base" type="String"> @@ -14166,26 +16395,34 @@ </description> </method> <method name="add_import_plugin"> - <argument index="0" name="arg0" type="Object"> + <return type="void"> + </return> + <argument index="0" name="importer" type="EditorImportPlugin"> </argument> <description> </description> </method> <method name="add_tool_submenu_item"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> - <argument index="1" name="submenu" type="PopupMenu"> + <argument index="1" name="submenu" type="Object"> </argument> <description> </description> </method> <method name="apply_changes" qualifiers="virtual"> + <return type="void"> + </return> <description> This method is called when the editor is about to save the project, switch to another tab, etc. It asks the plugin to apply any pending state changes to ensure consistency. This is used, for example, in shader editors to let the plugin know that it must apply the shader code being written by the user to the object. </description> </method> <method name="clear" qualifiers="virtual"> + <return type="void"> + </return> <description> Clear all the state and reset the object being edited to zero. This ensures your plugin does not keep editing a currently existing node, or a node from the wrong scene. </description> @@ -14200,18 +16437,14 @@ </description> </method> <method name="edit" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="object" type="Object"> </argument> <description> This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. </description> </method> - <method name="edit_resource"> - <argument index="0" name="arg0" type="Object"> - </argument> - <description> - </description> - </method> <method name="forward_canvas_gui_input" qualifiers="virtual"> <return type="bool"> </return> @@ -14223,6 +16456,8 @@ </description> </method> <method name="forward_draw_over_canvas" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="canvas_xform" type="Transform2D"> </argument> <argument index="1" name="canvas" type="Control"> @@ -14243,13 +16478,6 @@ If you would like to always gets those input events then additionally use [method set_input_forwarding_always_enabled]. </description> </method> - <method name="get_base_control"> - <return type="Control"> - </return> - <description> - Get a base control where it's safe to place dialogs. Many plugins open dialogs and they need a control as a base to make sure they use the editor icons and theme. - </description> - </method> <method name="get_breakpoints" qualifiers="virtual"> <return type="PoolStringArray"> </return> @@ -14257,67 +16485,16 @@ This is for editors that edit script based objects. You can return a list of breakpoints in the format (script:line), for example: res://path_to_script.gd:25 </description> </method> - <method name="get_editor_settings"> - <return type="EditorSettings"> + <method name="get_editor_interface"> + <return type="EditorInterface"> </return> <description> - Get the general settings for the editor (the same window that appears in the Settings menu). </description> </method> - <method name="get_edited_scene_root"> - <return type="Node"> - </return> - <description> - Returns root node of currently edited scene. - </description> - </method> - <method name="get_editor_viewport"> - <return type="Control"> - </return> - <description> - Get the main editor control. Use this as a parent for main screens. - </description> - </method> - <method name="get_name" qualifiers="virtual"> + <method name="get_plugin_name" qualifiers="virtual"> <return type="String"> </return> <description> - Get the name of the editor plugin. For main scren plugins this is what will appear in the selector (which by default is 2D, 3D, Script). - </description> - </method> - <method name="get_open_scenes"> - <return type="Array"> - </return> - <description> - Will return an Array of Strings which represent file paths to currently open scenes. - </description> - </method> - <method name="get_resource_filesystem"> - <return type="EditorFileSystem"> - </return> - <description> - Get the filesystem cache for all resources in the project. - </description> - </method> - <method name="get_resource_previewer"> - <return type="EditorResourcePreview"> - </return> - <description> - Get tool for generating resource previews. - </description> - </method> - <method name="get_script_editor"> - <return type="ScriptEditor"> - </return> - <description> - Will return ScriptEditor object which contains informations about state of the scripts which are currently open by the editor. - </description> - </method> - <method name="get_selection"> - <return type="EditorSelection"> - </return> - <description> - Get the object that handles the selection of nodes in the Scene Tree editor. </description> </method> <method name="get_state" qualifiers="virtual"> @@ -14335,6 +16512,8 @@ </description> </method> <method name="get_window_layout" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="layout" type="ConfigFile"> </argument> <description> @@ -14358,25 +16537,22 @@ </description> </method> <method name="hide_bottom_panel"> + <return type="void"> + </return> <description> </description> </method> - <method name="inspect_object"> - <argument index="0" name="object" type="Object"> - </argument> - <argument index="1" name="for_property" type="String" default=""""> - </argument> - <description> - Inspect an object in the inspector. - </description> - </method> <method name="make_bottom_panel_item_visible"> + <return type="void"> + </return> <argument index="0" name="item" type="Control"> </argument> <description> </description> </method> <method name="make_visible" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="visible" type="bool"> </argument> <description> @@ -14384,26 +16560,16 @@ Remember that you have to manage the visibility of all your editor controls manually. </description> </method> - <method name="open_scene_from_path"> - <argument index="0" name="scene_filepath" type="String"> - </argument> - <description> - Opens scene in editor. Do not use during plugin initialization. If you need, then use it together with [method Object.call_deferred]. - </description> - </method> <method name="queue_save_layout" qualifiers="const"> + <return type="void"> + </return> <description> Queue save the project's editor layout. </description> </method> - <method name="reload_scene_from_path"> - <argument index="0" name="scene_filepath" type="String"> - </argument> - <description> - Reloads already loaded editor scene. - </description> - </method> <method name="remove_control_from_bottom_panel"> + <return type="void"> + </return> <argument index="0" name="control" type="Control"> </argument> <description> @@ -14411,6 +16577,8 @@ </description> </method> <method name="remove_control_from_docks"> + <return type="void"> + </return> <argument index="0" name="control" type="Control"> </argument> <description> @@ -14418,6 +16586,8 @@ </description> </method> <method name="remove_custom_type"> + <return type="void"> + </return> <argument index="0" name="type" type="String"> </argument> <description> @@ -14425,22 +16595,30 @@ </description> </method> <method name="remove_import_plugin"> - <argument index="0" name="arg0" type="Object"> + <return type="void"> + </return> + <argument index="0" name="importer" type="EditorImportPlugin"> </argument> <description> </description> </method> <method name="save_external_data" qualifiers="virtual"> + <return type="void"> + </return> <description> This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources. </description> </method> <method name="set_input_event_forwarding_always_enabled"> + <return type="void"> + </return> <description> Use this method if you always want to receive inputs from 3D view screen inside [method forward_spatial_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene. </description> </method> <method name="set_state" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="state" type="Dictionary"> </argument> <description> @@ -14448,6 +16626,8 @@ </description> </method> <method name="set_window_layout" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="layout" type="ConfigFile"> </argument> <description> @@ -14455,11 +16635,36 @@ </description> </method> <method name="update_canvas"> + <return type="void"> + </return> <description> Updates the control used to draw the edited scene over the 2D canvas. This is used together with [method forward_canvas_input_event]. </description> </method> </methods> + <signals> + <signal name="main_screen_changed"> + <argument index="0" name="screen_name" type="String"> + </argument> + <description> + Emitted when user change main screen view (2D, 3D, Script, AssetLib). Works also with screens which are defined by plugins. + </description> + </signal> + <signal name="scene_changed"> + <argument index="0" name="scene_root" type="Object"> + </argument> + <description> + Emitted when user change scene. The argument is a root node of freshly opened scene. + </description> + </signal> + <signal name="scene_closed"> + <argument index="0" name="filepath" type="String"> + </argument> + <description> + Emitted when user close scene. The argument is file path to a closed scene. + </description> + </signal> + </signals> <constants> <constant name="CONTAINER_TOOLBAR" value="0"> </constant> @@ -14494,29 +16699,6 @@ <constant name="DOCK_SLOT_MAX" value="8"> </constant> </constants> - <signals> - <signal name="main_screen_changed"> - <argument index="0" name="screen_name" type="String"> - </argument> - <description> - Emitted when user change main screen view (2D, 3D, Script, AssetLib). Works also with screens which are defined by plugins. - </description> - </signal> - <signal name="scene_changed"> - <argument index="0" name="scene_root" type="Node"> - </argument> - <description> - Emitted when user change scene. The argument is a root node of freshly opened scene. - </description> - </signal> - <signal name="scene_closed"> - <argument index="0" name="filepath" type="String"> - </argument> - <description> - Emitted when user close scene. The argument is file path to a closed scene. - </description> - </signal> - </signals> </class> <class name="EditorResourcePreview" inherits="Node" category="Core"> <brief_description> @@ -14527,6 +16709,8 @@ </description> <methods> <method name="add_preview_generator"> + <return type="void"> + </return> <argument index="0" name="generator" type="EditorResourcePreviewGenerator"> </argument> <description> @@ -14534,6 +16718,8 @@ </description> </method> <method name="check_for_invalidation"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> @@ -14541,6 +16727,8 @@ </description> </method> <method name="queue_edited_resource_preview"> + <return type="void"> + </return> <argument index="0" name="resource" type="Resource"> </argument> <argument index="1" name="receiver" type="Object"> @@ -14554,6 +16742,8 @@ </description> </method> <method name="queue_resource_preview"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <argument index="1" name="receiver" type="Object"> @@ -14567,6 +16757,8 @@ </description> </method> <method name="remove_preview_generator"> + <return type="void"> + </return> <argument index="0" name="generator" type="EditorResourcePreviewGenerator"> </argument> <description> @@ -14638,17 +16830,27 @@ </description> <methods> <method name="_run" qualifiers="virtual"> + <return type="void"> + </return> <description> </description> </method> <method name="add_root_node"> - <argument index="0" name="node" type="Object"> + <return type="void"> + </return> + <argument index="0" name="node" type="Node"> </argument> <description> </description> </method> + <method name="get_editor_interface"> + <return type="EditorInterface"> + </return> + <description> + </description> + </method> <method name="get_scene"> - <return type="Object"> + <return type="Node"> </return> <description> </description> @@ -14666,6 +16868,8 @@ </description> <methods> <method name="add_node"> + <return type="void"> + </return> <argument index="0" name="node" type="Node"> </argument> <description> @@ -14673,6 +16877,8 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clear the selection. </description> @@ -14692,6 +16898,8 @@ </description> </method> <method name="remove_node"> + <return type="void"> + </return> <argument index="0" name="node" type="Node"> </argument> <description> @@ -14724,6 +16932,8 @@ </description> <methods> <method name="add_property_info"> + <return type="void"> + </return> <argument index="0" name="info" type="Dictionary"> </argument> <description> @@ -14744,6 +16954,8 @@ </description> </method> <method name="erase"> + <return type="void"> + </return> <argument index="0" name="property" type="String"> </argument> <description> @@ -14761,7 +16973,7 @@ <return type="String"> </return> <description> - Get the specific project settings path. Projects all have an unique sub-directory inside the settings path where project specific settings are saved. + Get the specific project settings path. Projects all have a unique sub-directory inside the settings path where project specific settings are saved. </description> </method> <method name="get_recent_dirs" qualifiers="const"> @@ -14781,6 +16993,8 @@ </description> </method> <method name="set_favorite_dirs"> + <return type="void"> + </return> <argument index="0" name="dirs" type="PoolStringArray"> </argument> <description> @@ -14788,6 +17002,8 @@ </description> </method> <method name="set_recent_dirs"> + <return type="void"> + </return> <argument index="0" name="dirs" type="PoolStringArray"> </argument> <description> @@ -14813,12 +17029,16 @@ </description> <methods> <method name="add_collision_segments"> + <return type="void"> + </return> <argument index="0" name="segments" type="PoolVector3Array"> </argument> <description> </description> </method> <method name="add_collision_triangles"> + <return type="void"> + </return> <argument index="0" name="triangles" type="TriangleMesh"> </argument> <description> @@ -14826,6 +17046,8 @@ </description> </method> <method name="add_handles"> + <return type="void"> + </return> <argument index="0" name="handles" type="PoolVector3Array"> </argument> <argument index="1" name="billboard" type="bool" default="false"> @@ -14838,6 +17060,8 @@ </description> </method> <method name="add_lines"> + <return type="void"> + </return> <argument index="0" name="lines" type="PoolVector3Array"> </argument> <argument index="1" name="material" type="Material"> @@ -14849,17 +17073,20 @@ </description> </method> <method name="add_mesh"> - <argument index="0" name="mesh" type="Mesh"> + <return type="void"> + </return> + <argument index="0" name="mesh" type="ArrayMesh"> </argument> <argument index="1" name="billboard" type="bool" default="false"> </argument> - <argument index="2" name="skeleton" type="RID" default="[RID]"> + <argument index="2" name="skeleton" type="RID"> </argument> <description> - Add a mesh to the gizmo, this is used for visualization. Call this function during [method redraw]. </description> </method> <method name="add_unscaled_billboard"> + <return type="void"> + </return> <argument index="0" name="material" type="Material"> </argument> <argument index="1" name="default_scale" type="float" default="1"> @@ -14869,15 +17096,19 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> </description> </method> <method name="commit_handle" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <argument index="1" name="restore" type="Variant"> </argument> - <argument index="2" name="cancel" type="bool"> + <argument index="2" name="cancel" type="bool" default="false"> </argument> <description> Commit a handle being edited (handles must have been prevously added by [method add_handles]). @@ -14904,11 +17135,15 @@ </description> </method> <method name="redraw" qualifiers="virtual"> + <return type="void"> + </return> <description> This function is called when the Spatial this gizmo refers to changes (the [method Spatial.update_gizmo] is called). </description> </method> <method name="set_handle" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <argument index="1" name="camera" type="Camera"> @@ -14921,10 +17156,35 @@ </description> </method> <method name="set_spatial_node"> - <argument index="0" name="node" type="Spatial"> + <return type="void"> + </return> + <argument index="0" name="node" type="Node"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> +<class name="EncodedObjectAsID" inherits="Reference" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_object_id" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="set_object_id"> + <return type="void"> + </return> + <argument index="0" name="id" type="int"> </argument> <description> - Call this function once and upon creation of the gizmo, otherwise no other function will work. The argument is the node being edited by the gizmo. </description> </method> </methods> @@ -14991,13 +17251,29 @@ "string" - major + minor + patch + status + revision in a single String </description> </method> + <method name="is_editor_hint" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_in_fixed_frame" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> + <method name="set_editor_hint"> + <return type="void"> + </return> + <argument index="0" name="enabled" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_iterations_per_second"> + <return type="void"> + </return> <argument index="0" name="iterations_per_second" type="int"> </argument> <description> @@ -15005,12 +17281,16 @@ </description> </method> <method name="set_target_fps"> + <return type="void"> + </return> <argument index="0" name="target_fps" type="int"> </argument> <description> </description> </method> <method name="set_time_scale"> + <return type="void"> + </return> <argument index="0" name="time_scale" type="float"> </argument> <description> @@ -15033,7 +17313,7 @@ </description> </method> <method name="get_adjustment_color_correction" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> </description> @@ -15069,7 +17349,7 @@ </description> </method> <method name="get_background" qualifiers="const"> - <return type="int"> + <return type="int" enum="Environment.BGMode"> </return> <description> </description> @@ -15105,7 +17385,7 @@ </description> </method> <method name="get_dof_blur_far_quality" qualifiers="const"> - <return type="int"> + <return type="int" enum="Environment.DOFBlurQuality"> </return> <description> </description> @@ -15129,7 +17409,7 @@ </description> </method> <method name="get_dof_blur_near_quality" qualifiers="const"> - <return type="int"> + <return type="int" enum="Environment.DOFBlurQuality"> </return> <description> </description> @@ -15195,7 +17475,7 @@ </description> </method> <method name="get_glow_blend_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Environment.GlowBlendMode"> </return> <description> </description> @@ -15231,7 +17511,7 @@ </description> </method> <method name="get_sky" qualifiers="const"> - <return type="CubeMap"> + <return type="Sky"> </return> <description> </description> @@ -15351,7 +17631,7 @@ </description> </method> <method name="get_tonemapper" qualifiers="const"> - <return type="int"> + <return type="int" enum="Environment.ToneMapper"> </return> <description> </description> @@ -15443,258 +17723,344 @@ </description> </method> <method name="set_adjustment_brightness"> + <return type="void"> + </return> <argument index="0" name="brightness" type="float"> </argument> <description> </description> </method> <method name="set_adjustment_color_correction"> - <argument index="0" name="color_correction" type="Object"> + <return type="void"> + </return> + <argument index="0" name="color_correction" type="Texture"> </argument> <description> </description> </method> <method name="set_adjustment_contrast"> + <return type="void"> + </return> <argument index="0" name="contrast" type="float"> </argument> <description> </description> </method> <method name="set_adjustment_enable"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_adjustment_saturation"> + <return type="void"> + </return> <argument index="0" name="saturation" type="float"> </argument> <description> </description> </method> <method name="set_ambient_light_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_ambient_light_energy"> + <return type="void"> + </return> <argument index="0" name="energy" type="float"> </argument> <description> </description> </method> <method name="set_ambient_light_sky_contribution"> + <return type="void"> + </return> <argument index="0" name="energy" type="float"> </argument> <description> </description> </method> <method name="set_background"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Environment.BGMode"> </argument> <description> </description> </method> <method name="set_bg_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_bg_energy"> + <return type="void"> + </return> <argument index="0" name="energy" type="float"> </argument> <description> </description> </method> <method name="set_canvas_max_layer"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> </description> </method> <method name="set_dof_blur_far_amount"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_dof_blur_far_distance"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_dof_blur_far_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_dof_blur_far_quality"> - <argument index="0" name="intensity" type="int"> + <return type="void"> + </return> + <argument index="0" name="intensity" type="int" enum="Environment.DOFBlurQuality"> </argument> <description> </description> </method> <method name="set_dof_blur_far_transition"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_dof_blur_near_amount"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_dof_blur_near_distance"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_dof_blur_near_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_dof_blur_near_quality"> - <argument index="0" name="level" type="int"> + <return type="void"> + </return> + <argument index="0" name="level" type="int" enum="Environment.DOFBlurQuality"> </argument> <description> </description> </method> <method name="set_dof_blur_near_transition"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_fog_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_fog_depth_begin"> + <return type="void"> + </return> <argument index="0" name="distance" type="float"> </argument> <description> </description> </method> <method name="set_fog_depth_curve"> + <return type="void"> + </return> <argument index="0" name="curve" type="float"> </argument> <description> </description> </method> <method name="set_fog_depth_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_fog_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_fog_height_curve"> + <return type="void"> + </return> <argument index="0" name="curve" type="float"> </argument> <description> </description> </method> <method name="set_fog_height_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_fog_height_max"> + <return type="void"> + </return> <argument index="0" name="height" type="float"> </argument> <description> </description> </method> <method name="set_fog_height_min"> + <return type="void"> + </return> <argument index="0" name="height" type="float"> </argument> <description> </description> </method> <method name="set_fog_sun_amount"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_fog_sun_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_fog_transmit_curve"> + <return type="void"> + </return> <argument index="0" name="curve" type="float"> </argument> <description> </description> </method> <method name="set_fog_transmit_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_glow_bicubic_upscale"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_glow_blend_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Environment.GlowBlendMode"> </argument> <description> </description> </method> <method name="set_glow_bloom"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_glow_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_glow_hdr_bleed_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="float"> </argument> <description> </description> </method> <method name="set_glow_hdr_bleed_threshold"> + <return type="void"> + </return> <argument index="0" name="threshold" type="float"> </argument> <description> </description> </method> <method name="set_glow_intensity"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_glow_level"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="enabled" type="bool"> @@ -15703,157 +18069,209 @@ </description> </method> <method name="set_glow_strength"> + <return type="void"> + </return> <argument index="0" name="strength" type="float"> </argument> <description> </description> </method> <method name="set_sky"> + <return type="void"> + </return> <argument index="0" name="sky" type="Sky"> </argument> <description> </description> </method> <method name="set_sky_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="float"> </argument> <description> </description> </method> <method name="set_ssao_bias"> + <return type="void"> + </return> <argument index="0" name="bias" type="float"> </argument> <description> </description> </method> <method name="set_ssao_blur"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_ssao_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_ssao_direct_light_affect"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_ssao_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_ssao_intensity"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_ssao_intensity2"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_ssao_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> </description> </method> <method name="set_ssao_radius2"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> </description> </method> <method name="set_ssr_depth_tolerance"> + <return type="void"> + </return> <argument index="0" name="depth_tolerance" type="float"> </argument> <description> </description> </method> <method name="set_ssr_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_ssr_fade_in"> + <return type="void"> + </return> <argument index="0" name="fade_in" type="float"> </argument> <description> </description> </method> <method name="set_ssr_fade_out"> + <return type="void"> + </return> <argument index="0" name="fade_out" type="float"> </argument> <description> </description> </method> <method name="set_ssr_max_steps"> + <return type="void"> + </return> <argument index="0" name="max_steps" type="int"> </argument> <description> </description> </method> <method name="set_ssr_rough"> + <return type="void"> + </return> <argument index="0" name="rough" type="bool"> </argument> <description> </description> </method> <method name="set_tonemap_auto_exposure"> + <return type="void"> + </return> <argument index="0" name="auto_exposure" type="bool"> </argument> <description> </description> </method> <method name="set_tonemap_auto_exposure_grey"> + <return type="void"> + </return> <argument index="0" name="exposure_grey" type="float"> </argument> <description> </description> </method> <method name="set_tonemap_auto_exposure_max"> + <return type="void"> + </return> <argument index="0" name="exposure_max" type="float"> </argument> <description> </description> </method> <method name="set_tonemap_auto_exposure_min"> + <return type="void"> + </return> <argument index="0" name="exposure_min" type="float"> </argument> <description> </description> </method> <method name="set_tonemap_auto_exposure_speed"> + <return type="void"> + </return> <argument index="0" name="exposure_speed" type="float"> </argument> <description> </description> </method> <method name="set_tonemap_exposure"> + <return type="void"> + </return> <argument index="0" name="exposure" type="float"> </argument> <description> </description> </method> <method name="set_tonemap_white"> + <return type="void"> + </return> <argument index="0" name="white" type="float"> </argument> <description> </description> </method> <method name="set_tonemapper"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Environment.ToneMapper"> </argument> <description> </description> @@ -15892,7 +18310,7 @@ </member> <member name="background_energy" type="float" setter="set_bg_energy" getter="get_bg_energy" brief=""> </member> - <member name="background_mode" type="int" setter="set_background" getter="get_background" brief=""> + <member name="background_mode" type="int" setter="set_background" getter="get_background" brief="" enum="Environment.BGMode"> </member> <member name="background_sky" type="Sky" setter="set_sky" getter="get_sky" brief=""> </member> @@ -15904,7 +18322,7 @@ </member> <member name="dof_blur_far_enabled" type="bool" setter="set_dof_blur_far_enabled" getter="is_dof_blur_far_enabled" brief=""> </member> - <member name="dof_blur_far_quality" type="int" setter="set_dof_blur_far_quality" getter="get_dof_blur_far_quality" brief=""> + <member name="dof_blur_far_quality" type="int" setter="set_dof_blur_far_quality" getter="get_dof_blur_far_quality" brief="" enum="Environment.DOFBlurQuality"> </member> <member name="dof_blur_far_transition" type="float" setter="set_dof_blur_far_transition" getter="get_dof_blur_far_transition" brief=""> </member> @@ -15914,7 +18332,7 @@ </member> <member name="dof_blur_near_enabled" type="bool" setter="set_dof_blur_near_enabled" getter="is_dof_blur_near_enabled" brief=""> </member> - <member name="dof_blur_near_quality" type="int" setter="set_dof_blur_near_quality" getter="get_dof_blur_near_quality" brief=""> + <member name="dof_blur_near_quality" type="int" setter="set_dof_blur_near_quality" getter="get_dof_blur_near_quality" brief="" enum="Environment.DOFBlurQuality"> </member> <member name="dof_blur_near_transition" type="float" setter="set_dof_blur_near_transition" getter="get_dof_blur_near_transition" brief=""> </member> @@ -15946,7 +18364,7 @@ </member> <member name="glow_bicubic_upscale" type="bool" setter="set_glow_bicubic_upscale" getter="is_glow_bicubic_upscale_enabled" brief=""> </member> - <member name="glow_blend_mode" type="int" setter="set_glow_blend_mode" getter="get_glow_blend_mode" brief=""> + <member name="glow_blend_mode" type="int" setter="set_glow_blend_mode" getter="get_glow_blend_mode" brief="" enum="Environment.GlowBlendMode"> </member> <member name="glow_bloom" type="float" setter="set_glow_bloom" getter="get_glow_bloom" brief=""> </member> @@ -16006,7 +18424,7 @@ </member> <member name="tonemap_exposure" type="float" setter="set_tonemap_exposure" getter="get_tonemap_exposure" brief=""> </member> - <member name="tonemap_mode" type="int" setter="set_tonemapper" getter="get_tonemapper" brief=""> + <member name="tonemap_mode" type="int" setter="set_tonemapper" getter="get_tonemapper" brief="" enum="Environment.ToneMapper"> </member> <member name="tonemap_white" type="float" setter="set_tonemap_white" getter="get_tonemap_white" brief=""> </member> @@ -16072,6 +18490,8 @@ </description> <methods> <method name="close"> + <return type="void"> + </return> <description> Close the currently opened file. </description> @@ -16160,7 +18580,7 @@ </description> </method> <method name="get_error" qualifiers="const"> - <return type="Error"> + <return type="int" enum="Error"> </return> <description> Get the last error that happened when trying to perform operations. Compare with the [code]ERR_FILE_*[/code] constants from [@Global Scope]. @@ -16235,6 +18655,8 @@ </description> </method> <method name="get_var" qualifiers="const"> + <return type="Variant"> + </return> <description> Get the next Variant value from the file. </description> @@ -16247,7 +18669,7 @@ </description> </method> <method name="open"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -16258,7 +18680,7 @@ </description> </method> <method name="open_compressed"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -16271,7 +18693,7 @@ </description> </method> <method name="open_encrypted"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -16284,7 +18706,7 @@ </description> </method> <method name="open_encrypted_with_pass"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -16297,6 +18719,8 @@ </description> </method> <method name="seek"> + <return type="void"> + </return> <argument index="0" name="pos" type="int"> </argument> <description> @@ -16304,6 +18728,8 @@ </description> </method> <method name="seek_end"> + <return type="void"> + </return> <argument index="0" name="pos" type="int" default="0"> </argument> <description> @@ -16311,6 +18737,8 @@ </description> </method> <method name="set_endian_swap"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -16319,6 +18747,8 @@ </description> </method> <method name="store_16"> + <return type="void"> + </return> <argument index="0" name="value" type="int"> </argument> <description> @@ -16326,6 +18756,8 @@ </description> </method> <method name="store_32"> + <return type="void"> + </return> <argument index="0" name="value" type="int"> </argument> <description> @@ -16333,6 +18765,8 @@ </description> </method> <method name="store_64"> + <return type="void"> + </return> <argument index="0" name="value" type="int"> </argument> <description> @@ -16340,6 +18774,8 @@ </description> </method> <method name="store_8"> + <return type="void"> + </return> <argument index="0" name="value" type="int"> </argument> <description> @@ -16347,6 +18783,8 @@ </description> </method> <method name="store_buffer"> + <return type="void"> + </return> <argument index="0" name="buffer" type="PoolByteArray"> </argument> <description> @@ -16354,6 +18792,8 @@ </description> </method> <method name="store_double"> + <return type="void"> + </return> <argument index="0" name="value" type="float"> </argument> <description> @@ -16361,6 +18801,8 @@ </description> </method> <method name="store_float"> + <return type="void"> + </return> <argument index="0" name="value" type="float"> </argument> <description> @@ -16368,6 +18810,8 @@ </description> </method> <method name="store_line"> + <return type="void"> + </return> <argument index="0" name="line" type="String"> </argument> <description> @@ -16375,6 +18819,8 @@ </description> </method> <method name="store_pascal_string"> + <return type="void"> + </return> <argument index="0" name="string" type="String"> </argument> <description> @@ -16382,6 +18828,8 @@ </description> </method> <method name="store_real"> + <return type="void"> + </return> <argument index="0" name="value" type="float"> </argument> <description> @@ -16389,6 +18837,8 @@ </description> </method> <method name="store_string"> + <return type="void"> + </return> <argument index="0" name="string" type="String"> </argument> <description> @@ -16396,6 +18846,8 @@ </description> </method> <method name="store_var"> + <return type="void"> + </return> <argument index="0" name="value" type="Variant"> </argument> <description> @@ -16438,6 +18890,8 @@ </description> <methods> <method name="add_filter"> + <return type="void"> + </return> <argument index="0" name="filter" type="String"> </argument> <description> @@ -16445,12 +18899,14 @@ </description> </method> <method name="clear_filters"> + <return type="void"> + </return> <description> Clear all the added filters in the dialog. </description> </method> <method name="get_access" qualifiers="const"> - <return type="int"> + <return type="int" enum="FileDialog.Access"> </return> <description> Return the file access permission of the dialog. @@ -16484,7 +18940,7 @@ </description> </method> <method name="get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="FileDialog.Mode"> </return> <description> Get the file dialog mode from the MODE_* enum. @@ -16498,6 +18954,8 @@ </description> </method> <method name="invalidate"> + <return type="void"> + </return> <description> Invalidate and update the current dialog content list. </description> @@ -16510,13 +18968,17 @@ </description> </method> <method name="set_access"> - <argument index="0" name="access" type="int"> + <return type="void"> + </return> + <argument index="0" name="access" type="int" enum="FileDialog.Access"> </argument> <description> Set the file access permission of the dialog(Must be one of [ACCESS_RESOURCES], [ACCESS_USERDATA] or [ACCESS_FILESYSTEM]). </description> </method> <method name="set_current_dir"> + <return type="void"> + </return> <argument index="0" name="dir" type="String"> </argument> <description> @@ -16524,6 +18986,8 @@ </description> </method> <method name="set_current_file"> + <return type="void"> + </return> <argument index="0" name="file" type="String"> </argument> <description> @@ -16531,6 +18995,8 @@ </description> </method> <method name="set_current_path"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> @@ -16538,19 +19004,25 @@ </description> </method> <method name="set_filters"> + <return type="void"> + </return> <argument index="0" name="filters" type="PoolStringArray"> </argument> <description> </description> </method> <method name="set_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="FileDialog.Mode"> </argument> <description> Set the file dialog mode from the MODE_* enum. </description> </method> <method name="set_show_hidden_files"> + <return type="void"> + </return> <argument index="0" name="show" type="bool"> </argument> <description> @@ -16559,11 +19031,11 @@ </method> </methods> <members> - <member name="access" type="int" setter="set_access" getter="get_access" brief=""> + <member name="access" type="int" setter="set_access" getter="get_access" brief="" enum="FileDialog.Access"> </member> <member name="filters" type="PoolStringArray" setter="set_filters" getter="get_filters" brief=""> </member> - <member name="mode" type="int" setter="set_mode" getter="get_mode" brief=""> + <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="" enum="FileDialog.Mode"> </member> <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files" brief=""> </member> @@ -16631,17 +19103,19 @@ Internationalized font and text drawing support. </brief_description> <description> - Font contains an unicode compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. TODO check wikipedia for graph of ascent/baseline/descent/height/etc. + Font contains a unicode compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. TODO check wikipedia for graph of ascent/baseline/descent/height/etc. </description> <methods> <method name="draw" qualifiers="const"> + <return type="void"> + </return> <argument index="0" name="canvas_item" type="RID"> </argument> <argument index="1" name="pos" type="Vector2"> </argument> <argument index="2" name="string" type="String"> </argument> - <argument index="3" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <argument index="4" name="clip_w" type="int" default="-1"> </argument> @@ -16660,7 +19134,7 @@ </argument> <argument index="3" name="next" type="int" default="-1"> </argument> - <argument index="4" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <description> Draw character "char" into a canvas item using the font at a given "pos" position, with "modulate" color, and optionally kerning if "next" is passed. clipping the width. "pos" specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character. @@ -16703,6 +19177,8 @@ </description> </method> <method name="update_changes"> + <return type="void"> + </return> <description> After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it. </description> @@ -16727,6 +19203,8 @@ </description> </method> <method name="set_function"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -16734,6 +19212,8 @@ </description> </method> <method name="set_instance"> + <return type="void"> + </return> <argument index="0" name="instance" type="Object"> </argument> <description> @@ -16765,7 +19245,7 @@ <method name="resume"> <return type="Variant"> </return> - <argument index="0" name="arg" type="Variant" default="NULL"> + <argument index="0" name="arg" type="Variant" default="null"> </argument> <description> Resume execution of the yielded function call. @@ -16785,39 +19265,67 @@ <constants> </constants> </class> -<class name="GDNativeClass" inherits="Reference" category="Core"> +<class name="GDNative" inherits="Reference" category="Core"> <brief_description> </brief_description> <description> </description> <methods> - <method name="new"> + <method name="call_native"> + <return type="Variant"> + </return> + <argument index="0" name="procedure_name" type="String"> + </argument> + <argument index="1" name="arguments" type="String"> + </argument> + <argument index="2" name="arg2" type="Array"> + </argument> + <description> + </description> + </method> + <method name="get_library"> + <return type="GDNativeLibrary"> + </return> + <description> + </description> + </method> + <method name="initialize"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="set_library"> + <return type="void"> + </return> + <argument index="0" name="library" type="GDNativeLibrary"> + </argument> + <description> + </description> + </method> + <method name="terminate"> + <return type="bool"> + </return> <description> </description> </method> </methods> + <members> + <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library" brief=""> + </member> + </members> <constants> </constants> </class> -<class name="GDNativeLibrary" inherits="Resource" category="Core"> +<class name="GDNativeClass" inherits="Reference" category="Core"> <brief_description> </brief_description> <description> </description> <methods> - <method name="get_platform_file" qualifiers="const"> - <return type="String"> + <method name="new"> + <return type="Variant"> </return> - <argument index="0" name="platform" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_platform_file"> - <argument index="0" name="platform" type="String"> - </argument> - <argument index="1" name="file" type="String"> - </argument> <description> </description> </method> @@ -16825,47 +19333,47 @@ <constants> </constants> </class> -<class name="GDNativeScript" inherits="Script" category="Core"> +<class name="GDNativeLibrary" inherits="Resource" category="Core"> <brief_description> </brief_description> <description> </description> <methods> - <method name="get_library" qualifiers="const"> - <return type="Object"> - </return> - <description> - </description> - </method> - <method name="get_script_name" qualifiers="const"> + <method name="get_library_path" qualifiers="const"> <return type="String"> </return> + <argument index="0" name="platform" type="String"> + </argument> <description> </description> </method> - <method name="new" qualifiers="vararg"> - <return type="Object"> + <method name="is_singleton_gdnative" qualifiers="const"> + <return type="bool"> </return> <description> </description> </method> - <method name="set_library"> - <argument index="0" name="library" type="Object"> + <method name="set_library_path"> + <return type="void"> + </return> + <argument index="0" name="platform" type="String"> + </argument> + <argument index="1" name="path" type="String"> </argument> <description> </description> </method> - <method name="set_script_name"> - <argument index="0" name="script_name" type="String"> + <method name="set_singleton_gdnative"> + <return type="void"> + </return> + <argument index="0" name="singleton" type="bool"> </argument> <description> </description> </method> </methods> <members> - <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library" brief=""> - </member> - <member name="script_name" type="String" setter="set_script_name" getter="get_script_name" brief=""> + <member name="singleton_gdnative" type="bool" setter="set_singleton_gdnative" getter="is_singleton_gdnative" brief=""> </member> </members> <constants> @@ -16873,20 +19381,31 @@ </class> <class name="GDScript" inherits="Script" category="Core"> <brief_description> + A script implemented in the GDScript programming language. </brief_description> <description> + A script implemented in the GDScript programming language. The script exends the functionality of all objects that instance it. + [method new] creates a new instance of the script. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> <methods> <method name="get_as_byte_code" qualifiers="const"> <return type="PoolByteArray"> </return> <description> + Returns byte code for the script source code. </description> </method> <method name="new" qualifiers="vararg"> <return type="Object"> </return> <description> + Returns a new instance of the script. + For example: + [codeblock] + var MyClass = load("myclass.gd") + var instance = MyClass.new() + assert(instance.get_script() == MyClass) + [/codeblock] </description> </method> </methods> @@ -16900,7 +19419,9 @@ </description> <methods> <method name="bake"> - <argument index="0" name="from_node" type="Object" default="NULL"> + <return type="void"> + </return> + <argument index="0" name="from_node" type="Node" default="null"> </argument> <argument index="1" name="create_visual_debug" type="bool" default="false"> </argument> @@ -16908,6 +19429,8 @@ </description> </method> <method name="debug_bake"> + <return type="void"> + </return> <description> </description> </method> @@ -16942,7 +19465,7 @@ </description> </method> <method name="get_probe_data" qualifiers="const"> - <return type="Object"> + <return type="GIProbeData"> </return> <description> </description> @@ -16954,7 +19477,7 @@ </description> </method> <method name="get_subdiv" qualifiers="const"> - <return type="int"> + <return type="int" enum="GIProbe.Subdiv"> </return> <description> </description> @@ -16972,61 +19495,81 @@ </description> </method> <method name="set_bias"> + <return type="void"> + </return> <argument index="0" name="max" type="float"> </argument> <description> </description> </method> <method name="set_compress"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_dynamic_range"> + <return type="void"> + </return> <argument index="0" name="max" type="int"> </argument> <description> </description> </method> <method name="set_energy"> + <return type="void"> + </return> <argument index="0" name="max" type="float"> </argument> <description> </description> </method> <method name="set_extents"> + <return type="void"> + </return> <argument index="0" name="extents" type="Vector3"> </argument> <description> </description> </method> <method name="set_interior"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_normal_bias"> + <return type="void"> + </return> <argument index="0" name="max" type="float"> </argument> <description> </description> </method> <method name="set_probe_data"> - <argument index="0" name="data" type="Object"> + <return type="void"> + </return> + <argument index="0" name="data" type="GIProbeData"> </argument> <description> </description> </method> <method name="set_propagation"> + <return type="void"> + </return> <argument index="0" name="max" type="float"> </argument> <description> </description> </method> <method name="set_subdiv"> - <argument index="0" name="subdiv" type="int"> + <return type="void"> + </return> + <argument index="0" name="subdiv" type="int" enum="GIProbe.Subdiv"> </argument> <description> </description> @@ -17051,7 +19594,7 @@ </member> <member name="propagation" type="float" setter="set_propagation" getter="get_propagation" brief=""> </member> - <member name="subdiv" type="int" setter="set_subdiv" getter="get_subdiv" brief=""> + <member name="subdiv" type="int" setter="set_subdiv" getter="get_subdiv" brief="" enum="GIProbe.Subdiv"> </member> </members> <constants> @@ -17138,66 +19681,88 @@ </description> </method> <method name="set_bias"> + <return type="void"> + </return> <argument index="0" name="bias" type="float"> </argument> <description> </description> </method> <method name="set_bounds"> + <return type="void"> + </return> <argument index="0" name="bounds" type="Rect3"> </argument> <description> </description> </method> <method name="set_cell_size"> + <return type="void"> + </return> <argument index="0" name="cell_size" type="float"> </argument> <description> </description> </method> <method name="set_compress"> + <return type="void"> + </return> <argument index="0" name="compress" type="bool"> </argument> <description> </description> </method> <method name="set_dynamic_data"> + <return type="void"> + </return> <argument index="0" name="dynamic_data" type="PoolIntArray"> </argument> <description> </description> </method> <method name="set_dynamic_range"> + <return type="void"> + </return> <argument index="0" name="dynamic_range" type="int"> </argument> <description> </description> </method> <method name="set_energy"> + <return type="void"> + </return> <argument index="0" name="energy" type="float"> </argument> <description> </description> </method> <method name="set_interior"> + <return type="void"> + </return> <argument index="0" name="interior" type="bool"> </argument> <description> </description> </method> <method name="set_normal_bias"> + <return type="void"> + </return> <argument index="0" name="bias" type="float"> </argument> <description> </description> </method> <method name="set_propagation"> + <return type="void"> + </return> <argument index="0" name="propagation" type="float"> </argument> <description> </description> </method> <method name="set_to_cell_xform"> + <return type="void"> + </return> <argument index="0" name="to_cell_xform" type="Transform"> </argument> <description> @@ -17240,7 +19805,7 @@ <method name="get_flag_x" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="flag" type="int"> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> </argument> <description> </description> @@ -17248,7 +19813,7 @@ <method name="get_flag_y" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="flag" type="int"> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> </argument> <description> </description> @@ -17256,7 +19821,7 @@ <method name="get_flag_z" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="flag" type="int"> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> </argument> <description> </description> @@ -17264,7 +19829,7 @@ <method name="get_param_x" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> </argument> <description> </description> @@ -17272,7 +19837,7 @@ <method name="get_param_y" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> </argument> <description> </description> @@ -17280,13 +19845,15 @@ <method name="get_param_z" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> </argument> <description> </description> </method> <method name="set_flag_x"> - <argument index="0" name="flag" type="int"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> </argument> <argument index="1" name="value" type="bool"> </argument> @@ -17294,7 +19861,9 @@ </description> </method> <method name="set_flag_y"> - <argument index="0" name="flag" type="int"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> </argument> <argument index="1" name="value" type="bool"> </argument> @@ -17302,7 +19871,9 @@ </description> </method> <method name="set_flag_z"> - <argument index="0" name="flag" type="int"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="Generic6DOFJoint.Flag"> </argument> <argument index="1" name="value" type="bool"> </argument> @@ -17310,7 +19881,9 @@ </description> </method> <method name="set_param_x"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -17318,7 +19891,9 @@ </description> </method> <method name="set_param_y"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -17326,7 +19901,9 @@ </description> </method> <method name="set_param_z"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="Generic6DOFJoint.Param"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -17504,7 +20081,7 @@ </argument> <argument index="3" name="lats" type="int"> </argument> - <argument index="4" name="axis" type="int" default="2"> + <argument index="4" name="axis" type="int" enum="Vector3.Axis" default="2"> </argument> <description> </description> @@ -17518,7 +20095,7 @@ </argument> <argument index="2" name="sides" type="int"> </argument> - <argument index="3" name="axis" type="int" default="2"> + <argument index="3" name="axis" type="int" enum="Vector3.Axis" default="2"> </argument> <description> </description> @@ -17630,6 +20207,8 @@ </description> </method> <method name="ray_intersects_triangle"> + <return type="Variant"> + </return> <argument index="0" name="from" type="Vector3"> </argument> <argument index="1" name="dir" type="Vector3"> @@ -17684,6 +20263,8 @@ </description> </method> <method name="segment_intersects_segment_2d"> + <return type="Variant"> + </return> <argument index="0" name="from_a" type="Vector2"> </argument> <argument index="1" name="to_a" type="Vector2"> @@ -17710,6 +20291,8 @@ </description> </method> <method name="segment_intersects_triangle"> + <return type="Variant"> + </return> <argument index="0" name="from" type="Vector3"> </argument> <argument index="1" name="to" type="Vector3"> @@ -17744,7 +20327,7 @@ </description> <methods> <method name="get_cast_shadows_setting" qualifiers="const"> - <return type="int"> + <return type="int" enum="GeometryInstance.ShadowCastingSetting"> </return> <description> </description> @@ -17758,7 +20341,7 @@ <method name="get_flag" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="flag" type="int"> + <argument index="0" name="flag" type="int" enum="GeometryInstance.Flags"> </argument> <description> </description> @@ -17788,26 +20371,32 @@ </description> </method> <method name="get_material_override" qualifiers="const"> - <return type="Object"> + <return type="Material"> </return> <description> Return the material override for the whole geometry. </description> </method> <method name="set_cast_shadows_setting"> - <argument index="0" name="shadow_casting_setting" type="int"> + <return type="void"> + </return> + <argument index="0" name="shadow_casting_setting" type="int" enum="GeometryInstance.ShadowCastingSetting"> </argument> <description> </description> </method> <method name="set_extra_cull_margin"> + <return type="void"> + </return> <argument index="0" name="margin" type="float"> </argument> <description> </description> </method> <method name="set_flag"> - <argument index="0" name="flag" type="int"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="GeometryInstance.Flags"> </argument> <argument index="1" name="value" type="bool"> </argument> @@ -17815,31 +20404,41 @@ </description> </method> <method name="set_lod_max_distance"> + <return type="void"> + </return> <argument index="0" name="mode" type="float"> </argument> <description> </description> </method> <method name="set_lod_max_hysteresis"> + <return type="void"> + </return> <argument index="0" name="mode" type="float"> </argument> <description> </description> </method> <method name="set_lod_min_distance"> + <return type="void"> + </return> <argument index="0" name="mode" type="float"> </argument> <description> </description> </method> <method name="set_lod_min_hysteresis"> + <return type="void"> + </return> <argument index="0" name="mode" type="float"> </argument> <description> </description> </method> <method name="set_material_override"> - <argument index="0" name="material" type="Object"> + <return type="void"> + </return> + <argument index="0" name="material" type="Material"> </argument> <description> Set the material override for the whole geometry. @@ -17847,188 +20446,36 @@ </method> </methods> <members> - <member name="cast_shadow" type="int" setter="set_cast_shadows_setting" getter="get_cast_shadows_setting" brief=""> + <member name="cast_shadow" type="int" setter="set_cast_shadows_setting" getter="get_cast_shadows_setting" brief="" enum="GeometryInstance.ShadowCastingSetting"> </member> <member name="extra_cull_margin" type="float" setter="set_extra_cull_margin" getter="get_extra_cull_margin" brief=""> </member> - <member name="lod_max_distance" type="int" setter="set_lod_max_distance" getter="get_lod_max_distance" brief=""> + <member name="lod_max_distance" type="float" setter="set_lod_max_distance" getter="get_lod_max_distance" brief=""> </member> - <member name="lod_max_hysteresis" type="int" setter="set_lod_max_hysteresis" getter="get_lod_max_hysteresis" brief=""> + <member name="lod_max_hysteresis" type="float" setter="set_lod_max_hysteresis" getter="get_lod_max_hysteresis" brief=""> </member> - <member name="lod_min_distance" type="int" setter="set_lod_min_distance" getter="get_lod_min_distance" brief=""> + <member name="lod_min_distance" type="float" setter="set_lod_min_distance" getter="get_lod_min_distance" brief=""> </member> - <member name="lod_min_hysteresis" type="int" setter="set_lod_min_hysteresis" getter="get_lod_min_hysteresis" brief=""> + <member name="lod_min_hysteresis" type="float" setter="set_lod_min_hysteresis" getter="get_lod_min_hysteresis" brief=""> </member> - <member name="material_override" type="ShaderMaterial,SpatialMaterial" setter="set_material_override" getter="get_material_override" brief=""> + <member name="material_override" type="Material" setter="set_material_override" getter="get_material_override" brief=""> </member> <member name="use_in_baked_light" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> - <member name="visible_in_all_rooms" type="bool" setter="set_flag" getter="get_flag" brief=""> - </member> </members> <constants> - <constant name="FLAG_CAST_SHADOW" value="0"> - </constant> - <constant name="FLAG_VISIBLE_IN_ALL_ROOMS" value="1"> + <constant name="FLAG_MAX" value="1" enum=""> </constant> - <constant name="FLAG_MAX" value="3"> - </constant> - <constant name="SHADOW_CASTING_SETTING_OFF" value="0"> + <constant name="SHADOW_CASTING_SETTING_OFF" value="0" enum=""> </constant> - <constant name="SHADOW_CASTING_SETTING_ON" value="1"> + <constant name="SHADOW_CASTING_SETTING_ON" value="1" enum=""> </constant> - <constant name="SHADOW_CASTING_SETTING_DOUBLE_SIDED" value="2"> + <constant name="SHADOW_CASTING_SETTING_DOUBLE_SIDED" value="2" enum=""> </constant> - <constant name="SHADOW_CASTING_SETTING_SHADOWS_ONLY" value="3"> + <constant name="SHADOW_CASTING_SETTING_SHADOWS_ONLY" value="3" enum=""> </constant> </constants> </class> -<class name="ProjectSettings" inherits="Object" category="Core"> - <brief_description> - Contains global variables accessible from everywhere. - </brief_description> - <description> - Contains global variables accessible from everywhere. Use the normal [Object] API, such as "ProjectSettings.get(variable)", "ProjectSettings.set(variable,value)" or "ProjectSettings.has(variable)" to access them. Variables stored in project.godot are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options. - </description> - <methods> - <method name="add_property_info"> - <argument index="0" name="hint" type="Dictionary"> - </argument> - <description> - Add a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see TYPE_* in [@Global Scope]), and optionally hint:[int](see PROPERTY_HINT_* in [@Global Scope]), hint_string:[String]. - Example: - [codeblock] - ProjectSettings.set("category/property_name", 0) - - var property_info = { - "name": "category/property_name", - "type": TYPE_INT, - "hint": PROPERTY_HINT_ENUM, - "hint_string": "one,two,three" - } - - ProjectSettings.add_property_info(property_info) - [/codeblock] - </description> - </method> - <method name="clear"> - <argument index="0" name="name" type="String"> - </argument> - <description> - Clear the whole configuration (not recommended, may break things). - </description> - </method> - <method name="get_order" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - Return the order of a configuration value (influences when saved to the config file). - </description> - </method> - <method name="get_singleton" qualifiers="const"> - <return type="Object"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> - <method name="globalize_path" qualifiers="const"> - <return type="String"> - </return> - <argument index="0" name="path" type="String"> - </argument> - <description> - Convert a localized path (res://) to a full native OS path. - </description> - </method> - <method name="has" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - Return true if a configuration value is present. - </description> - </method> - <method name="has_singleton" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> - <method name="load_resource_pack"> - <return type="bool"> - </return> - <argument index="0" name="pack" type="String"> - </argument> - <description> - </description> - </method> - <method name="localize_path" qualifiers="const"> - <return type="String"> - </return> - <argument index="0" name="path" type="String"> - </argument> - <description> - Convert a path to a localized path (res:// path). - </description> - </method> - <method name="property_can_revert"> - <return type="bool"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> - <method name="property_get_revert"> - <return type="Variant"> - </return> - <argument index="0" name="name" type="String"> - </argument> - <description> - </description> - </method> - <method name="save"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="save_custom"> - <return type="int"> - </return> - <argument index="0" name="file" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_initial_value"> - <argument index="0" name="name" type="String"> - </argument> - <argument index="1" name="value" type="Variant"> - </argument> - <description> - </description> - </method> - <method name="set_order"> - <argument index="0" name="name" type="String"> - </argument> - <argument index="1" name="pos" type="int"> - </argument> - <description> - Set the order of a configuration value (influences when saved to the config file). - </description> - </method> - </methods> - <constants> - </constants> -</class> <class name="Gradient" inherits="Resource" category="Core"> <brief_description> Color interpolator node @@ -18038,6 +20485,8 @@ </description> <methods> <method name="add_point"> + <return type="void"> + </return> <argument index="0" name="offset" type="float"> </argument> <argument index="1" name="color" type="Color"> @@ -18095,6 +20544,8 @@ </description> </method> <method name="remove_point"> + <return type="void"> + </return> <argument index="0" name="offset" type="int"> </argument> <description> @@ -18102,6 +20553,8 @@ </description> </method> <method name="set_color"> + <return type="void"> + </return> <argument index="0" name="point" type="int"> </argument> <argument index="1" name="color" type="Color"> @@ -18111,6 +20564,8 @@ </description> </method> <method name="set_colors"> + <return type="void"> + </return> <argument index="0" name="colors" type="PoolColorArray"> </argument> <description> @@ -18118,6 +20573,8 @@ </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="point" type="int"> </argument> <argument index="1" name="offset" type="float"> @@ -18127,6 +20584,8 @@ </description> </method> <method name="set_offsets"> + <return type="void"> + </return> <argument index="0" name="offsets" type="PoolRealArray"> </argument> <description> @@ -18135,9 +20594,9 @@ </method> </methods> <members> - <member name="colors" type="float" setter="set_colors" getter="get_colors" brief=""> + <member name="colors" type="PoolColorArray" setter="set_colors" getter="get_colors" brief=""> </member> - <member name="offsets" type="float" setter="set_offsets" getter="get_offsets" brief=""> + <member name="offsets" type="PoolRealArray" setter="set_offsets" getter="get_offsets" brief=""> </member> </members> <constants> @@ -18145,8 +20604,10 @@ </class> <class name="GradientTexture" inherits="Texture" category="Core"> <brief_description> + Gradient filled texture. </brief_description> <description> + Uses a [Gradient] to fill the texture data, the gradient will be filled from left to right using colors obtained from the gradient, this means that the texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see [method set_width]). </description> <methods> <method name="get_gradient" qualifiers="const"> @@ -18156,12 +20617,16 @@ </description> </method> <method name="set_gradient"> + <return type="void"> + </return> <argument index="0" name="gradient" type="Gradient"> </argument> <description> </description> </method> <method name="set_width"> + <return type="void"> + </return> <argument index="0" name="width" type="int"> </argument> <description> @@ -18170,8 +20635,10 @@ </methods> <members> <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" brief=""> + The [Gradient] that will be used to fill the texture. </member> <member name="width" type="int" setter="set_width" getter="get_width" brief=""> + The number of color samples that will be obtained from the [Gradient]. </member> </members> <constants> @@ -18182,12 +20649,12 @@ GraphEdit is an area capable of showing various GraphNodes. It manages connection events between them. </brief_description> <description> - GraphEdit manages the showing of GraphNodes it contains, as well as connections an disconnections between them. Signals are sent for each of these two events. Disconnection between GraphNodes slots is disabled by default. + GraphEdit manages the showing of GraphNodes it contains, as well as connections and disconnections between them. Signals are sent for each of these two events. Disconnection between GraphNodes slots is disabled by default. It is greatly advised to enable low processor usage mode (see [method OS.set_low_processor_usage_mode]) when using GraphEdits. </description> <methods> <method name="connect_node"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="from" type="String"> </argument> @@ -18202,6 +20669,8 @@ </description> </method> <method name="disconnect_node"> + <return type="void"> + </return> <argument index="0" name="from" type="String"> </argument> <argument index="1" name="from_port" type="int"> @@ -18270,6 +20739,8 @@ </description> </method> <method name="set_right_disconnects"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -18277,30 +20748,40 @@ </description> </method> <method name="set_scroll_ofs"> + <return type="void"> + </return> <argument index="0" name="ofs" type="Vector2"> </argument> <description> </description> </method> <method name="set_selected"> - <argument index="0" name="node" type="Object"> + <return type="void"> + </return> + <argument index="0" name="node" type="Node"> </argument> <description> </description> </method> <method name="set_snap"> + <return type="void"> + </return> <argument index="0" name="pixels" type="int"> </argument> <description> </description> </method> <method name="set_use_snap"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_zoom"> + <return type="void"> + </return> <argument index="0" name="p_zoom" type="float"> </argument> <description> @@ -18417,11 +20898,15 @@ </description> <methods> <method name="clear_all_slots"> + <return type="void"> + </return> <description> Disable all input and output slots of the GraphNode. </description> </method> <method name="clear_slot"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -18504,7 +20989,7 @@ </description> </method> <method name="get_overlay" qualifiers="const"> - <return type="int"> + <return type="int" enum="GraphNode.Overlay"> </return> <description> </description> @@ -18565,7 +21050,7 @@ <description> </description> </method> - <method name="is_resizeable" qualifiers="const"> + <method name="is_resizable" qualifiers="const"> <return type="bool"> </return> <description> @@ -18596,12 +21081,16 @@ </description> </method> <method name="set_comment"> + <return type="void"> + </return> <argument index="0" name="comment" type="bool"> </argument> <description> </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> @@ -18609,24 +21098,32 @@ </description> </method> <method name="set_overlay"> - <argument index="0" name="overlay" type="int"> + <return type="void"> + </return> + <argument index="0" name="overlay" type="int" enum="GraphNode.Overlay"> </argument> <description> </description> </method> - <method name="set_resizeable"> - <argument index="0" name="resizeable" type="bool"> + <method name="set_resizable"> + <return type="void"> + </return> + <argument index="0" name="resizable" type="bool"> </argument> <description> </description> </method> <method name="set_selected"> + <return type="void"> + </return> <argument index="0" name="selected" type="bool"> </argument> <description> </description> </method> <method name="set_show_close_button"> + <return type="void"> + </return> <argument index="0" name="show" type="bool"> </argument> <description> @@ -18634,6 +21131,8 @@ </description> </method> <method name="set_slot"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="enable_left" type="bool"> @@ -18648,14 +21147,16 @@ </argument> <argument index="6" name="color_right" type="Color"> </argument> - <argument index="7" name="custom_left" type="Object" default="NULL"> + <argument index="7" name="custom_left" type="Texture" default="null"> </argument> - <argument index="8" name="custom_right" type="Object" default="NULL"> + <argument index="8" name="custom_right" type="Texture" default="null"> </argument> <description> </description> </method> <method name="set_title"> + <return type="void"> + </return> <argument index="0" name="title" type="String"> </argument> <description> @@ -18664,7 +21165,7 @@ </method> </methods> <members> - <member name="resizeable" type="bool" setter="set_resizeable" getter="is_resizeable" brief=""> + <member name="resizable" type="bool" setter="set_resizable" getter="is_resizable" brief=""> </member> <member name="show_close" type="bool" setter="set_show_close_button" getter="is_close_button_visible" brief=""> </member> @@ -18764,6 +21265,8 @@ </description> </method> <method name="set_columns"> + <return type="void"> + </return> <argument index="0" name="columns" type="int"> </argument> <description> @@ -18790,95 +21293,9 @@ <description> </description> <methods> - <method name="area_get_bounds" qualifiers="const"> - <return type="Rect3"> - </return> - <argument index="0" name="area" type="int"> - </argument> - <description> - </description> - </method> - <method name="area_get_name" qualifiers="const"> - <return type="String"> - </return> - <argument index="0" name="area" type="int"> - </argument> - <description> - </description> - </method> - <method name="area_get_portal_disable_color" qualifiers="const"> - <return type="Color"> - </return> - <argument index="0" name="area" type="int"> - </argument> - <description> - </description> - </method> - <method name="area_get_portal_disable_distance" qualifiers="const"> - <return type="float"> - </return> - <argument index="0" name="area" type="int"> - </argument> - <description> - </description> - </method> - <method name="area_is_exterior_portal" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="area" type="int"> - </argument> - <description> - </description> - </method> - <method name="area_set_exterior_portal"> - <argument index="0" name="area" type="int"> - </argument> - <argument index="1" name="enable" type="bool"> - </argument> - <description> - </description> - </method> - <method name="area_set_name"> - <argument index="0" name="area" type="int"> - </argument> - <argument index="1" name="name" type="String"> - </argument> - <description> - </description> - </method> - <method name="area_set_portal_disable_color"> - <argument index="0" name="area" type="int"> - </argument> - <argument index="1" name="color" type="Color"> - </argument> - <description> - </description> - </method> - <method name="area_set_portal_disable_distance"> - <argument index="0" name="area" type="int"> - </argument> - <argument index="1" name="distance" type="float"> - </argument> - <description> - </description> - </method> <method name="clear"> - <description> - </description> - </method> - <method name="create_area"> - <return type="int"> + <return type="void"> </return> - <argument index="0" name="id" type="int"> - </argument> - <argument index="1" name="area" type="Rect3"> - </argument> - <description> - </description> - </method> - <method name="erase_area"> - <argument index="0" name="area" type="int"> - </argument> <description> </description> </method> @@ -18907,7 +21324,7 @@ </description> </method> <method name="get_cell_size" qualifiers="const"> - <return type="float"> + <return type="Vector3"> </return> <description> </description> @@ -18948,19 +21365,17 @@ <description> </description> </method> - <method name="get_unused_area_id" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> <method name="resource_changed"> - <argument index="0" name="resource" type="Object"> + <return type="void"> + </return> + <argument index="0" name="resource" type="Resource"> </argument> <description> </description> </method> <method name="set_cell_item"> + <return type="void"> + </return> <argument index="0" name="x" type="int"> </argument> <argument index="1" name="y" type="int"> @@ -18975,48 +21390,62 @@ </description> </method> <method name="set_cell_size"> - <argument index="0" name="size" type="float"> + <return type="void"> + </return> + <argument index="0" name="size" type="Vector3"> </argument> <description> </description> </method> <method name="set_center_x"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_center_y"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_center_z"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_clip"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <argument index="1" name="clipabove" type="bool" default="true"> </argument> <argument index="2" name="floor" type="int" default="0"> </argument> - <argument index="3" name="axis" type="int" default="0"> + <argument index="3" name="axis" type="int" enum="Vector3.Axis" default="0"> </argument> <description> </description> </method> <method name="set_octant_size"> + <return type="void"> + </return> <argument index="0" name="size" type="int"> </argument> <description> </description> </method> <method name="set_theme"> + <return type="void"> + </return> <argument index="0" name="theme" type="MeshLibrary"> </argument> <description> @@ -19024,7 +21453,7 @@ </method> </methods> <constants> - <constant name="INVALID_CELL_ITEM" value="-1"> + <constant name="INVALID_CELL_ITEM" value="-1" enum=""> </constant> </constants> </class> @@ -19051,6 +21480,8 @@ </description> </method> <method name="set_initial_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="float"> </argument> <description> @@ -19058,6 +21489,8 @@ </description> </method> <method name="set_length"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> @@ -19110,6 +21543,8 @@ </theme_item> <theme_item name="grabber_highlight" type="StyleBox"> </theme_item> + <theme_item name="grabber_pressed" type="StyleBox"> + </theme_item> <theme_item name="increment" type="Texture"> </theme_item> <theme_item name="increment_highlight" type="Texture"> @@ -19200,12 +21635,14 @@ </description> <methods> <method name="close"> + <return type="void"> + </return> <description> Cloces the current connection, allows for reusal of [HTTPClient]. </description> </method> <method name="connect_to_host"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="host" type="String"> </argument> @@ -19259,7 +21696,7 @@ </description> </method> <method name="get_status" qualifiers="const"> - <return type="int"> + <return type="int" enum="HTTPClient.Status"> </return> <description> Returns a STATUS_* enum constant. Need to call [method poll] in order to get status updates. @@ -19287,7 +21724,7 @@ </description> </method> <method name="poll"> - <return type="Error"> + <return type="int" enum="Error"> </return> <description> This needs to be called in order to have any request processed. Check results with [method get_status] @@ -19315,9 +21752,9 @@ </description> </method> <method name="request"> - <return type="int"> + <return type="int" enum="Error"> </return> - <argument index="0" name="method" type="int"> + <argument index="0" name="method" type="int" enum="HTTPClient.Method"> </argument> <argument index="1" name="url" type="String"> </argument> @@ -19338,9 +21775,9 @@ </description> </method> <method name="request_raw"> - <return type="int"> + <return type="int" enum="Error"> </return> - <argument index="0" name="method" type="int"> + <argument index="0" name="method" type="int" enum="HTTPClient.Method"> </argument> <argument index="1" name="url" type="String"> </argument> @@ -19355,7 +21792,7 @@ </description> </method> <method name="send_body_data"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="body" type="PoolByteArray"> </argument> @@ -19364,7 +21801,7 @@ </description> </method> <method name="send_body_text"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="body" type="String"> </argument> @@ -19373,6 +21810,8 @@ </description> </method> <method name="set_blocking_mode"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -19380,6 +21819,8 @@ </description> </method> <method name="set_connection"> + <return type="void"> + </return> <argument index="0" name="connection" type="StreamPeer"> </argument> <description> @@ -19387,6 +21828,8 @@ </description> </method> <method name="set_read_chunk_size"> + <return type="void"> + </return> <argument index="0" name="bytes" type="int"> </argument> <description> @@ -19543,6 +21986,8 @@ </description> <methods> <method name="cancel_request"> + <return type="void"> + </return> <description> Cancel the current request. </description> @@ -19576,7 +22021,7 @@ </description> </method> <method name="get_http_client_status" qualifiers="const"> - <return type="int"> + <return type="int" enum="HTTPClient.Status"> </return> <description> Return the current status of the underlying [HTTPClient]. @@ -19597,15 +22042,15 @@ </description> </method> <method name="request"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="url" type="String"> </argument> - <argument index="1" name="custom_headers" type="PoolStringArray" default="PoolStringArray([])"> + <argument index="1" name="custom_headers" type="PoolStringArray" default="PoolStringArray( )"> </argument> <argument index="2" name="ssl_validate_domain" type="bool" default="true"> </argument> - <argument index="3" name="method" type="int" default="0"> + <argument index="3" name="method" type="int" enum="HTTPClient.Method" default="0"> </argument> <argument index="4" name="request_data" type="String" default=""""> </argument> @@ -19613,6 +22058,8 @@ </description> </method> <method name="set_body_size_limit"> + <return type="void"> + </return> <argument index="0" name="bytes" type="int"> </argument> <description> @@ -19620,6 +22067,8 @@ </description> </method> <method name="set_download_file"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> @@ -19627,6 +22076,8 @@ </description> </method> <method name="set_max_redirects"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> @@ -19634,6 +22085,8 @@ </description> </method> <method name="set_use_threads"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -19711,7 +22164,7 @@ <method name="get_flag" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="flag" type="int"> + <argument index="0" name="flag" type="int" enum="HingeJoint.Flag"> </argument> <description> </description> @@ -19719,13 +22172,15 @@ <method name="get_param" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="HingeJoint.Param"> </argument> <description> </description> </method> <method name="set_flag"> - <argument index="0" name="flag" type="int"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="HingeJoint.Flag"> </argument> <argument index="1" name="enabled" type="bool"> </argument> @@ -19733,7 +22188,9 @@ </description> </method> <method name="set_param"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="HingeJoint.Param"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -19795,26 +22252,32 @@ IP Protocol support functions. </brief_description> <description> - IP contains some support functions for the IPv4 protocol. TCP/IP support is in different classes (see [StreamPeerTCP] and [TCP_Server]). IP provides hostname resolution support, both blocking and threaded. + IP contains support functions for the IPv4 protocol. TCP/IP support is in different classes (see [StreamPeerTCP] and [TCP_Server]). IP provides hostname resolution support, both blocking and threaded. </description> <methods> <method name="clear_cache"> - <argument index="0" name="arg0" type="String" default=""""> + <return type="void"> + </return> + <argument index="0" name="hostname" type="String" default=""""> </argument> <description> + Removes all of a "hostname"'s cached references. If no "hostname" is given then all cached IP addresses are removed. </description> </method> <method name="erase_resolve_item"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> - Erase a queue ID, removing it from the queue if needed. This should be used after a queue is completed to free it and enable more queries to happen. + Removes a given item "id" from the queue. This should be used to free a queue after it has completed to enable more queries to happen. </description> </method> - <method name="get_local_addresses" qualifiers="const"> + <method name="get_local_addresses" qualifiers="const"> <return type="Array"> </return> <description> + Returns all of the user's current IPv4 and IPv6 addresses as an array. </description> </method> <method name="get_resolve_item_address" qualifiers="const"> @@ -19823,16 +22286,16 @@ <argument index="0" name="id" type="int"> </argument> <description> - Return a resolved item address, or an empty string if an error happened or resolution didn't happen yet (see [method get_resolve_item_status]). + Returns a queued hostname's IP address, given its queue "id". Returns an empty string on error or if resolution hasn't happened yet (see [method get_resolve_item_status]). </description> </method> <method name="get_resolve_item_status" qualifiers="const"> - <return type="int"> + <return type="int" enum="IP.ResolverStatus"> </return> <argument index="0" name="id" type="int"> </argument> <description> - Return the status of hostname queued for resolving, given its queue ID. Returned status can be any of the RESOLVER_STATUS_* enumeration. + Returns a queued hostname's status as a RESOLVER_STATUS_* constant, given its queue "id". </description> </method> <method name="resolve_hostname"> @@ -19840,10 +22303,10 @@ </return> <argument index="0" name="host" type="String"> </argument> - <argument index="1" name="ip_type" type="int" default="3"> + <argument index="1" name="ip_type" type="int" enum="IP.Type" default="3"> </argument> <description> - Resolve a given hostname, blocking. Resolved hostname is returned as an IPv4 or IPv6 depending on "ip_type". + Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the TYPE_* constant given as "ip_type". </description> </method> <method name="resolve_hostname_queue_item"> @@ -19851,10 +22314,10 @@ </return> <argument index="0" name="host" type="String"> </argument> - <argument index="1" name="ip_type" type="int" default="3"> + <argument index="1" name="ip_type" type="int" enum="IP.Type" default="3"> </argument> <description> - Create a queue item for resolving a given hostname to an IPv4 or IPv6 depending on "ip_type". The queue ID is returned, or RESOLVER_INVALID_ID on error. + Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the TYPE_* constant given as "ip_type". Returns the queue ID if successful, or RESOLVER_INVALID_ID on error. </description> </method> </methods> @@ -19867,9 +22330,9 @@ </constant> <constant name="RESOLVER_STATUS_ERROR" value="3"> </constant> - <constant name="RESOLVER_MAX_QUERIES" value="32"> + <constant name="RESOLVER_MAX_QUERIES" value="32" enum=""> </constant> - <constant name="RESOLVER_INVALID_ID" value="-1"> + <constant name="RESOLVER_INVALID_ID" value="-1" enum=""> </constant> <constant name="TYPE_NONE" value="0"> </constant> @@ -19900,6 +22363,8 @@ </description> <methods> <method name="blend_rect"> + <return type="void"> + </return> <argument index="0" name="src" type="Image"> </argument> <argument index="1" name="src_rect" type="Rect2"> @@ -19911,6 +22376,8 @@ </description> </method> <method name="blend_rect_mask"> + <return type="void"> + </return> <argument index="0" name="src" type="Image"> </argument> <argument index="1" name="mask" type="Image"> @@ -19924,6 +22391,8 @@ </description> </method> <method name="blit_rect"> + <return type="void"> + </return> <argument index="0" name="src" type="Image"> </argument> <argument index="1" name="src_rect" type="Rect2"> @@ -19935,6 +22404,8 @@ </description> </method> <method name="blit_rect_mask"> + <return type="void"> + </return> <argument index="0" name="src" type="Image"> </argument> <argument index="1" name="mask" type="Image"> @@ -19948,54 +22419,64 @@ </description> </method> <method name="clear_mipmaps"> + <return type="void"> + </return> <description> </description> </method> <method name="compress"> - <return type="int"> + <return type="int" enum="Error"> </return> - <argument index="0" name="mode" type="int"> + <argument index="0" name="mode" type="int" enum="Image.CompressMode"> </argument> - <argument index="1" name="arg1" type="int"> + <argument index="1" name="source" type="int" enum="Image.CompressSource"> </argument> - <argument index="2" name="arg2" type="float"> + <argument index="2" name="lossy_quality" type="float"> </argument> <description> </description> </method> <method name="convert"> - <argument index="0" name="format" type="int"> + <return type="void"> + </return> + <argument index="0" name="format" type="int" enum="Image.Format"> </argument> <description> </description> </method> <method name="copy_from"> + <return type="void"> + </return> <argument index="0" name="src" type="Image"> </argument> <description> </description> </method> <method name="create"> + <return type="void"> + </return> <argument index="0" name="width" type="int"> </argument> <argument index="1" name="height" type="int"> </argument> <argument index="2" name="use_mipmaps" type="bool"> </argument> - <argument index="3" name="format" type="int"> + <argument index="3" name="format" type="int" enum="Image.Format"> </argument> <description> Create an empty image of a specific size and format. </description> </method> <method name="create_from_data"> + <return type="void"> + </return> <argument index="0" name="width" type="int"> </argument> <argument index="1" name="height" type="int"> </argument> <argument index="2" name="use_mipmaps" type="bool"> </argument> - <argument index="3" name="format" type="int"> + <argument index="3" name="format" type="int" enum="Image.Format"> </argument> <argument index="4" name="data" type="PoolByteArray"> </argument> @@ -20003,6 +22484,8 @@ </description> </method> <method name="crop"> + <return type="void"> + </return> <argument index="0" name="width" type="int"> </argument> <argument index="1" name="height" type="int"> @@ -20011,22 +22494,26 @@ </description> </method> <method name="decompress"> - <return type="int"> + <return type="int" enum="Error"> </return> <description> </description> </method> <method name="detect_alpha" qualifiers="const"> - <return type="int"> + <return type="int" enum="Image.AlphaMode"> </return> <description> </description> </method> <method name="expand_x2_hq2x"> + <return type="void"> + </return> <description> </description> </method> <method name="fill"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> @@ -20034,19 +22521,25 @@ </description> </method> <method name="fix_alpha_edges"> + <return type="void"> + </return> <description> </description> </method> <method name="flip_x"> + <return type="void"> + </return> <description> </description> </method> <method name="flip_y"> + <return type="void"> + </return> <description> </description> </method> <method name="generate_mipmaps"> - <return type="int"> + <return type="int" enum="Error"> </return> <description> </description> @@ -20059,7 +22552,7 @@ </description> </method> <method name="get_format" qualifiers="const"> - <return type="int"> + <return type="int" enum="Image.Format"> </return> <description> Return the format of the [Image], one of [Image].FORMAT_*. @@ -20099,6 +22592,12 @@ Return a new [Image] that is a copy of "area" in this [Image]. </description> </method> + <method name="get_size" qualifiers="const"> + <return type="Vector2"> + </return> + <description> + </description> + </method> <method name="get_used_rect" qualifiers="const"> <return type="Rect2"> </return> @@ -20138,7 +22637,7 @@ </description> </method> <method name="load"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -20147,35 +22646,45 @@ </description> </method> <method name="lock"> + <return type="void"> + </return> <description> </description> </method> <method name="normalmap_to_xy"> + <return type="void"> + </return> <description> </description> </method> <method name="premultiply_alpha"> + <return type="void"> + </return> <description> </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="width" type="int"> </argument> <argument index="1" name="height" type="int"> </argument> - <argument index="2" name="interpolation" type="int" default="1"> + <argument index="2" name="interpolation" type="int" enum="Image.Interpolation" default="1"> </argument> <description> </description> </method> <method name="resize_to_po2"> + <return type="void"> + </return> <argument index="0" name="square" type="bool" default="false"> </argument> <description> </description> </method> <method name="save_png" qualifiers="const"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -20184,6 +22693,8 @@ </description> </method> <method name="set_pixel"> + <return type="void"> + </return> <argument index="0" name="x" type="int"> </argument> <argument index="1" name="y" type="int"> @@ -20194,14 +22705,20 @@ </description> </method> <method name="shrink_x2"> + <return type="void"> + </return> <description> </description> </method> <method name="srgb_to_linear"> + <return type="void"> + </return> <description> </description> </method> <method name="unlock"> + <return type="void"> + </return> <description> </description> </method> @@ -20326,11 +22843,13 @@ </description> <methods> <method name="create"> + <return type="void"> + </return> <argument index="0" name="width" type="int"> </argument> <argument index="1" name="height" type="int"> </argument> - <argument index="2" name="format" type="int"> + <argument index="2" name="format" type="int" enum="Image.Format"> </argument> <argument index="3" name="flags" type="int" default="7"> </argument> @@ -20341,6 +22860,8 @@ </description> </method> <method name="create_from_image"> + <return type="void"> + </return> <argument index="0" name="image" type="Image"> </argument> <argument index="1" name="flags" type="int" default="7"> @@ -20349,15 +22870,8 @@ Create a new [ImageTexture] from an [Image] with "flags" from [Texture].FLAG_*. </description> </method> - <method name="get_data" qualifiers="const"> - <return type="Image"> - </return> - <description> - Return the [Image] of this [ImageTexture]. - </description> - </method> <method name="get_format" qualifiers="const"> - <return type="int"> + <return type="int" enum="Image.Format"> </return> <description> Return the format of the [ImageTexture], one of [Image].FORMAT_*. @@ -20371,13 +22885,15 @@ </description> </method> <method name="get_storage" qualifiers="const"> - <return type="int"> + <return type="int" enum="ImageTexture.Storage"> </return> <description> Return the storage type. One of [ImageTexture].STORAGE_*. </description> </method> <method name="load"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> @@ -20385,6 +22901,8 @@ </description> </method> <method name="set_data"> + <return type="void"> + </return> <argument index="0" name="image" type="Image"> </argument> <description> @@ -20392,6 +22910,8 @@ </description> </method> <method name="set_lossy_storage_quality"> + <return type="void"> + </return> <argument index="0" name="quality" type="float"> </argument> <description> @@ -20399,13 +22919,17 @@ </description> </method> <method name="set_size_override"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> </description> </method> <method name="set_storage"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="ImageTexture.Storage"> </argument> <description> Set the storage type. One of [ImageTexture].STORAGE_*. @@ -20432,6 +22956,8 @@ </description> <methods> <method name="add_sphere"> + <return type="void"> + </return> <argument index="0" name="lats" type="int"> </argument> <argument index="1" name="lons" type="int"> @@ -20441,10 +22967,12 @@ <argument index="3" name="add_uv" type="bool" default="true"> </argument> <description> - Simple helper to draw an uvsphere, with given latitudes, longitude and radius. + Simple helper to draw a uvsphere, with given latitudes, longitude and radius. </description> </method> <method name="add_vertex"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector3"> </argument> <description> @@ -20452,9 +22980,11 @@ </description> </method> <method name="begin"> - <argument index="0" name="primitive" type="int"> + <return type="void"> + </return> + <argument index="0" name="primitive" type="int" enum="Mesh.PrimitiveType"> </argument> - <argument index="1" name="texture" type="Texture" default="NULL"> + <argument index="1" name="texture" type="Texture" default="null"> </argument> <description> Begin drawing (And optionally pass a texture override). When done call end(). For more information on how this works, search for glBegin() glEnd() references. @@ -20462,16 +22992,22 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clear everything that was drawn using begin/end. </description> </method> <method name="end"> + <return type="void"> + </return> <description> Call this when done adding a batch of geometry, otherwise it can't be displayed. </description> </method> <method name="set_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> @@ -20479,6 +23015,8 @@ </description> </method> <method name="set_normal"> + <return type="void"> + </return> <argument index="0" name="normal" type="Vector3"> </argument> <description> @@ -20486,6 +23024,8 @@ </description> </method> <method name="set_tangent"> + <return type="void"> + </return> <argument index="0" name="tangent" type="Plane"> </argument> <description> @@ -20493,6 +23033,8 @@ </description> </method> <method name="set_uv"> + <return type="void"> + </return> <argument index="0" name="uv" type="Vector2"> </argument> <description> @@ -20500,6 +23042,8 @@ </description> </method> <method name="set_uv2"> + <return type="void"> + </return> <argument index="0" name="uv" type="Vector2"> </argument> <description> @@ -20519,6 +23063,8 @@ </description> <methods> <method name="action_press"> + <return type="void"> + </return> <argument index="0" name="action" type="String"> </argument> <description> @@ -20526,6 +23072,8 @@ </description> </method> <method name="action_release"> + <return type="void"> + </return> <argument index="0" name="action" type="String"> </argument> <description> @@ -20533,6 +23081,8 @@ </description> </method> <method name="add_joy_mapping"> + <return type="void"> + </return> <argument index="0" name="mapping" type="String"> </argument> <argument index="1" name="update_existing" type="bool" default="false"> @@ -20669,7 +23219,7 @@ </description> </method> <method name="get_mouse_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Input.MouseMode"> </return> <description> Return the mouse mode. See the constants for more information. @@ -20739,12 +23289,16 @@ </description> </method> <method name="parse_input_event"> - <argument index="0" name="event" type="Object"> + <return type="void"> + </return> + <argument index="0" name="event" type="InputEvent"> </argument> <description> </description> </method> <method name="remove_joy_mapping"> + <return type="void"> + </return> <argument index="0" name="guid" type="String"> </argument> <description> @@ -20752,22 +23306,27 @@ </description> </method> <method name="set_custom_mouse_cursor"> - <argument index="0" name="image" type="Texture"> + <return type="void"> + </return> + <argument index="0" name="image" type="Resource"> </argument> - <argument index="1" name="hotspot" type="Vector2" default="Vector2(0, 0)"> + <argument index="1" name="hotspot" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> - Set a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. </description> </method> <method name="set_mouse_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Input.MouseMode"> </argument> <description> Set the mouse mode. See the constants for more information. </description> </method> <method name="start_joy_vibration"> + <return type="void"> + </return> <argument index="0" name="device" type="int"> </argument> <argument index="1" name="weak_magnitude" type="float"> @@ -20782,6 +23341,8 @@ </description> </method> <method name="stop_joy_vibration"> + <return type="void"> + </return> <argument index="0" name="device" type="int"> </argument> <description> @@ -20789,6 +23350,8 @@ </description> </method> <method name="warp_mouse_pos"> + <return type="void"> + </return> <argument index="0" name="to" type="Vector2"> </argument> <description> @@ -20835,6 +23398,7 @@ </class> <class name="InputEvent" inherits="Resource" category="Core"> <brief_description> + Generic input event </brief_description> <description> </description> @@ -20845,24 +23409,28 @@ <argument index="0" name="event" type="InputEvent"> </argument> <description> + Returns true if this input event matches the event passed. </description> </method> <method name="as_text" qualifiers="const"> <return type="String"> </return> <description> + Returns a [String] representation of the event. </description> </method> <method name="get_device" qualifiers="const"> <return type="int"> </return> <description> + Returns the id of the device that generated the event. </description> </method> <method name="get_id" qualifiers="const"> <return type="int"> </return> <description> + Returns the id of the event. </description> </method> <method name="is_action" qualifiers="const"> @@ -20871,7 +23439,7 @@ <argument index="0" name="action" type="String"> </argument> <description> - Return if this input event matches a pre-defined action, no matter the type. + Returns true if this input event matches a pre-defined action, no matter the type. </description> </method> <method name="is_action_pressed" qualifiers="const"> @@ -20880,7 +23448,7 @@ <argument index="0" name="action" type="String"> </argument> <description> - Return whether the given action is being pressed (and is not an echo event for KEY events). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. + Returns true if the given action is being pressed (and is not an echo event for KEY events). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. </description> </method> <method name="is_action_released" qualifiers="const"> @@ -20889,7 +23457,7 @@ <argument index="0" name="action" type="String"> </argument> <description> - Return whether the given action is released (i.e. not pressed). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. + Returns true if the given action is released (i.e. not pressed). Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. </description> </method> <method name="is_action_type" qualifiers="const"> @@ -20902,23 +23470,27 @@ <return type="bool"> </return> <description> - Return if this input event is an echo event (only for events of type KEY, it will return false for other types). + Returns true if this input event is an echo event (only for events of type KEY, it will return false for other types). </description> </method> <method name="is_pressed" qualifiers="const"> <return type="bool"> </return> <description> - Return if this input event is pressed. Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. + Returns true if this input event is pressed. Not relevant for the event types MOUSE_MOTION, SCREEN_DRAG and NONE. </description> </method> <method name="set_device"> + <return type="void"> + </return> <argument index="0" name="device" type="int"> </argument> <description> </description> </method> <method name="set_id"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> @@ -20937,7 +23509,7 @@ </return> <argument index="0" name="xform" type="Transform2D"> </argument> - <argument index="1" name="local_ofs" type="Vector2" default="Vector2(0, 0)"> + <argument index="1" name="local_ofs" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> </description> @@ -20964,12 +23536,16 @@ </description> </method> <method name="set_action"> + <return type="void"> + </return> <argument index="0" name="action" type="String"> </argument> <description> </description> </method> <method name="set_pressed"> + <return type="void"> + </return> <argument index="0" name="pressed" type="bool"> </argument> <description> @@ -21005,18 +23581,24 @@ </description> </method> <method name="set_button_index"> + <return type="void"> + </return> <argument index="0" name="button_index" type="int"> </argument> <description> </description> </method> <method name="set_pressed"> + <return type="void"> + </return> <argument index="0" name="pressed" type="bool"> </argument> <description> </description> </method> <method name="set_pressure"> + <return type="void"> + </return> <argument index="0" name="pressure" type="float"> </argument> <description> @@ -21057,12 +23639,16 @@ </description> </method> <method name="set_axis"> + <return type="void"> + </return> <argument index="0" name="axis" type="int"> </argument> <description> </description> </method> <method name="set_axis_value"> + <return type="void"> + </return> <argument index="0" name="axis_value" type="float"> </argument> <description> @@ -21106,24 +23692,32 @@ </description> </method> <method name="set_echo"> + <return type="void"> + </return> <argument index="0" name="echo" type="bool"> </argument> <description> </description> </method> <method name="set_pressed"> + <return type="void"> + </return> <argument index="0" name="pressed" type="bool"> </argument> <description> </description> </method> <method name="set_scancode"> + <return type="void"> + </return> <argument index="0" name="scancode" type="int"> </argument> <description> </description> </method> <method name="set_unicode"> + <return type="void"> + </return> <argument index="0" name="unicode" type="int"> </argument> <description> @@ -21131,7 +23725,7 @@ </method> </methods> <members> - <member name="echo" type="int" setter="set_echo" getter="is_echo" brief=""> + <member name="echo" type="bool" setter="set_echo" getter="is_echo" brief=""> Echo state of the key, i.e. whether it's a repeat event or not. </member> <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief=""> @@ -21173,18 +23767,24 @@ </description> </method> <method name="set_button_mask"> + <return type="void"> + </return> <argument index="0" name="button_mask" type="int"> </argument> <description> </description> </method> <method name="set_global_position"> + <return type="void"> + </return> <argument index="0" name="global_position" type="Vector2"> </argument> <description> </description> </method> <method name="set_position"> + <return type="void"> + </return> <argument index="0" name="position" type="Vector2"> </argument> <description> @@ -21231,24 +23831,32 @@ </description> </method> <method name="set_button_index"> + <return type="void"> + </return> <argument index="0" name="button_index" type="int"> </argument> <description> </description> </method> <method name="set_doubleclick"> + <return type="void"> + </return> <argument index="0" name="doubleclick" type="bool"> </argument> <description> </description> </method> <method name="set_factor"> + <return type="void"> + </return> <argument index="0" name="factor" type="float"> </argument> <description> </description> </method> <method name="set_pressed"> + <return type="void"> + </return> <argument index="0" name="pressed" type="bool"> </argument> <description> @@ -21291,12 +23899,16 @@ </description> </method> <method name="set_relative"> + <return type="void"> + </return> <argument index="0" name="relative" type="Vector2"> </argument> <description> </description> </method> <method name="set_speed"> + <return type="void"> + </return> <argument index="0" name="speed" type="Vector2"> </argument> <description> @@ -21346,24 +23958,32 @@ </description> </method> <method name="set_index"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <description> </description> </method> <method name="set_position"> + <return type="void"> + </return> <argument index="0" name="position" type="Vector2"> </argument> <description> </description> </method> <method name="set_relative"> + <return type="void"> + </return> <argument index="0" name="relative" type="Vector2"> </argument> <description> </description> </method> <method name="set_speed"> + <return type="void"> + </return> <argument index="0" name="speed" type="Vector2"> </argument> <description> @@ -21407,18 +24027,24 @@ </description> </method> <method name="set_index"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <description> </description> </method> <method name="set_position"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <description> </description> </method> <method name="set_pressed"> + <return type="void"> + </return> <argument index="0" name="pressed" type="bool"> </argument> <description> @@ -21477,30 +24103,40 @@ </description> </method> <method name="set_alt"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_command"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_control"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_metakey"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_shift"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -21535,18 +24171,22 @@ </description> <methods> <method name="action_add_event"> + <return type="void"> + </return> <argument index="0" name="action" type="String"> </argument> - <argument index="1" name="event" type="Object"> + <argument index="1" name="event" type="InputEvent"> </argument> <description> Add an [InputEvent] to an action. This [InputEvent] will trigger the action. </description> </method> <method name="action_erase_event"> + <return type="void"> + </return> <argument index="0" name="action" type="String"> </argument> - <argument index="1" name="event" type="Object"> + <argument index="1" name="event" type="InputEvent"> </argument> <description> Remove an [InputEvent] from an action. @@ -21557,13 +24197,15 @@ </return> <argument index="0" name="action" type="String"> </argument> - <argument index="1" name="event" type="Object"> + <argument index="1" name="event" type="InputEvent"> </argument> <description> Whether an action has an [InputEvent] associated with it. </description> </method> <method name="add_action"> + <return type="void"> + </return> <argument index="0" name="action" type="String"> </argument> <description> @@ -21571,6 +24213,8 @@ </description> </method> <method name="erase_action"> + <return type="void"> + </return> <argument index="0" name="action" type="String"> </argument> <description> @@ -21580,7 +24224,7 @@ <method name="event_is_action" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="event" type="Object"> + <argument index="0" name="event" type="InputEvent"> </argument> <argument index="1" name="action" type="String"> </argument> @@ -21614,6 +24258,8 @@ </description> </method> <method name="load_from_globals"> + <return type="void"> + </return> <description> Clear the [InputMap] and load it anew from [ProjectSettings]. </description> @@ -21647,7 +24293,9 @@ </description> </method> <method name="replace_by_instance"> - <argument index="0" name="custom_scene" type="PackedScene" default="NULL"> + <return type="void"> + </return> + <argument index="0" name="custom_scene" type="PackedScene" default="null"> </argument> <description> Replace this placeholder by the scene handed as an argument, or the original scene if no argument is given. As for all resources, the scene is loaded only if it's not loaded already. By manually loading the scene beforehand, delays caused by this function can be avoided. @@ -21682,24 +24330,32 @@ </description> </method> <method name="set_interpolation_enabled"> + <return type="void"> + </return> <argument index="0" name="target_path" type="bool"> </argument> <description> </description> </method> <method name="set_speed"> + <return type="void"> + </return> <argument index="0" name="speed" type="float"> </argument> <description> </description> </method> <method name="set_target"> - <argument index="0" name="target" type="Camera"> + <return type="void"> + </return> + <argument index="0" name="target" type="Object"> </argument> <description> </description> </method> <method name="set_target_path"> + <return type="void"> + </return> <argument index="0" name="target_path" type="NodePath"> </argument> <description> @@ -21729,6 +24385,8 @@ </description> <methods> <method name="add_icon_item"> + <return type="void"> + </return> <argument index="0" name="icon" type="Texture"> </argument> <argument index="1" name="selectable" type="bool" default="true"> @@ -21738,9 +24396,11 @@ </description> </method> <method name="add_item"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> - <argument index="1" name="icon" type="Texture" default="NULL"> + <argument index="1" name="icon" type="Texture" default="null"> </argument> <argument index="2" name="selectable" type="bool" default="true"> </argument> @@ -21750,11 +24410,15 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Remove all items from the list. </description> </method> <method name="ensure_current_is_visible"> + <return type="void"> + </return> <description> Ensure selection is visible, adjusting the scroll position as necessary. </description> @@ -21780,7 +24444,7 @@ </description> </method> <method name="get_icon_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="ItemList.IconMode"> </return> <description> </description> @@ -21874,7 +24538,7 @@ </description> </method> <method name="get_select_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="ItemList.SelectMode"> </return> <description> </description> @@ -21887,12 +24551,18 @@ </description> </method> <method name="get_v_scroll"> - <return type="Object"> + <return type="VScrollBar"> </return> <description> Returns the current vertical scroll bar for the List. </description> </method> + <method name="has_auto_height" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_item_disabled" qualifiers="const"> <return type="bool"> </return> @@ -21921,7 +24591,7 @@ </description> </method> <method name="is_same_column_width" qualifiers="const"> - <return type="int"> + <return type="bool"> </return> <description> Returns whether or not all columns of the list are of the same size. @@ -21937,6 +24607,8 @@ </description> </method> <method name="remove_item"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -21944,6 +24616,8 @@ </description> </method> <method name="select"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="single" type="bool" default="true"> @@ -21954,13 +24628,25 @@ </description> </method> <method name="set_allow_rmb_select"> + <return type="void"> + </return> <argument index="0" name="allow" type="bool"> </argument> <description> Allow (or disallow) selection of (selectable) items in the list using right mouse button. </description> </method> + <method name="set_auto_height"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_fixed_column_width"> + <return type="void"> + </return> <argument index="0" name="width" type="int"> </argument> <description> @@ -21968,24 +24654,32 @@ </description> </method> <method name="set_fixed_icon_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> </description> </method> <method name="set_icon_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="ItemList.IconMode"> </argument> <description> </description> </method> <method name="set_icon_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="float"> </argument> <description> </description> </method> <method name="set_item_custom_bg_color"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="custom_bg_color" type="Color"> @@ -21994,6 +24688,8 @@ </description> </method> <method name="set_item_disabled"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="disabled" type="bool"> @@ -22004,6 +24700,8 @@ </description> </method> <method name="set_item_icon"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="icon" type="Texture"> @@ -22013,6 +24711,8 @@ </description> </method> <method name="set_item_icon_region"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="rect" type="Rect2"> @@ -22021,6 +24721,8 @@ </description> </method> <method name="set_item_metadata"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="metadata" type="Variant"> @@ -22030,6 +24732,8 @@ </description> </method> <method name="set_item_selectable"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="selectable" type="bool"> @@ -22039,6 +24743,8 @@ </description> </method> <method name="set_item_text"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="text" type="String"> @@ -22048,6 +24754,8 @@ </description> </method> <method name="set_item_tooltip"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="tooltip" type="String"> @@ -22057,6 +24765,8 @@ </description> </method> <method name="set_item_tooltip_enabled"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="enable" type="bool"> @@ -22066,6 +24776,8 @@ </description> </method> <method name="set_max_columns"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> @@ -22073,6 +24785,8 @@ </description> </method> <method name="set_max_text_lines"> + <return type="void"> + </return> <argument index="0" name="lines" type="int"> </argument> <description> @@ -22080,6 +24794,8 @@ </description> </method> <method name="set_same_column_width"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -22087,17 +24803,23 @@ </description> </method> <method name="set_select_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="ItemList.SelectMode"> </argument> <description> </description> </method> <method name="sort_items_by_text"> + <return type="void"> + </return> <description> Sorts items in the list by their text. </description> </method> <method name="unselect"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -22108,9 +24830,11 @@ <members> <member name="allow_rmb_select" type="bool" setter="set_allow_rmb_select" getter="get_allow_rmb_select" brief=""> </member> + <member name="auto_height" type="bool" setter="set_auto_height" getter="has_auto_height" brief=""> + </member> <member name="fixed_column_width" type="int" setter="set_fixed_column_width" getter="get_fixed_column_width" brief=""> </member> - <member name="icon_mode" type="int" setter="set_icon_mode" getter="get_icon_mode" brief=""> + <member name="icon_mode" type="int" setter="set_icon_mode" getter="get_icon_mode" brief="" enum="ItemList.IconMode"> </member> <member name="icon_scale" type="float" setter="set_icon_scale" getter="get_icon_scale" brief=""> </member> @@ -22122,7 +24846,7 @@ </member> <member name="same_column_width" type="bool" setter="set_same_column_width" getter="is_same_column_width" brief=""> </member> - <member name="select_mode" type="int" setter="set_select_mode" getter="get_select_mode" brief=""> + <member name="select_mode" type="int" setter="set_select_mode" getter="get_select_mode" brief="" enum="ItemList.SelectMode"> </member> </members> <signals> @@ -22233,24 +24957,32 @@ </description> </method> <method name="set_exclude_nodes_from_collision"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_node_a"> + <return type="void"> + </return> <argument index="0" name="node" type="NodePath"> </argument> <description> </description> </method> <method name="set_node_b"> + <return type="void"> + </return> <argument index="0" name="node" type="NodePath"> </argument> <description> </description> </method> <method name="set_solver_priority"> + <return type="void"> + </return> <argument index="0" name="priority" type="int"> </argument> <description> @@ -22305,18 +25037,24 @@ </description> </method> <method name="set_bias"> + <return type="void"> + </return> <argument index="0" name="bias" type="float"> </argument> <description> </description> </method> <method name="set_exclude_nodes_from_collision"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_node_a"> + <return type="void"> + </return> <argument index="0" name="node" type="NodePath"> </argument> <description> @@ -22324,6 +25062,8 @@ </description> </method> <method name="set_node_b"> + <return type="void"> + </return> <argument index="0" name="node" type="NodePath"> </argument> <description> @@ -22354,106 +25094,28 @@ Kinematic Characters: KinematicBody also has an api for moving objects (the [method move] method) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. </description> <methods> - <method name="get_collision_collider" qualifiers="const"> - <return type="Object"> - </return> - <argument index="0" name="collision" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_collision_collider_id" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="collision" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_collision_collider_metadata" qualifiers="const"> - <argument index="0" name="collision" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_collision_collider_shape" qualifiers="const"> - <return type="Object"> - </return> - <argument index="0" name="collision" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_collision_collider_shape_index" qualifiers="const"> - <return type="int"> - </return> - <argument index="0" name="collision" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_collision_collider_velocity" qualifiers="const"> - <return type="Vector3"> - </return> - <argument index="0" name="collision" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_collision_count" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="get_collision_local_shape" qualifiers="const"> - <return type="Object"> - </return> - <argument index="0" name="collision" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_collision_normal" qualifiers="const"> - <return type="Vector3"> - </return> - <argument index="0" name="collision" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_collision_position" qualifiers="const"> + <method name="get_floor_velocity" qualifiers="const"> <return type="Vector3"> </return> - <argument index="0" name="collision" type="int"> - </argument> <description> </description> </method> - <method name="get_collision_remainder" qualifiers="const"> - <return type="Vector3"> + <method name="get_safe_margin" qualifiers="const"> + <return type="float"> </return> - <argument index="0" name="collision" type="int"> - </argument> <description> </description> </method> - <method name="get_collision_travel" qualifiers="const"> - <return type="Vector3"> + <method name="get_slide_collision"> + <return type="KinematicCollision"> </return> - <argument index="0" name="collision" type="int"> + <argument index="0" name="slide_idx" type="int"> </argument> <description> </description> </method> - <method name="get_floor_velocity" qualifiers="const"> - <return type="Vector3"> - </return> - <description> - </description> - </method> - <method name="get_safe_margin" qualifiers="const"> - <return type="float"> + <method name="get_slide_count" qualifiers="const"> + <return type="int"> </return> <description> </description> @@ -22476,22 +25138,12 @@ <description> </description> </method> - <method name="move"> - <return type="Dictionary"> + <method name="move_and_collide"> + <return type="KinematicCollision"> </return> <argument index="0" name="rel_vec" type="Vector3"> </argument> <description> - Move the body in the given direction, stopping if there is an obstacle. If as a result of a movement there will be any collision then informations about this collision will be in returned dictionary. Dictionary will contains those keys: - - "position" - collision position - - "normal" - collision normal - - "local_shape" - id of this kinematic body shape that took part in a collision - - "travel" - traveled movement before being stopped - - "remainder" - remaining movement before being stopped - - "collider_id" - id of the collider, it can be used when dealing with [PhysicsServer] - - "collider" - colliding body - - "collider_shape_index" - index of the colliding shape, inside collider body "collider_metadata" - If the body did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead. Please note that this method is less user friendly than [method move_and_slide]. If you don't want to program each edge case manually, then it's recommended to use [method move_and_slide] instead. </description> </method> <method name="move_and_slide"> @@ -22499,11 +25151,11 @@ </return> <argument index="0" name="linear_velocity" type="Vector3"> </argument> - <argument index="1" name="floor_normal" type="Vector3" default="Vector3(0, 0, 0)"> + <argument index="1" name="floor_normal" type="Vector3" default="Vector3( 0, 0, 0 )"> </argument> <argument index="2" name="slope_stop_min_velocity" type="float" default="0.05"> </argument> - <argument index="3" name="max_bounces" type="int" default="4"> + <argument index="3" name="max_slides" type="int" default="4"> </argument> <argument index="4" name="floor_max_angle" type="float" default="0.785398"> </argument> @@ -22511,6 +25163,8 @@ </description> </method> <method name="set_safe_margin"> + <return type="void"> + </return> <argument index="0" name="pixels" type="float"> </argument> <description> @@ -22561,6 +25215,8 @@ </description> </method> <method name="get_collision_collider_metadata" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="collision" type="int"> </argument> <description> @@ -22690,7 +25346,7 @@ </return> <argument index="0" name="linear_velocity" type="Vector2"> </argument> - <argument index="1" name="floor_normal" type="Vector2" default="Vector2(0, 0)"> + <argument index="1" name="floor_normal" type="Vector2" default="Vector2( 0, 0 )"> </argument> <argument index="2" name="slope_stop_min_velocity" type="float" default="5"> </argument> @@ -22702,6 +25358,8 @@ </description> </method> <method name="set_safe_margin"> + <return type="void"> + </return> <argument index="0" name="pixels" type="float"> </argument> <description> @@ -22726,6 +25384,106 @@ <constants> </constants> </class> +<class name="KinematicCollision" inherits="Reference" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_collider" qualifiers="const"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="get_collider_id" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_collider_metadata" qualifiers="const"> + <return type="Variant"> + </return> + <description> + </description> + </method> + <method name="get_collider_shape" qualifiers="const"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="get_collider_shape_index" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_collider_velocity" qualifiers="const"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="get_local_shape" qualifiers="const"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="get_normal" qualifiers="const"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="get_position" qualifiers="const"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="get_remainder" qualifiers="const"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="get_travel" qualifiers="const"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + </methods> + <members> + <member name="collider" type="Object" setter="" getter="get_collider" brief=""> + </member> + <member name="collider_id" type="int" setter="" getter="get_collider_id" brief=""> + </member> + <member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata" brief=""> + </member> + <member name="collider_shape" type="Object" setter="" getter="get_collider_shape" brief=""> + </member> + <member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index" brief=""> + </member> + <member name="collider_velocity" type="Vector3" setter="" getter="get_collider_velocity" brief=""> + </member> + <member name="local_shape" type="Object" setter="" getter="get_local_shape" brief=""> + </member> + <member name="normal" type="Vector3" setter="" getter="get_normal" brief=""> + </member> + <member name="position" type="Vector3" setter="" getter="get_position" brief=""> + </member> + <member name="remainder" type="Vector3" setter="" getter="get_remainder" brief=""> + </member> + <member name="travel" type="Vector3" setter="" getter="get_travel" brief=""> + </member> + </members> + <constants> + </constants> +</class> <class name="Label" inherits="Control" category="Core"> <brief_description> Control that displays formatted text. @@ -22735,7 +25493,7 @@ </description> <methods> <method name="get_align" qualifiers="const"> - <return type="int"> + <return type="int" enum="Label.Align"> </return> <description> Return the alignment mode (any of the ALIGN_* enumeration values). @@ -22791,7 +25549,7 @@ </description> </method> <method name="get_valign" qualifiers="const"> - <return type="int"> + <return type="int" enum="Label.VAlign"> </return> <description> Return the vertical alignment mode (any of the VALIGN_* enumeration values). @@ -22832,13 +25590,17 @@ </description> </method> <method name="set_align"> - <argument index="0" name="align" type="int"> + <return type="void"> + </return> + <argument index="0" name="align" type="int" enum="Label.Align"> </argument> <description> Sets the alignment mode to any of the ALIGN_* enumeration values. </description> </method> <method name="set_autowrap"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -22846,6 +25608,8 @@ </description> </method> <method name="set_clip_text"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -22853,6 +25617,8 @@ </description> </method> <method name="set_lines_skipped"> + <return type="void"> + </return> <argument index="0" name="lines_skipped" type="int"> </argument> <description> @@ -22860,6 +25626,8 @@ </description> </method> <method name="set_max_lines_visible"> + <return type="void"> + </return> <argument index="0" name="lines_visible" type="int"> </argument> <description> @@ -22867,6 +25635,8 @@ </description> </method> <method name="set_percent_visible"> + <return type="void"> + </return> <argument index="0" name="percent_visible" type="float"> </argument> <description> @@ -22874,6 +25644,8 @@ </description> </method> <method name="set_text"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> @@ -22881,6 +25653,8 @@ </description> </method> <method name="set_uppercase"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -22888,13 +25662,17 @@ </description> </method> <method name="set_valign"> - <argument index="0" name="valign" type="int"> + <return type="void"> + </return> + <argument index="0" name="valign" type="int" enum="Label.VAlign"> </argument> <description> Sets the vertical alignment mode to any of the VALIGN_* enumeration values. </description> </method> <method name="set_visible_characters"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> @@ -22903,7 +25681,7 @@ </method> </methods> <members> - <member name="align" type="int" setter="set_align" getter="get_align" brief=""> + <member name="align" type="int" setter="set_align" getter="get_align" brief="" enum="Label.Align"> </member> <member name="autowrap" type="bool" setter="set_autowrap" getter="has_autowrap" brief=""> </member> @@ -22919,7 +25697,7 @@ </member> <member name="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase" brief=""> </member> - <member name="valign" type="int" setter="set_valign" getter="get_valign" brief=""> + <member name="valign" type="int" setter="set_valign" getter="get_valign" brief="" enum="Label.VAlign"> </member> </members> <constants> @@ -22957,6 +25735,8 @@ </theme_item> <theme_item name="line_spacing" type="int"> </theme_item> + <theme_item name="normal" type="StyleBox"> + </theme_item> <theme_item name="shadow_as_outline" type="int"> </theme_item> <theme_item name="shadow_offset_x" type="int"> @@ -22986,6 +25766,8 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clear the [LargeTexture]. </description> @@ -23016,6 +25798,8 @@ </description> </method> <method name="set_piece_offset"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="ofs" type="Vector2"> @@ -23025,6 +25809,8 @@ </description> </method> <method name="set_piece_texture"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="texture" type="Texture"> @@ -23034,6 +25820,8 @@ </description> </method> <method name="set_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> @@ -23071,7 +25859,7 @@ <method name="get_param" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="Light.Param"> </argument> <description> </description> @@ -23082,6 +25870,12 @@ <description> </description> </method> + <method name="get_shadow_reverse_cull_face" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="has_shadow" qualifiers="const"> <return type="bool"> </return> @@ -23101,31 +25895,41 @@ </description> </method> <method name="set_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_cull_mask"> + <return type="void"> + </return> <argument index="0" name="cull_mask" type="int"> </argument> <description> </description> </method> <method name="set_editor_only"> + <return type="void"> + </return> <argument index="0" name="editor_only" type="bool"> </argument> <description> </description> </method> <method name="set_negative"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_param"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="Light.Param"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -23133,17 +25937,29 @@ </description> </method> <method name="set_shadow"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_shadow_color"> + <return type="void"> + </return> <argument index="0" name="shadow_color" type="Color"> </argument> <description> </description> </method> + <method name="set_shadow_reverse_cull_face"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="editor_only" type="bool" setter="set_editor_only" getter="is_editor_only" brief=""> @@ -23168,6 +25984,8 @@ </member> <member name="shadow_max_distance" type="float" setter="set_param" getter="get_param" brief=""> </member> + <member name="shadow_reverse_cull_face" type="bool" setter="set_shadow_reverse_cull_face" getter="get_shadow_reverse_cull_face" brief=""> + </member> </members> <constants> <constant name="PARAM_ENERGY" value="0"> @@ -23196,7 +26014,7 @@ </constant> <constant name="PARAM_SHADOW_BIAS" value="12"> </constant> - <constant name="PARAM_MAX" value="13"> + <constant name="PARAM_MAX" value="14"> </constant> </constants> </class> @@ -23256,7 +26074,7 @@ </description> </method> <method name="get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Light2D.Mode"> </return> <description> Return the current mode set to the Light2D. @@ -23277,7 +26095,7 @@ </description> </method> <method name="get_shadow_filter" qualifiers="const"> - <return type="int"> + <return type="int" enum="Light2D.ShadowFilter"> </return> <description> </description> @@ -23295,7 +26113,7 @@ </description> </method> <method name="get_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> Return the texture of the Light2D. @@ -23350,6 +26168,8 @@ </description> </method> <method name="set_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> @@ -23357,12 +26177,16 @@ </description> </method> <method name="set_editor_only"> + <return type="void"> + </return> <argument index="0" name="editor_only" type="bool"> </argument> <description> </description> </method> <method name="set_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -23370,6 +26194,8 @@ </description> </method> <method name="set_energy"> + <return type="void"> + </return> <argument index="0" name="energy" type="float"> </argument> <description> @@ -23377,6 +26203,8 @@ </description> </method> <method name="set_height"> + <return type="void"> + </return> <argument index="0" name="height" type="float"> </argument> <description> @@ -23384,6 +26212,8 @@ </description> </method> <method name="set_item_cull_mask"> + <return type="void"> + </return> <argument index="0" name="item_cull_mask" type="int"> </argument> <description> @@ -23391,6 +26221,8 @@ </description> </method> <method name="set_item_shadow_cull_mask"> + <return type="void"> + </return> <argument index="0" name="item_shadow_cull_mask" type="int"> </argument> <description> @@ -23398,6 +26230,8 @@ </description> </method> <method name="set_layer_range_max"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> @@ -23405,6 +26239,8 @@ </description> </method> <method name="set_layer_range_min"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> @@ -23412,13 +26248,17 @@ </description> </method> <method name="set_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Light2D.Mode"> </argument> <description> Set the behaviour mode of the Light2D. Use constants defined in the constants section. </description> </method> <method name="set_shadow_buffer_size"> + <return type="void"> + </return> <argument index="0" name="size" type="int"> </argument> <description> @@ -23426,6 +26266,8 @@ </description> </method> <method name="set_shadow_color"> + <return type="void"> + </return> <argument index="0" name="shadow_color" type="Color"> </argument> <description> @@ -23433,6 +26275,8 @@ </description> </method> <method name="set_shadow_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -23440,31 +26284,41 @@ </description> </method> <method name="set_shadow_filter"> - <argument index="0" name="filter" type="int"> + <return type="void"> + </return> + <argument index="0" name="filter" type="int" enum="Light2D.ShadowFilter"> </argument> <description> </description> </method> <method name="set_shadow_gradient_length"> + <return type="void"> + </return> <argument index="0" name="multiplier" type="float"> </argument> <description> </description> </method> <method name="set_shadow_smooth"> + <return type="void"> + </return> <argument index="0" name="smooth" type="float"> </argument> <description> </description> </method> <method name="set_texture"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <description> Set the texture of the Light2D. </description> </method> <method name="set_texture_offset"> + <return type="void"> + </return> <argument index="0" name="texture_offset" type="Vector2"> </argument> <description> @@ -23472,6 +26326,8 @@ </description> </method> <method name="set_texture_scale"> + <return type="void"> + </return> <argument index="0" name="texture_scale" type="float"> </argument> <description> @@ -23479,6 +26335,8 @@ </description> </method> <method name="set_z_range_max"> + <return type="void"> + </return> <argument index="0" name="z" type="int"> </argument> <description> @@ -23486,6 +26344,8 @@ </description> </method> <method name="set_z_range_min"> + <return type="void"> + </return> <argument index="0" name="z" type="int"> </argument> <description> @@ -23502,7 +26362,7 @@ </member> <member name="energy" type="float" setter="set_energy" getter="get_energy" brief=""> </member> - <member name="mode" type="int" setter="set_mode" getter="get_mode" brief=""> + <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="" enum="Light2D.Mode"> </member> <member name="offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" brief=""> </member> @@ -23518,15 +26378,13 @@ </member> <member name="range_z_min" type="int" setter="set_z_range_min" getter="get_z_range_min" brief=""> </member> - <member name="scale" type="float" setter="set_texture_scale" getter="get_texture_scale" brief=""> - </member> <member name="shadow_buffer_size" type="int" setter="set_shadow_buffer_size" getter="get_shadow_buffer_size" brief=""> </member> <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" brief=""> </member> <member name="shadow_enabled" type="bool" setter="set_shadow_enabled" getter="is_shadow_enabled" brief=""> </member> - <member name="shadow_filter" type="float" setter="set_shadow_filter" getter="get_shadow_filter" brief=""> + <member name="shadow_filter" type="int" setter="set_shadow_filter" getter="get_shadow_filter" brief="" enum="Light2D.ShadowFilter"> </member> <member name="shadow_filter_smooth" type="float" setter="set_shadow_smooth" getter="get_shadow_smooth" brief=""> </member> @@ -23536,6 +26394,8 @@ </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> + <member name="texture_scale" type="float" setter="set_texture_scale" getter="get_texture_scale" brief=""> + </member> </members> <constants> <constant name="MODE_ADD" value="0"> @@ -23554,10 +26414,10 @@ </class> <class name="LightOccluder2D" inherits="Node2D" category="Core"> <brief_description> - Occludes light cast by a Light2D, thus casting shadows. + Occludes light cast by a Light2D, casting shadows. </brief_description> <description> - Occludes light cast by a Light2D, thus casting shadows. The LightOccluder2D must be provided with a shape (see OccluderPolygon2D) that allows the shadow to be computed. This shape affects the resulting shadow, while the shape of the representating asset shadowed does not actually affect shadows. + Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an [OccluderPolygon2D] in order for the shadow to be computed. </description> <methods> <method name="get_occluder_light_mask" qualifiers="const"> @@ -23575,6 +26435,8 @@ </description> </method> <method name="set_occluder_light_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> @@ -23582,6 +26444,8 @@ </description> </method> <method name="set_occluder_polygon"> + <return type="void"> + </return> <argument index="0" name="polygon" type="OccluderPolygon2D"> </argument> <description> @@ -23591,8 +26455,10 @@ </methods> <members> <member name="light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" brief=""> + The LightOccluder2D's light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s). </member> <member name="occluder" type="OccluderPolygon2D" setter="set_occluder_polygon" getter="get_occluder_polygon" brief=""> + The [OccluderPolygon2D] used to compute the shadow. </member> </members> <constants> @@ -23600,18 +26466,23 @@ </class> <class name="Line2D" inherits="Node2D" category="Core"> <brief_description> + A 2D line. </brief_description> <description> + A line through several points in 2D space. </description> <methods> <method name="add_point"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <description> + Add a point at the x/y position in the supplied [Vector2] </description> </method> <method name="get_begin_cap_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="LineCapMode"> </return> <description> </description> @@ -23623,19 +26494,19 @@ </description> </method> <method name="get_end_cap_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="LineCapMode"> </return> <description> </description> </method> <method name="get_gradient" qualifiers="const"> - <return type="Object"> + <return type="Gradient"> </return> <description> </description> </method> <method name="get_joint_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="LineJointMode"> </return> <description> </description> @@ -23673,13 +26544,13 @@ </description> </method> <method name="get_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> </description> </method> <method name="get_texture_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="LineTextureMode"> </return> <description> </description> @@ -23691,42 +26562,57 @@ </description> </method> <method name="remove_point"> + <return type="void"> + </return> <argument index="0" name="i" type="int"> </argument> <description> + Remove the point at index 'i' from the line. </description> </method> <method name="set_begin_cap_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="LineCapMode"> </argument> <description> </description> </method> <method name="set_default_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_end_cap_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="LineCapMode"> </argument> <description> </description> </method> <method name="set_gradient"> - <argument index="0" name="color" type="Object"> + <return type="void"> + </return> + <argument index="0" name="color" type="Gradient"> </argument> <description> </description> </method> <method name="set_joint_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="LineJointMode"> </argument> <description> </description> </method> <method name="set_point_pos"> + <return type="void"> + </return> <argument index="0" name="i" type="int"> </argument> <argument index="1" name="pos" type="Vector2"> @@ -23735,36 +26621,48 @@ </description> </method> <method name="set_points"> + <return type="void"> + </return> <argument index="0" name="points" type="PoolVector2Array"> </argument> <description> </description> </method> <method name="set_round_precision"> + <return type="void"> + </return> <argument index="0" name="precision" type="int"> </argument> <description> </description> </method> <method name="set_sharp_limit"> + <return type="void"> + </return> <argument index="0" name="limit" type="float"> </argument> <description> </description> </method> <method name="set_texture"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_texture_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="LineTextureMode"> </argument> <description> </description> </method> <method name="set_width"> + <return type="void"> + </return> <argument index="0" name="width" type="float"> </argument> <description> @@ -23772,15 +26670,15 @@ </method> </methods> <members> - <member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" brief=""> + <member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" brief="" enum="LineCapMode"> </member> <member name="default_color" type="Color" setter="set_default_color" getter="get_default_color" brief=""> </member> - <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" brief=""> + <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" brief="" enum="LineCapMode"> </member> <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" brief=""> </member> - <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" brief=""> + <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" brief="" enum="LineJointMode"> </member> <member name="points" type="PoolVector2Array" setter="set_points" getter="get_points" brief=""> </member> @@ -23790,7 +26688,7 @@ </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> - <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" brief=""> + <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" brief="" enum="LineTextureMode"> </member> <member name="width" type="float" setter="set_width" getter="get_width" brief=""> </member> @@ -23823,6 +26721,8 @@ </description> <methods> <method name="append_at_cursor"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> @@ -23830,6 +26730,8 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clear the [LineEdit] text. </description> @@ -23849,6 +26751,8 @@ </description> </method> <method name="cursor_set_blink_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -23856,6 +26760,8 @@ </description> </method> <method name="cursor_set_blink_speed"> + <return type="void"> + </return> <argument index="0" name="blink_speed" type="float"> </argument> <description> @@ -23863,9 +26769,10 @@ </description> </method> <method name="get_align" qualifiers="const"> - <return type="int"> + <return type="int" enum="LineEdit.Align"> </return> <description> + Return the align mode of the [LineEdit]. </description> </method> <method name="get_cursor_pos" qualifiers="const"> @@ -23892,18 +26799,21 @@ <return type="PopupMenu"> </return> <description> + Return the [PopupMenu] of this [LineEdit]. </description> </method> <method name="get_placeholder" qualifiers="const"> <return type="String"> </return> <description> + Return the placeholder text. </description> </method> <method name="get_placeholder_alpha" qualifiers="const"> <return type="float"> </return> <description> + Return transparency of the placeholder text. </description> </method> <method name="get_text" qualifiers="const"> @@ -23928,31 +26838,49 @@ </description> </method> <method name="menu_option"> + <return type="void"> + </return> <argument index="0" name="option" type="int"> </argument> <description> + Execute a given action as defined in the MENU_* enum. </description> </method> <method name="select"> + <return type="void"> + </return> <argument index="0" name="from" type="int" default="0"> </argument> <argument index="1" name="to" type="int" default="-1"> </argument> <description> + Select the text inside [LineEdit] by the given character positions. [code]from[/code] is default to the beginning. [code]to[/code] is default to the end. + [codeblock] + select() # select all + select(5) # select from the fifth character to the end. + select(2, 5) # select from the second to the fifth character. + [/codeblock] </description> </method> <method name="select_all"> + <return type="void"> + </return> <description> Select the whole string. </description> </method> <method name="set_align"> - <argument index="0" name="align" type="int"> + <return type="void"> + </return> + <argument index="0" name="align" type="int" enum="LineEdit.Align"> </argument> <description> + Set text alignment of the [LineEdit]. </description> </method> <method name="set_cursor_pos"> + <return type="void"> + </return> <argument index="0" name="pos" type="int"> </argument> <description> @@ -23960,6 +26888,8 @@ </description> </method> <method name="set_editable"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -23967,12 +26897,16 @@ </description> </method> <method name="set_expand_to_text_length"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_max_length"> + <return type="void"> + </return> <argument index="0" name="chars" type="int"> </argument> <description> @@ -23980,18 +26914,26 @@ </description> </method> <method name="set_placeholder"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> + Set the placeholder text. </description> </method> <method name="set_placeholder_alpha"> + <return type="void"> + </return> <argument index="0" name="alpha" type="float"> </argument> <description> + Set transparency of the placeholder text. </description> </method> <method name="set_secret"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -23999,6 +26941,8 @@ </description> </method> <method name="set_text"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> @@ -24007,7 +26951,7 @@ </method> </methods> <members> - <member name="align" type="int" setter="set_align" getter="get_align" brief=""> + <member name="align" type="int" setter="set_align" getter="get_align" brief="" enum="LineEdit.Align"> </member> <member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" brief=""> </member> @@ -24017,7 +26961,7 @@ </member> <member name="expand_to_len" type="bool" setter="set_expand_to_text_length" getter="get_expand_to_text_length" brief=""> </member> - <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" brief=""> + <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" brief="" enum="Control.FocusMode"> </member> <member name="max_length" type="int" setter="set_max_length" getter="get_max_length" brief=""> </member> @@ -24048,24 +26992,34 @@ </signals> <constants> <constant name="ALIGN_LEFT" value="0"> + Align left. </constant> <constant name="ALIGN_CENTER" value="1"> + Align center. </constant> <constant name="ALIGN_RIGHT" value="2"> + Align right. </constant> <constant name="ALIGN_FILL" value="3"> + Align fill. </constant> <constant name="MENU_CUT" value="0"> + Cut (Copy and clear). </constant> <constant name="MENU_COPY" value="1"> + Copy the selected text. </constant> <constant name="MENU_PASTE" value="2"> + Paste the clipboard text over the selected text. </constant> <constant name="MENU_CLEAR" value="3"> + Clear the text. </constant> <constant name="MENU_SELECT_ALL" value="4"> + Select all text. </constant> <constant name="MENU_UNDO" value="5"> + Undo an action. </constant> <constant name="MENU_MAX" value="6"> </constant> @@ -24114,6 +27068,8 @@ </description> </method> <method name="set_d"> + <return type="void"> + </return> <argument index="0" name="d" type="float"> </argument> <description> @@ -24121,6 +27077,8 @@ </description> </method> <method name="set_normal"> + <return type="void"> + </return> <argument index="0" name="normal" type="Vector2"> </argument> <description> @@ -24153,13 +27111,15 @@ </description> </method> <method name="get_underline_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="LinkButton.UnderlineMode"> </return> <description> Returns the underline mode for this button. </description> </method> <method name="set_text"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> @@ -24167,7 +27127,9 @@ </description> </method> <method name="set_underline_mode"> - <argument index="0" name="underline_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="underline_mode" type="int" enum="LinkButton.UnderlineMode"> </argument> <description> Sets the underline mode for this button, the argument must be one of the [LinkButton] constants (see constants section). @@ -24177,7 +27139,7 @@ <members> <member name="text" type="String" setter="set_text" getter="get_text" brief=""> </member> - <member name="underline" type="int" setter="set_underline_mode" getter="get_underline_mode" brief=""> + <member name="underline" type="int" setter="set_underline_mode" getter="get_underline_mode" brief="" enum="LinkButton.UnderlineMode"> </member> </members> <constants> @@ -24211,6 +27173,8 @@ </description> <methods> <method name="clear_current"> + <return type="void"> + </return> <description> </description> </method> @@ -24227,6 +27191,8 @@ </description> </method> <method name="make_current"> + <return type="void"> + </return> <description> </description> </method> @@ -24243,6 +27209,8 @@ </description> <methods> <method name="_drop_files" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="files" type="PoolStringArray"> </argument> <argument index="1" name="screen" type="int"> @@ -24251,38 +27219,55 @@ </description> </method> <method name="_finalize" qualifiers="virtual"> + <return type="void"> + </return> <description> + Called before the program exits. </description> </method> <method name="_idle" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="delta" type="float"> </argument> <description> + Called each idle frame with time since last call as an only argument. </description> </method> <method name="_initialize" qualifiers="virtual"> + <return type="void"> + </return> <description> + Called once during initialization. </description> </method> <method name="_input_event" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="ev" type="InputEvent"> </argument> <description> </description> </method> <method name="_input_text" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> </description> </method> <method name="_iteration" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="delta" type="float"> </argument> <description> </description> </method> <method name="finish"> + <return type="void"> + </return> <description> </description> </method> @@ -24295,16 +27280,22 @@ </description> </method> <method name="init"> + <return type="void"> + </return> <description> </description> </method> <method name="input_event"> - <argument index="0" name="ev" type="Object"> + <return type="void"> + </return> + <argument index="0" name="ev" type="InputEvent"> </argument> <description> </description> </method> <method name="input_text"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> @@ -24320,19 +27311,23 @@ </method> </methods> <constants> - <constant name="NOTIFICATION_WM_MOUSE_ENTER" value="2"> + <constant name="NOTIFICATION_WM_MOUSE_ENTER" value="2" enum=""> + </constant> + <constant name="NOTIFICATION_WM_MOUSE_EXIT" value="3" enum=""> + </constant> + <constant name="NOTIFICATION_WM_FOCUS_IN" value="4" enum=""> </constant> - <constant name="NOTIFICATION_WM_MOUSE_EXIT" value="3"> + <constant name="NOTIFICATION_WM_FOCUS_OUT" value="5" enum=""> </constant> - <constant name="NOTIFICATION_WM_FOCUS_IN" value="4"> + <constant name="NOTIFICATION_WM_QUIT_REQUEST" value="6" enum=""> </constant> - <constant name="NOTIFICATION_WM_FOCUS_OUT" value="5"> + <constant name="NOTIFICATION_WM_UNFOCUS_REQUEST" value="8" enum=""> </constant> - <constant name="NOTIFICATION_WM_QUIT_REQUEST" value="6"> + <constant name="NOTIFICATION_OS_MEMORY_WARNING" value="9" enum=""> </constant> - <constant name="NOTIFICATION_WM_UNFOCUS_REQUEST" value="8"> + <constant name="NOTIFICATION_TRANSLATION_CHANGED" value="90" enum=""> </constant> - <constant name="NOTIFICATION_OS_MEMORY_WARNING" value="9"> + <constant name="NOTIFICATION_WM_ABOUT" value="91" enum=""> </constant> </constants> </class> @@ -24370,6 +27365,7 @@ <argument index="0" name="base64_str" type="String"> </argument> <description> + Return [PoolByteArray] of a given base64 encoded String. </description> </method> <method name="base64_to_utf8"> @@ -24378,6 +27374,7 @@ <argument index="0" name="base64_str" type="String"> </argument> <description> + Return utf8 String of a given base64 encoded String. </description> </method> <method name="base64_to_variant"> @@ -24386,6 +27383,7 @@ <argument index="0" name="base64_str" type="String"> </argument> <description> + Return [Variant] of a given base64 encoded String. </description> </method> <method name="raw_to_base64"> @@ -24394,6 +27392,7 @@ <argument index="0" name="array" type="PoolByteArray"> </argument> <description> + Return base64 encoded String of a given [PoolByteArray]. </description> </method> <method name="utf8_to_base64"> @@ -24402,6 +27401,7 @@ <argument index="0" name="utf8_str" type="String"> </argument> <description> + Return base64 encoded String of a given utf8 String. </description> </method> <method name="variant_to_base64"> @@ -24410,6 +27410,7 @@ <argument index="0" name="variant" type="Variant"> </argument> <description> + Return base64 encoded String of a given [Variant]. </description> </method> </methods> @@ -24430,18 +27431,40 @@ <description> </description> </method> + <method name="get_render_priority" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="set_next_pass"> + <return type="void"> + </return> <argument index="0" name="next_pass" type="Material"> </argument> <description> </description> </method> + <method name="set_render_priority"> + <return type="void"> + </return> + <argument index="0" name="priority" type="int"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="next_pass" type="Material" setter="set_next_pass" getter="get_next_pass" brief=""> </member> + <member name="render_priority" type="int" setter="set_render_priority" getter="get_render_priority" brief=""> + </member> </members> <constants> + <constant name="RENDER_PRIORITY_MAX" value="127" enum=""> + </constant> + <constant name="RENDER_PRIORITY_MIN" value="-128" enum=""> + </constant> </constants> </class> <class name="MenuButton" inherits="Button" category="Core"> @@ -24467,6 +27490,7 @@ <signals> <signal name="about_to_show"> <description> + Emitted when [PopupMenu] of this MenuButton is about to show. </description> </signal> </signals> @@ -24509,32 +27533,37 @@ <return type="Shape"> </return> <description> + Calculate a [ConvexPolygonShape] from the mesh. </description> </method> <method name="create_outline" qualifiers="const"> - <return type="ArrayMesh"> + <return type="Mesh"> </return> <argument index="0" name="margin" type="float"> </argument> <description> + Calculate an outline mesh at a defined offset (margin) from the original mesh. Note: Typically returns the vertices in reverse order (e.g. clockwise to anti-clockwise). </description> </method> <method name="create_trimesh_shape" qualifiers="const"> <return type="Shape"> </return> <description> + Calculate a [ConcavePolygonShape] from the mesh. </description> </method> <method name="generate_triangle_mesh" qualifiers="const"> <return type="TriangleMesh"> </return> <description> + Generate a [TriangleMesh] from the mesh. </description> </method> <method name="get_faces" qualifiers="const"> <return type="PoolVector3Array"> </return> <description> + Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle. </description> </method> </methods> @@ -24569,21 +27598,23 @@ </description> <methods> <method name="clear"> + <return type="void"> + </return> <description> </description> </method> <method name="commit_to_surface"> - <return type="int"> + <return type="int" enum="Error"> </return> - <argument index="0" name="mesh" type="Object"> + <argument index="0" name="mesh" type="ArrayMesh"> </argument> <description> </description> </method> <method name="create_from_surface"> - <return type="int"> + <return type="int" enum="Error"> </return> - <argument index="0" name="mesh" type="Object"> + <argument index="0" name="mesh" type="ArrayMesh"> </argument> <argument index="1" name="surface" type="int"> </argument> @@ -24671,7 +27702,7 @@ </description> </method> <method name="get_material" qualifiers="const"> - <return type="Object"> + <return type="Material"> </return> <description> </description> @@ -24771,6 +27802,8 @@ </description> </method> <method name="set_edge_meta"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="meta" type="Variant"> @@ -24779,6 +27812,8 @@ </description> </method> <method name="set_face_meta"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="meta" type="Variant"> @@ -24787,12 +27822,16 @@ </description> </method> <method name="set_material"> + <return type="void"> + </return> <argument index="0" name="material" type="Material"> </argument> <description> </description> </method> <method name="set_vertex"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="vertex" type="Vector3"> @@ -24801,6 +27840,8 @@ </description> </method> <method name="set_vertex_bones"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="bones" type="PoolIntArray"> @@ -24809,6 +27850,8 @@ </description> </method> <method name="set_vertex_color"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="color" type="Color"> @@ -24817,6 +27860,8 @@ </description> </method> <method name="set_vertex_meta"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="meta" type="Variant"> @@ -24825,6 +27870,8 @@ </description> </method> <method name="set_vertex_normal"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="normal" type="Vector3"> @@ -24833,6 +27880,8 @@ </description> </method> <method name="set_vertex_tangent"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="tangent" type="Plane"> @@ -24841,6 +27890,8 @@ </description> </method> <method name="set_vertex_uv"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="uv" type="Vector2"> @@ -24849,6 +27900,8 @@ </description> </method> <method name="set_vertex_uv2"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="uv2" type="Vector2"> @@ -24857,6 +27910,8 @@ </description> </method> <method name="set_vertex_weights"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="weights" type="PoolRealArray"> @@ -24877,23 +27932,30 @@ </description> <methods> <method name="create_convex_collision"> + <return type="void"> + </return> <description> + This helper creates a [StaticBody] child [Node] with a [ConvexPolygonShape] [CollisionShape] calculated from the mesh geometry. It's mainly used for testing. </description> </method> <method name="create_debug_tangents"> + <return type="void"> + </return> <description> </description> </method> <method name="create_trimesh_collision"> + <return type="void"> + </return> <description> - This helper creates a [StaticBody] child [Node] using the mesh geometry as collision. It's mainly used for testing. + This helper creates a [StaticBody] child [Node] with a [ConcavePolygonShape] [CollisionShape] calculated from the mesh geometry. It's mainly used for testing. </description> </method> <method name="get_mesh" qualifiers="const"> <return type="Mesh"> </return> <description> - Return the current [Mesh] resource for the instance. + Returns the current [Mesh] resource for the instance. </description> </method> <method name="get_skeleton_path"> @@ -24908,34 +27970,43 @@ <argument index="0" name="surface" type="int"> </argument> <description> + Returns the [Material] for a surface of the [Mesh] resource. </description> </method> <method name="set_mesh"> + <return type="void"> + </return> <argument index="0" name="mesh" type="Mesh"> </argument> <description> - Set the [Mesh] resource for the instance. </description> </method> <method name="set_skeleton_path"> + <return type="void"> + </return> <argument index="0" name="skeleton_path" type="NodePath"> </argument> <description> </description> </method> <method name="set_surface_material"> + <return type="void"> + </return> <argument index="0" name="surface" type="int"> </argument> <argument index="1" name="material" type="Material"> </argument> <description> + Sets the [Material] for a surface of the [Mesh] resource. </description> </method> </methods> <members> <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" brief=""> + The [Mesh] resource for the instance. </member> <member name="skeleton" type="NodePath" setter="set_skeleton_path" getter="get_skeleton_path" brief=""> + [NodePath] to the [Skeleton] associated with the instance. </member> </members> <constants> @@ -24950,17 +28021,29 @@ </description> <methods> <method name="clear"> + <return type="void"> + </return> <description> Clear the library. </description> </method> <method name="create_item"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> Create a new item in the library, supplied an id. </description> </method> + <method name="find_item_by_name" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> <method name="get_item_list" qualifiers="const"> <return type="PoolIntArray"> </return> @@ -24994,8 +28077,16 @@ <description> </description> </method> - <method name="get_item_shape" qualifiers="const"> - <return type="Shape"> + <method name="get_item_preview" qualifiers="const"> + <return type="Texture"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_item_shapes" qualifiers="const"> + <return type="Array"> </return> <argument index="0" name="id" type="int"> </argument> @@ -25010,6 +28101,8 @@ </description> </method> <method name="remove_item"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> @@ -25017,6 +28110,8 @@ </description> </method> <method name="set_item_mesh"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="mesh" type="Mesh"> @@ -25026,6 +28121,8 @@ </description> </method> <method name="set_item_name"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="name" type="String"> @@ -25035,6 +28132,8 @@ </description> </method> <method name="set_item_navmesh"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="navmesh" type="NavigationMesh"> @@ -25042,10 +28141,22 @@ <description> </description> </method> - <method name="set_item_shape"> + <method name="set_item_preview"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> - <argument index="1" name="shape" type="Shape"> + <argument index="1" name="texture" type="Texture"> + </argument> + <description> + </description> + </method> + <method name="set_item_shapes"> + <return type="void"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="shapes" type="Array"> </argument> <description> </description> @@ -25073,7 +28184,7 @@ </description> </method> <method name="get_color_format" qualifiers="const"> - <return type="int"> + <return type="int" enum="MultiMesh.ColorFormat"> </return> <description> </description> @@ -25111,18 +28222,22 @@ </description> </method> <method name="get_transform_format" qualifiers="const"> - <return type="int"> + <return type="int" enum="MultiMesh.TransformFormat"> </return> <description> </description> </method> <method name="set_color_format"> - <argument index="0" name="format" type="int"> + <return type="void"> + </return> + <argument index="0" name="format" type="int" enum="MultiMesh.ColorFormat"> </argument> <description> </description> </method> <method name="set_instance_color"> + <return type="void"> + </return> <argument index="0" name="instance" type="int"> </argument> <argument index="1" name="color" type="Color"> @@ -25132,6 +28247,8 @@ </description> </method> <method name="set_instance_count"> + <return type="void"> + </return> <argument index="0" name="count" type="int"> </argument> <description> @@ -25139,6 +28256,8 @@ </description> </method> <method name="set_instance_transform"> + <return type="void"> + </return> <argument index="0" name="instance" type="int"> </argument> <argument index="1" name="transform" type="Transform"> @@ -25148,6 +28267,8 @@ </description> </method> <method name="set_mesh"> + <return type="void"> + </return> <argument index="0" name="mesh" type="Mesh"> </argument> <description> @@ -25155,7 +28276,9 @@ </description> </method> <method name="set_transform_format"> - <argument index="0" name="format" type="int"> + <return type="void"> + </return> + <argument index="0" name="format" type="int" enum="MultiMesh.TransformFormat"> </argument> <description> </description> @@ -25164,7 +28287,7 @@ <members> <member name="color_array" type="PoolColorArray" setter="_set_color_array" getter="_get_color_array" brief=""> </member> - <member name="color_format" type="int" setter="set_color_format" getter="get_color_format" brief=""> + <member name="color_format" type="int" setter="set_color_format" getter="get_color_format" brief="" enum="MultiMesh.ColorFormat"> </member> <member name="instance_count" type="int" setter="set_instance_count" getter="get_instance_count" brief=""> </member> @@ -25172,7 +28295,7 @@ </member> <member name="transform_array" type="PoolVector3Array" setter="_set_transform_array" getter="_get_transform_array" brief=""> </member> - <member name="transform_format" type="int" setter="set_transform_format" getter="get_transform_format" brief=""> + <member name="transform_format" type="int" setter="set_transform_format" getter="get_transform_format" brief="" enum="MultiMesh.TransformFormat"> </member> </members> <constants> @@ -25197,17 +28320,19 @@ </description> <methods> <method name="get_multimesh" qualifiers="const"> - <return type="Object"> + <return type="MultiMesh"> </return> <description> Return the [MultiMesh] that is used for instancing. </description> </method> <method name="set_multimesh"> - <argument index="0" name="multimesh" type="Object"> + <return type="void"> + </return> + <argument index="0" name="multimesh" type="MultiMesh"> </argument> <description> - Set the [MultiMesh] to be instance. + Set the [MultiMesh] to be instanced. </description> </method> </methods> @@ -25227,18 +28352,22 @@ </description> <methods> <method name="lock"> + <return type="void"> + </return> <description> Lock this [Mutex], blocks until it is unlocked by the current owner. </description> </method> <method name="try_lock"> - <return type="Error"> + <return type="int" enum="Error"> </return> <description> Try locking this [Mutex], does not block. Returns [OK] on success else [ERR_BUSY]. </description> </method> <method name="unlock"> + <return type="void"> + </return> <description> Unlock this [Mutex], leaving it to others threads. </description> @@ -25247,6 +28376,56 @@ <constants> </constants> </class> +<class name="NativeScript" inherits="Script" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_class_name" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_library" qualifiers="const"> + <return type="GDNativeLibrary"> + </return> + <description> + </description> + </method> + <method name="new" qualifiers="vararg"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="set_class_name"> + <return type="void"> + </return> + <argument index="0" name="class_name" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_library"> + <return type="void"> + </return> + <argument index="0" name="library" type="GDNativeLibrary"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="class_name" type="String" setter="set_class_name" getter="get_class_name" brief=""> + </member> + <member name="library" type="GDNativeLibrary" setter="set_library" getter="get_library" brief=""> + </member> + </members> + <constants> + </constants> +</class> <class name="Navigation" inherits="Spatial" category="Core"> <brief_description> </brief_description> @@ -25314,18 +28493,22 @@ </argument> <argument index="1" name="xform" type="Transform"> </argument> - <argument index="2" name="owner" type="Object" default="NULL"> + <argument index="2" name="owner" type="Object" default="null"> </argument> <description> </description> </method> <method name="navmesh_remove"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> </description> </method> <method name="navmesh_set_transform"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="xform" type="Transform"> @@ -25334,6 +28517,8 @@ </description> </method> <method name="set_up_vector"> + <return type="void"> + </return> <argument index="0" name="up" type="Vector3"> </argument> <description> @@ -25388,18 +28573,22 @@ </argument> <argument index="1" name="xform" type="Transform2D"> </argument> - <argument index="2" name="owner" type="Object" default="NULL"> + <argument index="2" name="owner" type="Object" default="null"> </argument> <description> </description> </method> <method name="navpoly_remove"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> </description> </method> <method name="navpoly_set_transform"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="xform" type="Transform2D"> @@ -25418,12 +28607,24 @@ </description> <methods> <method name="add_polygon"> + <return type="void"> + </return> <argument index="0" name="polygon" type="PoolIntArray"> </argument> <description> </description> </method> <method name="clear_polygons"> + <return type="void"> + </return> + <description> + </description> + </method> + <method name="create_from_mesh"> + <return type="void"> + </return> + <argument index="0" name="mesh" type="Mesh"> + </argument> <description> </description> </method> @@ -25448,6 +28649,8 @@ </description> </method> <method name="set_vertices"> + <return type="void"> + </return> <argument index="0" name="vertices" type="PoolVector3Array"> </argument> <description> @@ -25470,7 +28673,7 @@ </description> <methods> <method name="get_navigation_mesh" qualifiers="const"> - <return type="Object"> + <return type="NavigationMesh"> </return> <description> </description> @@ -25482,13 +28685,17 @@ </description> </method> <method name="set_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_navigation_mesh"> - <argument index="0" name="navmesh" type="Object"> + <return type="void"> + </return> + <argument index="0" name="navmesh" type="NavigationMesh"> </argument> <description> </description> @@ -25510,12 +28717,16 @@ </description> <methods> <method name="add_outline"> + <return type="void"> + </return> <argument index="0" name="outline" type="PoolVector2Array"> </argument> <description> </description> </method> <method name="add_outline_at_index"> + <return type="void"> + </return> <argument index="0" name="outline" type="PoolVector2Array"> </argument> <argument index="1" name="index" type="int"> @@ -25524,16 +28735,22 @@ </description> </method> <method name="add_polygon"> + <return type="void"> + </return> <argument index="0" name="polygon" type="PoolIntArray"> </argument> <description> </description> </method> <method name="clear_outlines"> + <return type="void"> + </return> <description> </description> </method> <method name="clear_polygons"> + <return type="void"> + </return> <description> </description> </method> @@ -25572,16 +28789,22 @@ </description> </method> <method name="make_polygons_from_outlines"> + <return type="void"> + </return> <description> </description> </method> <method name="remove_outline"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> </description> </method> <method name="set_outline"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="outline" type="PoolVector2Array"> @@ -25590,6 +28813,8 @@ </description> </method> <method name="set_vertices"> + <return type="void"> + </return> <argument index="0" name="vertices" type="PoolVector2Array"> </argument> <description> @@ -25601,7 +28826,7 @@ </member> <member name="polygons" type="Array" setter="_set_polygons" getter="_get_polygons" brief=""> </member> - <member name="vertices" type="PoolVector3Array" setter="set_vertices" getter="get_vertices" brief=""> + <member name="vertices" type="PoolVector2Array" setter="set_vertices" getter="get_vertices" brief=""> </member> </members> <constants> @@ -25626,12 +28851,16 @@ </description> </method> <method name="set_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_navigation_polygon"> + <return type="void"> + </return> <argument index="0" name="navpoly" type="NavigationPolygon"> </argument> <description> @@ -25656,11 +28885,13 @@ </description> <methods> <method name="close_connection"> + <return type="void"> + </return> <description> </description> </method> <method name="create_client"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="ip" type="String"> </argument> @@ -25671,10 +28902,11 @@ <argument index="3" name="out_bandwidth" type="int" default="0"> </argument> <description> + Create client that connects to a server at address [code]ip[/code] using specified [code]port[/code]. </description> </method> <method name="create_server"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="port" type="int"> </argument> @@ -25685,22 +28917,27 @@ <argument index="3" name="out_bandwidth" type="int" default="0"> </argument> <description> + Create server that listens to connections via [code]port[/code]. </description> </method> <method name="get_compression_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="NetworkedMultiplayerENet.CompressionMode"> </return> <description> </description> </method> <method name="set_bind_ip"> + <return type="void"> + </return> <argument index="0" name="ip" type="String"> </argument> <description> </description> </method> <method name="set_compression_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="NetworkedMultiplayerENet.CompressionMode"> </argument> <description> </description> @@ -25726,7 +28963,7 @@ </description> <methods> <method name="get_connection_status" qualifiers="const"> - <return type="int"> + <return type="int" enum="NetworkedMultiplayerPeer.ConnectionStatus"> </return> <description> </description> @@ -25747,26 +28984,36 @@ <return type="bool"> </return> <description> + Return whether this [NetworkedMultiplayerPeer] is refusing new connections. </description> </method> <method name="poll"> + <return type="void"> + </return> <description> </description> </method> <method name="set_refuse_new_connections"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> + If [code]endable[/code] is true, this [NetworkedMultiplayerPeer] will refuse new connections. </description> </method> <method name="set_target_peer"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> </description> </method> <method name="set_transfer_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="NetworkedMultiplayerPeer.TransferMode"> </argument> <description> </description> @@ -25775,26 +29022,31 @@ <signals> <signal name="connection_failed"> <description> + Emitted when failed to connect to server. </description> </signal> <signal name="connection_succeeded"> <description> + Emitted when successfully connected to server. </description> </signal> <signal name="peer_connected"> <argument index="0" name="id" type="int"> </argument> <description> + Emitted by the server when a client is connected. </description> </signal> <signal name="peer_disconnected"> <argument index="0" name="id" type="int"> </argument> <description> + Emitted by the server when a client is disconnected. </description> </signal> <signal name="server_disconnected"> <description> + Emitted by clients when server is disconnected. </description> </signal> </signals> @@ -25811,9 +29063,9 @@ </constant> <constant name="CONNECTION_CONNECTED" value="2"> </constant> - <constant name="TARGET_PEER_BROADCAST" value="0"> + <constant name="TARGET_PEER_BROADCAST" value="0" enum=""> </constant> - <constant name="TARGET_PEER_SERVER" value="1"> + <constant name="TARGET_PEER_SERVER" value="1" enum=""> </constant> </constants> </class> @@ -25989,14 +29241,8 @@ <description> </description> <methods> - <method name="is_draw_center_enabled" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> <method name="get_h_axis_stretch_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="NinePatchRect.AxisStretchMode"> </return> <description> </description> @@ -26004,7 +29250,7 @@ <method name="get_patch_margin" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> </description> @@ -26016,31 +29262,43 @@ </description> </method> <method name="get_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> </description> </method> <method name="get_v_axis_stretch_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="NinePatchRect.AxisStretchMode"> + </return> + <description> + </description> + </method> + <method name="is_draw_center_enabled" qualifiers="const"> + <return type="bool"> </return> <description> </description> </method> <method name="set_draw_center"> + <return type="void"> + </return> <argument index="0" name="draw_center" type="bool"> </argument> <description> </description> </method> <method name="set_h_axis_stretch_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="NinePatchRect.AxisStretchMode"> </argument> <description> </description> </method> <method name="set_patch_margin"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <argument index="1" name="value" type="int"> </argument> @@ -26048,28 +29306,34 @@ </description> </method> <method name="set_region_rect"> + <return type="void"> + </return> <argument index="0" name="rect" type="Rect2"> </argument> <description> </description> </method> <method name="set_texture"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_v_axis_stretch_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="NinePatchRect.AxisStretchMode"> </argument> <description> </description> </method> </methods> <members> - <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" brief=""> + <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" brief="" enum="NinePatchRect.AxisStretchMode"> </member> - <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" brief=""> + <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" brief="" enum="NinePatchRect.AxisStretchMode"> </member> <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" brief=""> </member> @@ -26119,18 +29383,24 @@ </description> <methods> <method name="_enter_tree" qualifiers="virtual"> + <return type="void"> + </return> <description> Called when the node enters the [SceneTree] (e.g. upon instancing, scene changing or after calling [method add_child] in a script). If the node has children, its [method _enter_tree] callback will be called first, and then that of the children. Corresponds to the NOTIFICATION_ENTER_TREE notification in [method Object._notification]. </description> </method> <method name="_exit_tree" qualifiers="virtual"> + <return type="void"> + </return> <description> Called when the node leaves the [SceneTree] (e.g. upon freeing, scene changing or after calling [method remove_child] in a script). If the node has children, its [method _exit_tree] callback will be called last, after all its children have left the tree. Corresponds to the NOTIFICATION_EXIT_TREE notification in [method Object._notification]. </description> </method> <method name="_fixed_process" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="delta" type="float"> </argument> <description> @@ -26140,12 +29410,17 @@ </description> </method> <method name="_input" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="event" type="InputEvent"> </argument> <description> + Called when there is a change to input devices. Propagated through the node tree until a Node consumes it. </description> </method> <method name="_process" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="delta" type="float"> </argument> <description> @@ -26155,24 +29430,33 @@ </description> </method> <method name="_ready" qualifiers="virtual"> + <return type="void"> + </return> <description> Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their [method _ready] callback gets triggered first, and the node will receive the ready notification only afterwards. Corresponds to the NOTIFICATION_READY notification in [method Object._notification]. </description> </method> <method name="_unhandled_input" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="event" type="InputEvent"> </argument> <description> + Propagated to all nodes when the previous InputEvent is not consumed by any nodes. </description> </method> <method name="_unhandled_key_input" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="event" type="InputEventKey"> </argument> <description> </description> </method> <method name="add_child"> + <return type="void"> + </return> <argument index="0" name="node" type="Node"> </argument> <argument index="1" name="legible_unique_name" type="bool" default="false"> @@ -26183,6 +29467,8 @@ </description> </method> <method name="add_to_group"> + <return type="void"> + </return> <argument index="0" name="group" type="String"> </argument> <argument index="1" name="persistent" type="bool" default="false"> @@ -26352,15 +29638,17 @@ </description> </method> <method name="get_pause_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Node.PauseMode"> </return> <description> + Return the pause mode (PAUSE_MODE_*) of this Node. </description> </method> <method name="get_position_in_parent" qualifiers="const"> <return type="int"> </return> <description> + Return the order in the node tree branch, i.e. if called by the first child Node, return 0. </description> </method> <method name="get_process_delta_time" qualifiers="const"> @@ -26380,10 +29668,11 @@ <return type="SceneTree"> </return> <description> + Return a [SceneTree] that this node is inside. </description> </method> <method name="get_viewport" qualifiers="const"> - <return type="Object"> + <return type="Viewport"> </return> <description> </description> @@ -26394,6 +29683,7 @@ <argument index="0" name="path" type="NodePath"> </argument> <description> + Return whether the node that a given [NodePath] points too exists. </description> </method> <method name="has_node_and_resource" qualifiers="const"> @@ -26447,12 +29737,14 @@ <argument index="0" name="group" type="String"> </argument> <description> + Return whether this Node is in the specified group. </description> </method> <method name="is_inside_tree" qualifiers="const"> <return type="bool"> </return> <description> + Return whether this Node is inside a [SceneTree]. </description> </method> <method name="is_network_master" qualifiers="const"> @@ -26495,6 +29787,8 @@ </description> </method> <method name="move_child"> + <return type="void"> + </return> <argument index="0" name="child_node" type="Node"> </argument> <argument index="1" name="to_pos" type="int"> @@ -26504,25 +29798,24 @@ </description> </method> <method name="print_stray_nodes"> + <return type="void"> + </return> <description> </description> </method> <method name="print_tree"> + <return type="void"> + </return> <description> Print the scene to stdout. Used mainly for debugging purposes. </description> </method> - <method name="propagate_notification"> - <argument index="0" name="what" type="int"> - </argument> - <description> - Notify the current node and all its children recursively by calling notification() in all of them. - </description> - </method> <method name="propagate_call"> + <return type="void"> + </return> <argument index="0" name="method" type="String"> </argument> - <argument index="1" name="args" type="Array" default="[]"> + <argument index="1" name="args" type="Array" default="[ ]"> </argument> <argument index="2" name="parent_first" type="bool" default="false"> </argument> @@ -26530,21 +29823,39 @@ Calls the method (if present) with the arguments given in "args" on this Node and recursively on all children. If the parent_first argument is true then the method will be called on the current [Node] first, then on all children. If it is false then the children will get called first. </description> </method> + <method name="propagate_notification"> + <return type="void"> + </return> + <argument index="0" name="what" type="int"> + </argument> + <description> + Notify the current node and all its children recursively by calling notification() in all of them. + </description> + </method> <method name="queue_free"> + <return type="void"> + </return> <description> + Queues a node for deletion at the end of the current frame. When deleted, all of its children nodes will be deleted as well. This method ensures it's safe to delete the node, contrary to [method Object.free]. Use [method Object.is_queued_for_deletion] to know whether a node will be deleted at the end of the frame. </description> </method> <method name="raise"> + <return type="void"> + </return> <description> Move this node to the top of the array of nodes of the parent node. This is often useful on GUIs ([Control]), because their order of drawing fully depends on their order in the tree. </description> </method> <method name="remove_and_skip"> + <return type="void"> + </return> <description> Remove a node and set all its children as children of the parent node (if exists). All even subscriptions that pass by the removed node will be unsubscribed. </description> </method> <method name="remove_child"> + <return type="void"> + </return> <argument index="0" name="node" type="Node"> </argument> <description> @@ -26552,6 +29863,8 @@ </description> </method> <method name="remove_from_group"> + <return type="void"> + </return> <argument index="0" name="group" type="String"> </argument> <description> @@ -26559,6 +29872,8 @@ </description> </method> <method name="replace_by"> + <return type="void"> + </return> <argument index="0" name="node" type="Node"> </argument> <argument index="1" name="keep_data" type="bool" default="false"> @@ -26568,10 +29883,15 @@ </description> </method> <method name="request_ready"> + <return type="void"> + </return> <description> + Request that [code]_ready[/code] be called again. </description> </method> <method name="rpc" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="method" type="String"> </argument> <description> @@ -26579,15 +29899,19 @@ </description> </method> <method name="rpc_config"> + <return type="void"> + </return> <argument index="0" name="method" type="String"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="Node.RPCMode"> </argument> <description> Change the method's RPC mode (one of RPC_MODE_* constants). </description> </method> <method name="rpc_id" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="peer_id" type="int"> </argument> <argument index="1" name="method" type="String"> @@ -26597,6 +29921,8 @@ </description> </method> <method name="rpc_unreliable" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="method" type="String"> </argument> <description> @@ -26604,6 +29930,8 @@ </description> </method> <method name="rpc_unreliable_id" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="peer_id" type="int"> </argument> <argument index="1" name="method" type="String"> @@ -26613,6 +29941,8 @@ </description> </method> <method name="rset"> + <return type="void"> + </return> <argument index="0" name="property" type="String"> </argument> <argument index="1" name="value" type="Variant"> @@ -26622,15 +29952,19 @@ </description> </method> <method name="rset_config"> + <return type="void"> + </return> <argument index="0" name="property" type="String"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="Node.RPCMode"> </argument> <description> Change the property's RPC mode (one of RPC_MODE_* constants). </description> </method> <method name="rset_id"> + <return type="void"> + </return> <argument index="0" name="peer_id" type="int"> </argument> <argument index="1" name="property" type="String"> @@ -26642,6 +29976,8 @@ </description> </method> <method name="rset_unreliable"> + <return type="void"> + </return> <argument index="0" name="property" type="String"> </argument> <argument index="1" name="value" type="Variant"> @@ -26651,6 +29987,8 @@ </description> </method> <method name="rset_unreliable_id"> + <return type="void"> + </return> <argument index="0" name="peer_id" type="int"> </argument> <argument index="1" name="property" type="String"> @@ -26662,12 +30000,16 @@ </description> </method> <method name="set_display_folded"> + <return type="void"> + </return> <argument index="0" name="fold" type="bool"> </argument> <description> </description> </method> <method name="set_filename"> + <return type="void"> + </return> <argument index="0" name="filename" type="String"> </argument> <description> @@ -26675,6 +30017,8 @@ </description> </method> <method name="set_fixed_process"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -26682,12 +30026,16 @@ </description> </method> <method name="set_fixed_process_internal"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_name"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -26695,6 +30043,8 @@ </description> </method> <method name="set_network_master"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="recursive" type="bool" default="true"> @@ -26703,6 +30053,8 @@ </description> </method> <method name="set_owner"> + <return type="void"> + </return> <argument index="0" name="owner" type="Node"> </argument> <description> @@ -26710,12 +30062,17 @@ </description> </method> <method name="set_pause_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Node.PauseMode"> </argument> <description> + Set pause mode (PAUSE_MODE_*) of this Node. </description> </method> <method name="set_process"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -26723,6 +30080,8 @@ </description> </method> <method name="set_process_input"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -26730,12 +30089,16 @@ </description> </method> <method name="set_process_internal"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_process_unhandled_input"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -26743,12 +30106,16 @@ </description> </method> <method name="set_process_unhandled_key_input"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_scene_instance_load_placeholder"> + <return type="void"> + </return> <argument index="0" name="load_placeholder" type="bool"> </argument> <description> @@ -26760,7 +30127,7 @@ </member> <member name="editor/display_folded" type="bool" setter="set_display_folded" getter="is_displayed_folded" brief=""> </member> - <member name="pause_mode" type="int" setter="set_pause_mode" getter="get_pause_mode" brief=""> + <member name="pause_mode" type="int" setter="set_pause_mode" getter="get_pause_mode" brief="" enum="Node.PauseMode"> </member> </members> <signals> @@ -26771,66 +30138,75 @@ </signal> <signal name="tree_entered"> <description> + Emitted when Node enters the tree. </description> </signal> <signal name="tree_exited"> <description> + Emitted when Node exits the tree. </description> </signal> </signals> <constants> - <constant name="NOTIFICATION_ENTER_TREE" value="10"> + <constant name="NOTIFICATION_ENTER_TREE" value="10" enum=""> </constant> - <constant name="NOTIFICATION_EXIT_TREE" value="11"> + <constant name="NOTIFICATION_EXIT_TREE" value="11" enum=""> </constant> - <constant name="NOTIFICATION_MOVED_IN_PARENT" value="12"> + <constant name="NOTIFICATION_MOVED_IN_PARENT" value="12" enum=""> </constant> - <constant name="NOTIFICATION_READY" value="13"> + <constant name="NOTIFICATION_READY" value="13" enum=""> </constant> - <constant name="NOTIFICATION_FIXED_PROCESS" value="16"> + <constant name="NOTIFICATION_FIXED_PROCESS" value="16" enum=""> </constant> - <constant name="NOTIFICATION_PROCESS" value="17"> + <constant name="NOTIFICATION_PROCESS" value="17" enum=""> Notification received every frame when the process flag is set (see [method set_process]). </constant> - <constant name="NOTIFICATION_PARENTED" value="18"> + <constant name="NOTIFICATION_PARENTED" value="18" enum=""> Notification received when a node is set as a child of another node. Note that this doesn't mean that a node entered the Scene Tree. </constant> - <constant name="NOTIFICATION_UNPARENTED" value="19"> + <constant name="NOTIFICATION_UNPARENTED" value="19" enum=""> Notification received when a node is unparented (parent removed it from the list of children). </constant> - <constant name="NOTIFICATION_PAUSED" value="14"> + <constant name="NOTIFICATION_PAUSED" value="14" enum=""> </constant> - <constant name="NOTIFICATION_UNPAUSED" value="15"> + <constant name="NOTIFICATION_UNPAUSED" value="15" enum=""> </constant> - <constant name="NOTIFICATION_INSTANCED" value="20"> + <constant name="NOTIFICATION_INSTANCED" value="20" enum=""> </constant> - <constant name="NOTIFICATION_DRAG_BEGIN" value="21"> + <constant name="NOTIFICATION_DRAG_BEGIN" value="21" enum=""> </constant> - <constant name="NOTIFICATION_DRAG_END" value="22"> + <constant name="NOTIFICATION_DRAG_END" value="22" enum=""> </constant> - <constant name="NOTIFICATION_PATH_CHANGED" value="23"> + <constant name="NOTIFICATION_PATH_CHANGED" value="23" enum=""> </constant> - <constant name="NOTIFICATION_TRANSLATION_CHANGED" value="24"> + <constant name="NOTIFICATION_TRANSLATION_CHANGED" value="24" enum=""> </constant> - <constant name="NOTIFICATION_INTERNAL_PROCESS" value="25"> + <constant name="NOTIFICATION_INTERNAL_PROCESS" value="25" enum=""> </constant> - <constant name="NOTIFICATION_INTERNAL_FIXED_PROCESS" value="26"> + <constant name="NOTIFICATION_INTERNAL_FIXED_PROCESS" value="26" enum=""> </constant> <constant name="RPC_MODE_DISABLED" value="0"> </constant> <constant name="RPC_MODE_REMOTE" value="1"> + Call a method remotely. </constant> <constant name="RPC_MODE_SYNC" value="2"> + Call a method both remotely and locally. </constant> <constant name="RPC_MODE_MASTER" value="3"> + Call a method if the Node is Master. </constant> <constant name="RPC_MODE_SLAVE" value="4"> + Call a method if the Node is Slave. </constant> <constant name="PAUSE_MODE_INHERIT" value="0"> + Inherits pause mode from parent. For root node, it is equivalent to PAUSE_MODE_STOP. </constant> <constant name="PAUSE_MODE_STOP" value="1"> + Stop processing when SceneTree is paused. </constant> <constant name="PAUSE_MODE_PROCESS" value="2"> + Continue to process regardless of SceneTree pause state. </constant> <constant name="DUPLICATE_SIGNALS" value="1"> </constant> @@ -26850,7 +30226,18 @@ Base node for 2D system. Node2D contains a position, rotation and scale, which is used to position and animate. It can alternatively be used with a custom 2D transform ([Transform2D]). A tree of Node2Ds allows complex hierarchies for animation and positioning. </description> <methods> + <method name="apply_scale"> + <return type="void"> + </return> + <argument index="0" name="ratio" type="Vector2"> + </argument> + <description> + Apply the 'ratio' scale to the 2D node, according to its current scale value. + </description> + </method> <method name="edit_set_pivot"> + <return type="void"> + </return> <argument index="0" name="pivot" type="Vector2"> </argument> <description> @@ -26904,7 +30291,7 @@ <method name="get_relative_transform_to_parent" qualifiers="const"> <return type="Transform2D"> </return> - <argument index="0" name="parent" type="Object"> + <argument index="0" name="parent" type="Node"> </argument> <description> Return the transform [Transform2D] calculated relatively to the parent of this 2D node. @@ -26939,6 +30326,8 @@ </description> </method> <method name="global_translate"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> @@ -26953,6 +30342,8 @@ </description> </method> <method name="look_at"> + <return type="void"> + </return> <argument index="0" name="point" type="Vector2"> </argument> <description> @@ -26960,6 +30351,8 @@ </description> </method> <method name="move_local_x"> + <return type="void"> + </return> <argument index="0" name="delta" type="float"> </argument> <argument index="1" name="scaled" type="bool" default="false"> @@ -26969,6 +30362,8 @@ </description> </method> <method name="move_local_y"> + <return type="void"> + </return> <argument index="0" name="delta" type="float"> </argument> <argument index="1" name="scaled" type="bool" default="false"> @@ -26978,20 +30373,17 @@ </description> </method> <method name="rotate"> + <return type="void"> + </return> <argument index="0" name="radians" type="float"> </argument> <description> Apply a rotation (in radians) to the 2D node, starting from its current rotation. </description> </method> - <method name="scale"> - <argument index="0" name="ratio" type="Vector2"> - </argument> - <description> - Apply the 'ratio' scale to the 2D node, according to its current scale value. - </description> - </method> <method name="set_global_position"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <description> @@ -26999,6 +30391,8 @@ </description> </method> <method name="set_global_rotation"> + <return type="void"> + </return> <argument index="0" name="radians" type="float"> </argument> <description> @@ -27006,6 +30400,8 @@ </description> </method> <method name="set_global_rotation_in_degrees"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> @@ -27013,6 +30409,8 @@ </description> </method> <method name="set_global_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="Vector2"> </argument> <description> @@ -27020,6 +30418,8 @@ </description> </method> <method name="set_global_transform"> + <return type="void"> + </return> <argument index="0" name="xform" type="Transform2D"> </argument> <description> @@ -27027,6 +30427,8 @@ </description> </method> <method name="set_position"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <description> @@ -27034,6 +30436,8 @@ </description> </method> <method name="set_rotation"> + <return type="void"> + </return> <argument index="0" name="radians" type="float"> </argument> <description> @@ -27041,6 +30445,8 @@ </description> </method> <method name="set_rotation_in_degrees"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> @@ -27048,6 +30454,8 @@ </description> </method> <method name="set_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="Vector2"> </argument> <description> @@ -27055,6 +30463,8 @@ </description> </method> <method name="set_transform"> + <return type="void"> + </return> <argument index="0" name="xform" type="Transform2D"> </argument> <description> @@ -27062,6 +30472,8 @@ </description> </method> <method name="set_z"> + <return type="void"> + </return> <argument index="0" name="z" type="int"> </argument> <description> @@ -27069,13 +30481,33 @@ </description> </method> <method name="set_z_as_relative"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> Set the Z-index value as relative to the parent node of this 2D node. Thus, if this 2D node's Z-index value is 2 and its parent's effective Z-index is 3, then the effective Z-index value of this 2D node would be 3 + 2 = 5. </description> </method> + <method name="to_global" qualifiers="const"> + <return type="Vector2"> + </return> + <argument index="0" name="local_point" type="Vector2"> + </argument> + <description> + </description> + </method> + <method name="to_local" qualifiers="const"> + <return type="Vector2"> + </return> + <argument index="0" name="global_point" type="Vector2"> + </argument> + <description> + </description> + </method> <method name="translate"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> @@ -27084,13 +30516,13 @@ </method> </methods> <members> - <member name="global_position" type="float" setter="set_global_position" getter="get_global_position" brief=""> + <member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" brief=""> </member> <member name="global_rotation" type="float" setter="set_global_rotation" getter="get_global_rotation" brief=""> </member> <member name="global_rotation_deg" type="float" setter="set_global_rotation_in_degrees" getter="get_global_rotation_in_degrees" brief=""> </member> - <member name="global_scale" type="float" setter="set_global_scale" getter="get_global_scale" brief=""> + <member name="global_scale" type="Vector2" setter="set_global_scale" getter="get_global_scale" brief=""> </member> <member name="global_transform" type="Transform2D" setter="set_global_transform" getter="get_global_transform" brief=""> </member> @@ -27197,6 +30629,8 @@ </description> <methods> <method name="alert"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <argument index="1" name="title" type="String" default=""Alert!""> @@ -27220,6 +30654,8 @@ </description> </method> <method name="delay_msec" qualifiers="const"> + <return type="void"> + </return> <argument index="0" name="msec" type="int"> </argument> <description> @@ -27227,6 +30663,8 @@ </description> </method> <method name="delay_usec" qualifiers="const"> + <return type="void"> + </return> <argument index="0" name="usec" type="int"> </argument> <description> @@ -27234,6 +30672,8 @@ </description> </method> <method name="dump_memory_to_file"> + <return type="void"> + </return> <argument index="0" name="file" type="String"> </argument> <description> @@ -27242,6 +30682,8 @@ </description> </method> <method name="dump_resources_to_file"> + <return type="void"> + </return> <argument index="0" name="file" type="String"> </argument> <description> @@ -27259,7 +30701,7 @@ </argument> <argument index="2" name="blocking" type="bool"> </argument> - <argument index="3" name="output" type="Array" default="[]"> + <argument index="3" name="output" type="Array" default="[ ]"> </argument> <description> Execute the binary file in given path, optionally blocking until it returns. A process ID is returned. @@ -27408,7 +30850,7 @@ </description> </method> <method name="get_power_state"> - <return type="int"> + <return type="int" enum="PowerState"> </return> <description> </description> @@ -27446,7 +30888,7 @@ <method name="get_screen_dpi" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="screen" type="int" default="0"> + <argument index="0" name="screen" type="int" default="-1"> </argument> <description> Returns the dots per inch density of the specified screen. @@ -27461,7 +30903,7 @@ </description> </method> <method name="get_screen_orientation" qualifiers="const"> - <return type="int"> + <return type="int" enum="_OS.ScreenOrientation"> </return> <description> Returns the current screen orientation, the return value will be one of the SCREEN_ORIENTATION constants in this class. @@ -27470,7 +30912,7 @@ <method name="get_screen_position" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="screen" type="int" default="0"> + <argument index="0" name="screen" type="int" default="-1"> </argument> <description> </description> @@ -27478,7 +30920,7 @@ <method name="get_screen_size" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="screen" type="int" default="0"> + <argument index="0" name="screen" type="int" default="-1"> </argument> <description> Returns the dimensions in pixels of the specified screen. @@ -27506,7 +30948,7 @@ <method name="get_system_dir" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="dir" type="int"> + <argument index="0" name="dir" type="int" enum="_OS.SystemDir"> </argument> <description> </description> @@ -27600,6 +31042,8 @@ </description> </method> <method name="hide_virtual_keyboard"> + <return type="void"> + </return> <description> Hides the virtual keyboard if it is shown, does nothing otherwise. </description> @@ -27680,7 +31124,7 @@ </description> </method> <method name="kill"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="pid" type="int"> </argument> @@ -27695,11 +31139,13 @@ </description> </method> <method name="native_video_pause"> + <return type="void"> + </return> <description> </description> </method> <method name="native_video_play"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -27713,47 +31159,65 @@ </description> </method> <method name="native_video_stop"> + <return type="void"> + </return> <description> </description> </method> <method name="native_video_unpause"> + <return type="void"> + </return> <description> </description> </method> <method name="print_all_resources"> + <return type="void"> + </return> <argument index="0" name="tofile" type="String" default=""""> </argument> <description> </description> </method> <method name="print_all_textures_by_size"> + <return type="void"> + </return> <description> </description> </method> <method name="print_resources_by_type"> + <return type="void"> + </return> <argument index="0" name="types" type="PoolStringArray"> </argument> <description> </description> </method> <method name="print_resources_in_use"> + <return type="void"> + </return> <argument index="0" name="short" type="bool" default="false"> </argument> <description> </description> </method> <method name="request_attention"> + <return type="void"> + </return> <description> Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX. </description> </method> <method name="set_borderless_window"> + <return type="void"> + </return> <argument index="0" name="borderless" type="bool"> </argument> <description> </description> </method> <method name="set_clipboard"> + <return type="void"> + </return> <argument index="0" name="clipboard" type="String"> </argument> <description> @@ -27761,30 +31225,40 @@ </description> </method> <method name="set_current_screen"> + <return type="void"> + </return> <argument index="0" name="screen" type="int"> </argument> <description> </description> </method> <method name="set_exit_code"> + <return type="void"> + </return> <argument index="0" name="code" type="int"> </argument> <description> </description> </method> <method name="set_icon"> - <argument index="0" name="icon" type="Object"> + <return type="void"> + </return> + <argument index="0" name="icon" type="Image"> </argument> <description> </description> </method> <method name="set_ime_position"> - <argument index="0" name="arg0" type="Vector2"> + <return type="void"> + </return> + <argument index="0" name="position" type="Vector2"> </argument> <description> </description> </method> <method name="set_keep_screen_on"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -27792,6 +31266,8 @@ </description> </method> <method name="set_low_processor_usage_mode"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -27799,14 +31275,16 @@ </description> </method> <method name="set_screen_orientation"> - <argument index="0" name="orientation" type="int"> + <return type="void"> + </return> + <argument index="0" name="orientation" type="int" enum="_OS.ScreenOrientation"> </argument> <description> Sets the current screen orientation, the argument value must be one of the SCREEN_ORIENTATION constants in this class. </description> </method> <method name="set_thread_name"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="name" type="String"> </argument> @@ -27814,18 +31292,24 @@ </description> </method> <method name="set_use_file_access_save_and_swap"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_use_vsync"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_window_fullscreen"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -27833,6 +31317,8 @@ </description> </method> <method name="set_window_maximized"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -27840,6 +31326,8 @@ </description> </method> <method name="set_window_minimized"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -27847,6 +31335,8 @@ </description> </method> <method name="set_window_position"> + <return type="void"> + </return> <argument index="0" name="position" type="Vector2"> </argument> <description> @@ -27854,6 +31344,8 @@ </description> </method> <method name="set_window_resizable"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -27861,6 +31353,8 @@ </description> </method> <method name="set_window_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> @@ -27868,6 +31362,8 @@ </description> </method> <method name="set_window_title"> + <return type="void"> + </return> <argument index="0" name="title" type="String"> </argument> <description> @@ -27875,7 +31371,7 @@ </description> </method> <method name="shell_open"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="uri" type="String"> </argument> @@ -27883,6 +31379,8 @@ </description> </method> <method name="show_virtual_keyboard"> + <return type="void"> + </return> <argument index="0" name="existing_text" type="String" default=""""> </argument> <description> @@ -27984,6 +31482,8 @@ </description> <methods> <method name="_get" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="property" type="String"> </argument> <description> @@ -27998,10 +31498,14 @@ </description> </method> <method name="_init" qualifiers="virtual"> + <return type="void"> + </return> <description> </description> </method> <method name="_notification" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="what" type="int"> </argument> <description> @@ -28009,6 +31513,8 @@ </description> </method> <method name="_set" qualifiers="virtual"> + <return type="bool"> + </return> <argument index="0" name="property" type="String"> </argument> <argument index="1" name="value" type="Variant"> @@ -28018,9 +31524,11 @@ </description> </method> <method name="add_user_signal"> + <return type="void"> + </return> <argument index="0" name="signal" type="String"> </argument> - <argument index="1" name="arguments" type="Array" default="[]"> + <argument index="1" name="arguments" type="Array" default="[ ]"> </argument> <description> Add a user signal (can be added anytime). Arguments are optional, but can be added as an array of dictionaries, each containing "name" and "type" (from [@Global Scope] TYPE_*). @@ -28035,6 +31543,8 @@ </description> </method> <method name="call_deferred" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="method" type="String"> </argument> <description> @@ -28058,7 +31568,7 @@ </description> </method> <method name="connect"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="signal" type="String"> </argument> @@ -28066,7 +31576,7 @@ </argument> <argument index="2" name="method" type="String"> </argument> - <argument index="3" name="binds" type="Array" default="[]"> + <argument index="3" name="binds" type="Array" default="[ ]"> </argument> <argument index="4" name="flags" type="int" default="0"> </argument> @@ -28075,6 +31585,8 @@ </description> </method> <method name="disconnect"> + <return type="void"> + </return> <argument index="0" name="signal" type="String"> </argument> <argument index="1" name="target" type="Object"> @@ -28086,12 +31598,16 @@ </description> </method> <method name="emit_signal" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="signal" type="String"> </argument> <description> </description> </method> <method name="free"> + <return type="void"> + </return> <description> </description> </method> @@ -28159,7 +31675,7 @@ </description> </method> <method name="get_script" qualifiers="const"> - <return type="Script"> + <return type="Reference"> </return> <description> Return the object script (or null if it doesn't have one). @@ -28241,6 +31757,8 @@ </description> </method> <method name="notification"> + <return type="void"> + </return> <argument index="0" name="what" type="int"> </argument> <argument index="1" name="reversed" type="bool" default="false"> @@ -28250,10 +31768,14 @@ </description> </method> <method name="property_list_changed_notify"> + <return type="void"> + </return> <description> </description> </method> <method name="set"> + <return type="void"> + </return> <argument index="0" name="property" type="String"> </argument> <argument index="1" name="value" type="Variant"> @@ -28263,6 +31785,8 @@ </description> </method> <method name="set_block_signals"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -28270,6 +31794,8 @@ </description> </method> <method name="set_message_translation"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -28277,6 +31803,8 @@ </description> </method> <method name="set_meta"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="value" type="Variant"> @@ -28286,7 +31814,9 @@ </description> </method> <method name="set_script"> - <argument index="0" name="script" type="Script"> + <return type="void"> + </return> + <argument index="0" name="script" type="Reference"> </argument> <description> Set a script into the object, scripts extend the object functionality. @@ -28309,10 +31839,10 @@ </signal> </signals> <constants> - <constant name="NOTIFICATION_POSTINITIALIZE" value="0"> + <constant name="NOTIFICATION_POSTINITIALIZE" value="0" enum=""> Called right when the object is initialized. Not available in script. </constant> - <constant name="NOTIFICATION_PREDELETE" value="1"> + <constant name="NOTIFICATION_PREDELETE" value="1" enum=""> Called before the object is about to be deleted. </constant> <constant name="CONNECT_DEFERRED" value="1"> @@ -28333,7 +31863,7 @@ </description> <methods> <method name="get_cull_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="OccluderPolygon2D.CullMode"> </return> <description> </description> @@ -28351,18 +31881,24 @@ </description> </method> <method name="set_closed"> + <return type="void"> + </return> <argument index="0" name="closed" type="bool"> </argument> <description> </description> </method> <method name="set_cull_mode"> - <argument index="0" name="cull_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="cull_mode" type="int" enum="OccluderPolygon2D.CullMode"> </argument> <description> </description> </method> <method name="set_polygon"> + <return type="void"> + </return> <argument index="0" name="polygon" type="PoolVector2Array"> </argument> <description> @@ -28372,7 +31908,7 @@ <members> <member name="closed" type="bool" setter="set_closed" getter="is_closed" brief=""> </member> - <member name="cull_mode" type="int" setter="set_cull_mode" getter="get_cull_mode" brief=""> + <member name="cull_mode" type="int" setter="set_cull_mode" getter="get_cull_mode" brief="" enum="OccluderPolygon2D.CullMode"> </member> <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" brief=""> </member> @@ -28395,25 +31931,29 @@ </description> <methods> <method name="get_shadow_detail" qualifiers="const"> - <return type="int"> + <return type="int" enum="OmniLight.ShadowDetail"> </return> <description> </description> </method> <method name="get_shadow_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="OmniLight.ShadowMode"> </return> <description> </description> </method> <method name="set_shadow_detail"> - <argument index="0" name="detail" type="int"> + <return type="void"> + </return> + <argument index="0" name="detail" type="int" enum="OmniLight.ShadowDetail"> </argument> <description> </description> </method> <method name="set_shadow_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="OmniLight.ShadowMode"> </argument> <description> </description> @@ -28424,9 +31964,9 @@ </member> <member name="omni_range" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="omni_shadow_detail" type="int" setter="set_shadow_detail" getter="get_shadow_detail" brief=""> + <member name="omni_shadow_detail" type="int" setter="set_shadow_detail" getter="get_shadow_detail" brief="" enum="OmniLight.ShadowDetail"> </member> - <member name="omni_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" brief=""> + <member name="omni_shadow_mode" type="int" setter="set_shadow_mode" getter="get_shadow_mode" brief="" enum="OmniLight.ShadowMode"> </member> </members> <constants> @@ -28441,6 +31981,8 @@ </description> <methods> <method name="add_icon_item"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <argument index="1" name="label" type="String"> @@ -28452,6 +31994,8 @@ </description> </method> <method name="add_item"> + <return type="void"> + </return> <argument index="0" name="label" type="String"> </argument> <argument index="1" name="id" type="int" default="-1"> @@ -28461,22 +32005,17 @@ </description> </method> <method name="add_separator"> + <return type="void"> + </return> <description> Add a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end. </description> </method> <method name="clear"> - <description> - Clear all the items in the [OptionButton]. - </description> - </method> - <method name="get_item_id" qualifiers="const"> - <return type="int"> + <return type="void"> </return> - <argument index="0" name="idx" type="int"> - </argument> <description> - Return the ID of the item at index "idx". + Clear all the items in the [OptionButton]. </description> </method> <method name="get_item_count" qualifiers="const"> @@ -28495,6 +32034,15 @@ Return the icon of the item at index "idx". </description> </method> + <method name="get_item_id" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + Return the ID of the item at index "idx". + </description> + </method> <method name="get_item_metadata" qualifiers="const"> <return type="Variant"> </return> @@ -28540,45 +32088,57 @@ </description> </method> <method name="remove_item"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> </description> </method> <method name="select"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> Select an item by index and make it the current item. </description> </method> - <method name="set_item_id"> + <method name="set_item_disabled"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="id" type="int"> + <argument index="1" name="disabled" type="bool"> </argument> <description> - Set the ID of an item at index "idx". </description> </method> - <method name="set_item_disabled"> + <method name="set_item_icon"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="disabled" type="bool"> + <argument index="1" name="texture" type="Texture"> </argument> <description> + Set the icon of an item at index "idx". </description> </method> - <method name="set_item_icon"> + <method name="set_item_id"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="texture" type="Texture"> + <argument index="1" name="id" type="int"> </argument> <description> - Set the icon of an item at index "idx". + Set the ID of an item at index "idx". </description> </method> <method name="set_item_metadata"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="metadata" type="Variant"> @@ -28587,6 +32147,8 @@ </description> </method> <method name="set_item_text"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="text" type="String"> @@ -28649,7 +32211,7 @@ </description> <methods> <method name="add_file"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="pck_path" type="String"> </argument> @@ -28659,7 +32221,7 @@ </description> </method> <method name="flush"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="verbose" type="bool"> </argument> @@ -28667,7 +32229,7 @@ </description> </method> <method name="pck_start"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="pck_name" type="String"> </argument> @@ -28689,6 +32251,8 @@ </description> <methods> <method name="generate"> + <return type="void"> + </return> <argument index="0" name="from" type="Translation"> </argument> <description> @@ -28705,7 +32269,7 @@ </description> <methods> <method name="pack"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="value" type="Variant"> </argument> @@ -28764,13 +32328,13 @@ <method name="instance" qualifiers="const"> <return type="Node"> </return> - <argument index="0" name="edit_state" type="int" default="0"> + <argument index="0" name="edit_state" type="int" enum="PackedScene.GenEditState" default="0"> </argument> <description> </description> </method> <method name="pack"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="Node"> </argument> @@ -28815,7 +32379,7 @@ </description> </method> <method name="get_packet_error" qualifiers="const"> - <return type="Error"> + <return type="int" enum="Error"> </return> <description> Return the error state of the last packet received (via [method get_packet] and [method get_var]). @@ -28828,8 +32392,14 @@ Get a Variant. </description> </method> + <method name="is_object_decoding_allowed" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="put_packet"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="buffer" type="PoolByteArray"> </argument> @@ -28838,7 +32408,7 @@ </description> </method> <method name="put_var"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="var" type="Variant"> </argument> @@ -28846,6 +32416,14 @@ Send a Variant as a packet. </description> </method> + <method name="set_allow_object_decoding"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> </methods> <constants> </constants> @@ -28858,11 +32436,41 @@ PacketStreamPeer provides a wrapper for working using packets over a stream. This allows for using packet based code with StreamPeers. PacketPeerStream implements a custom protocol over the StreamPeer, so the user should not read or write to the wrapped StreamPeer directly. </description> <methods> + <method name="get_input_buffer_max_size" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_output_buffer_max_size" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="set_input_buffer_max_size"> + <return type="void"> + </return> + <argument index="0" name="max_size_bytes" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_output_buffer_max_size"> + <return type="void"> + </return> + <argument index="0" name="max_size_bytes" type="int"> + </argument> + <description> + </description> + </method> <method name="set_stream_peer"> - <argument index="0" name="peer" type="StreamPeer"> + <return type="void"> + </return> + <argument index="0" name="peer" type="Reference"> </argument> <description> - Set the StreamPeer object to be wrapped + Set the [StreamPeer] object to be wrapped. </description> </method> </methods> @@ -28878,6 +32486,8 @@ </description> <methods> <method name="close"> + <return type="void"> + </return> <description> Close the UDP socket the [PacketPeerUDP] is currently listening on. </description> @@ -28904,7 +32514,7 @@ </description> </method> <method name="listen"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="port" type="int"> </argument> @@ -28920,7 +32530,7 @@ </description> </method> <method name="set_dest_address"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="host" type="String"> </argument> @@ -28931,7 +32541,7 @@ </description> </method> <method name="wait"> - <return type="Error"> + <return type="int" enum="Error"> </return> <description> Wait for a packet to arrive on the listening port, see [method listen]. @@ -28990,6 +32600,8 @@ </description> </method> <method name="set_panorama"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> @@ -29053,6 +32665,8 @@ </description> </method> <method name="set_ignore_camera_zoom"> + <return type="void"> + </return> <argument index="0" name="ignore" type="bool"> </argument> <description> @@ -29060,6 +32674,8 @@ </description> </method> <method name="set_limit_begin"> + <return type="void"> + </return> <argument index="0" name="ofs" type="Vector2"> </argument> <description> @@ -29067,6 +32683,8 @@ </description> </method> <method name="set_limit_end"> + <return type="void"> + </return> <argument index="0" name="ofs" type="Vector2"> </argument> <description> @@ -29074,6 +32692,8 @@ </description> </method> <method name="set_scroll_base_offset"> + <return type="void"> + </return> <argument index="0" name="ofs" type="Vector2"> </argument> <description> @@ -29081,6 +32701,8 @@ </description> </method> <method name="set_scroll_base_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="Vector2"> </argument> <description> @@ -29088,6 +32710,8 @@ </description> </method> <method name="set_scroll_offset"> + <return type="void"> + </return> <argument index="0" name="ofs" type="Vector2"> </argument> <description> @@ -29140,6 +32764,8 @@ </description> </method> <method name="set_mirroring"> + <return type="void"> + </return> <argument index="0" name="mirror" type="Vector2"> </argument> <description> @@ -29147,12 +32773,16 @@ </description> </method> <method name="set_motion_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> </description> </method> <method name="set_motion_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="Vector2"> </argument> <description> @@ -29190,7 +32820,7 @@ </description> </method> <method name="get_draw_order" qualifiers="const"> - <return type="int"> + <return type="int" enum="Particles.DrawOrder"> </return> <description> </description> @@ -29282,22 +32912,30 @@ </description> </method> <method name="restart"> + <return type="void"> + </return> <description> </description> </method> <method name="set_amount"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> </description> </method> <method name="set_draw_order"> - <argument index="0" name="order" type="int"> + <return type="void"> + </return> + <argument index="0" name="order" type="int" enum="Particles.DrawOrder"> </argument> <description> </description> </method> <method name="set_draw_pass_mesh"> + <return type="void"> + </return> <argument index="0" name="pass" type="int"> </argument> <argument index="1" name="mesh" type="Mesh"> @@ -29306,78 +32944,104 @@ </description> </method> <method name="set_draw_passes"> + <return type="void"> + </return> <argument index="0" name="passes" type="int"> </argument> <description> </description> </method> <method name="set_emitting"> + <return type="void"> + </return> <argument index="0" name="emitting" type="bool"> </argument> <description> </description> </method> <method name="set_explosiveness_ratio"> + <return type="void"> + </return> <argument index="0" name="ratio" type="float"> </argument> <description> </description> </method> <method name="set_fixed_fps"> + <return type="void"> + </return> <argument index="0" name="fps" type="int"> </argument> <description> </description> </method> <method name="set_fractional_delta"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_lifetime"> + <return type="void"> + </return> <argument index="0" name="secs" type="float"> </argument> <description> </description> </method> <method name="set_one_shot"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_pre_process_time"> + <return type="void"> + </return> <argument index="0" name="secs" type="float"> </argument> <description> </description> </method> <method name="set_process_material"> + <return type="void"> + </return> <argument index="0" name="material" type="Material"> </argument> <description> </description> </method> <method name="set_randomness_ratio"> + <return type="void"> + </return> <argument index="0" name="ratio" type="float"> </argument> <description> </description> </method> <method name="set_speed_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="float"> </argument> <description> </description> </method> <method name="set_use_local_coordinates"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_visibility_aabb"> + <return type="void"> + </return> <argument index="0" name="aabb" type="Rect3"> </argument> <description> @@ -29387,7 +33051,7 @@ <members> <member name="amount" type="int" setter="set_amount" getter="get_amount" brief=""> </member> - <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" brief=""> + <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" brief="" enum="Particles.DrawOrder"> </member> <member name="draw_pass_1" type="Mesh" setter="set_draw_pass_mesh" getter="get_draw_pass_mesh" brief=""> </member> @@ -29415,7 +33079,7 @@ </member> <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" brief=""> </member> - <member name="process_material" type="ShaderMaterial,ParticlesMaterial" setter="set_process_material" getter="get_process_material" brief=""> + <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material" brief=""> </member> <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" brief=""> </member> @@ -29431,7 +33095,7 @@ </constant> <constant name="DRAW_ORDER_VIEW_DEPTH" value="2"> </constant> - <constant name="MAX_DRAW_PASSES" value="4"> + <constant name="MAX_DRAW_PASSES" value="4" enum=""> </constant> </constants> </class> @@ -29457,7 +33121,7 @@ </description> </method> <method name="get_draw_order" qualifiers="const"> - <return type="int"> + <return type="int" enum="Particles2D.DrawOrder"> </return> <description> </description> @@ -29562,10 +33226,14 @@ </description> </method> <method name="restart"> + <return type="void"> + </return> <description> </description> </method> <method name="set_amount"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> @@ -29573,12 +33241,16 @@ </description> </method> <method name="set_draw_order"> - <argument index="0" name="order" type="int"> + <return type="void"> + </return> + <argument index="0" name="order" type="int" enum="Particles2D.DrawOrder"> </argument> <description> </description> </method> <method name="set_emitting"> + <return type="void"> + </return> <argument index="0" name="emitting" type="bool"> </argument> <description> @@ -29586,30 +33258,40 @@ </description> </method> <method name="set_explosiveness_ratio"> + <return type="void"> + </return> <argument index="0" name="ratio" type="float"> </argument> <description> </description> </method> <method name="set_fixed_fps"> + <return type="void"> + </return> <argument index="0" name="fps" type="int"> </argument> <description> </description> </method> <method name="set_fractional_delta"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_h_frames"> + <return type="void"> + </return> <argument index="0" name="frames" type="int"> </argument> <description> </description> </method> <method name="set_lifetime"> + <return type="void"> + </return> <argument index="0" name="secs" type="float"> </argument> <description> @@ -29617,60 +33299,80 @@ </description> </method> <method name="set_normal_map"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_one_shot"> + <return type="void"> + </return> <argument index="0" name="secs" type="bool"> </argument> <description> </description> </method> <method name="set_pre_process_time"> + <return type="void"> + </return> <argument index="0" name="secs" type="float"> </argument> <description> </description> </method> <method name="set_process_material"> + <return type="void"> + </return> <argument index="0" name="material" type="Material"> </argument> <description> </description> </method> <method name="set_randomness_ratio"> + <return type="void"> + </return> <argument index="0" name="ratio" type="float"> </argument> <description> </description> </method> <method name="set_speed_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="float"> </argument> <description> </description> </method> <method name="set_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_use_local_coordinates"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_v_frames"> + <return type="void"> + </return> <argument index="0" name="frames" type="int"> </argument> <description> </description> </method> <method name="set_visibility_rect"> + <return type="void"> + </return> <argument index="0" name="aabb" type="Rect2"> </argument> <description> @@ -29680,7 +33382,7 @@ <members> <member name="amount" type="int" setter="set_amount" getter="get_amount" brief=""> </member> - <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" brief=""> + <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" brief="" enum="Particles2D.DrawOrder"> </member> <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" brief=""> </member> @@ -29702,7 +33404,7 @@ </member> <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" brief=""> </member> - <member name="process_material" type="ShaderMaterial,ParticlesMaterial" setter="set_process_material" getter="get_process_material" brief=""> + <member name="process_material" type="Material" setter="set_process_material" getter="get_process_material" brief=""> </member> <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" brief=""> </member> @@ -29712,7 +33414,7 @@ </member> <member name="v_frames" type="int" setter="set_v_frames" getter="get_v_frames" brief=""> </member> - <member name="visibility_rect" type="Rect3" setter="set_visibility_rect" getter="get_visibility_rect" brief=""> + <member name="visibility_rect" type="Rect2" setter="set_visibility_rect" getter="get_visibility_rect" brief=""> </member> </members> <constants> @@ -29771,7 +33473,7 @@ </description> </method> <method name="get_emission_shape" qualifiers="const"> - <return type="int"> + <return type="int" enum="ParticlesMaterial.EmissionShape"> </return> <description> </description> @@ -29785,7 +33487,7 @@ <method name="get_flag" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="flag" type="int"> + <argument index="0" name="flag" type="int" enum="ParticlesMaterial.Flags"> </argument> <description> </description> @@ -29805,7 +33507,7 @@ <method name="get_param" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> </argument> <description> </description> @@ -29813,15 +33515,15 @@ <method name="get_param_randomness" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> </argument> <description> </description> </method> <method name="get_param_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> </argument> <description> </description> @@ -29851,61 +33553,81 @@ </description> </method> <method name="set_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_color_ramp"> + <return type="void"> + </return> <argument index="0" name="ramp" type="Texture"> </argument> <description> </description> </method> <method name="set_emission_box_extents"> + <return type="void"> + </return> <argument index="0" name="extents" type="Vector3"> </argument> <description> </description> </method> <method name="set_emission_color_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_emission_normal_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_emission_point_count"> + <return type="void"> + </return> <argument index="0" name="point_count" type="int"> </argument> <description> </description> </method> <method name="set_emission_point_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_emission_shape"> - <argument index="0" name="shape" type="int"> + <return type="void"> + </return> + <argument index="0" name="shape" type="int" enum="ParticlesMaterial.EmissionShape"> </argument> <description> </description> </method> <method name="set_emission_sphere_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> </description> </method> <method name="set_flag"> - <argument index="0" name="flag" type="int"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="ParticlesMaterial.Flags"> </argument> <argument index="1" name="enable" type="bool"> </argument> @@ -29913,19 +33635,25 @@ </description> </method> <method name="set_flatness"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_gravity"> + <return type="void"> + </return> <argument index="0" name="accel_vec" type="Vector3"> </argument> <description> </description> </method> <method name="set_param"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -29933,7 +33661,9 @@ </description> </method> <method name="set_param_randomness"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> </argument> <argument index="1" name="randomness" type="float"> </argument> @@ -29941,32 +33671,42 @@ </description> </method> <method name="set_param_texture"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="ParticlesMaterial.Parameter"> </argument> - <argument index="1" name="texture" type="Object"> + <argument index="1" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_spread"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> </description> </method> <method name="set_trail_color_modifier"> + <return type="void"> + </return> <argument index="0" name="texture" type="GradientTexture"> </argument> <description> </description> </method> <method name="set_trail_divisor"> + <return type="void"> + </return> <argument index="0" name="divisor" type="int"> </argument> <description> </description> </method> <method name="set_trail_size_modifier"> + <return type="void"> + </return> <argument index="0" name="texture" type="CurveTexture"> </argument> <description> @@ -29976,13 +33716,13 @@ <members> <member name="angle" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="angle_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="angle_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="angle_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> <member name="angular_velocity" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="angular_velocity_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="angular_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> @@ -29990,23 +33730,23 @@ </member> <member name="anim_offset" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="anim_offset_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="anim_offset_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="anim_offset_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> <member name="anim_speed" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="anim_speed_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="anim_speed_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="anim_speed_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> <member name="color" type="Color" setter="set_color" getter="get_color" brief=""> </member> - <member name="color_ramp" type="GradientTexture" setter="set_color_ramp" getter="get_color_ramp" brief=""> + <member name="color_ramp" type="Texture" setter="set_color_ramp" getter="get_color_ramp" brief=""> </member> <member name="damping" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="damping_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="damping_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="damping_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> @@ -30020,7 +33760,7 @@ </member> <member name="emission_point_texture" type="Texture" setter="set_emission_point_texture" getter="get_emission_point_texture" brief=""> </member> - <member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" brief=""> + <member name="emission_shape" type="int" setter="set_emission_shape" getter="get_emission_shape" brief="" enum="ParticlesMaterial.EmissionShape"> </member> <member name="emission_sphere_radius" type="float" setter="set_emission_sphere_radius" getter="get_emission_sphere_radius" brief=""> </member> @@ -30036,7 +33776,7 @@ </member> <member name="hue_variation" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="hue_variation_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="hue_variation_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="hue_variation_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> @@ -30046,25 +33786,25 @@ </member> <member name="linear_accel" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="linear_accel_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="linear_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="linear_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> <member name="orbit_velocity" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="orbit_velocity_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="orbit_velocity_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="orbit_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> <member name="radial_accel" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="radial_accel_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="radial_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="radial_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> <member name="scale" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="scale_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="scale_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="scale_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> @@ -30072,7 +33812,7 @@ </member> <member name="tangential_accel" type="float" setter="set_param" getter="get_param" brief=""> </member> - <member name="tangential_accel_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> + <member name="tangential_accel_curve" type="Texture" setter="set_param_texture" getter="get_param_texture" brief=""> </member> <member name="tangential_accel_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> @@ -30144,6 +33884,8 @@ </description> </method> <method name="set_curve"> + <return type="void"> + </return> <argument index="0" name="curve" type="Curve3D"> </argument> <description> @@ -30174,6 +33916,8 @@ </description> </method> <method name="set_curve"> + <return type="void"> + </return> <argument index="0" name="curve" type="Curve2D"> </argument> <description> @@ -30219,7 +33963,7 @@ </description> </method> <method name="get_rotation_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="PathFollow.RotationMode"> </return> <description> Returns the rotation mode. The constants below list which axes are allowed to rotate for each mode. @@ -30247,6 +33991,8 @@ </description> </method> <method name="set_cubic_interpolation"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -30256,6 +34002,8 @@ </description> </method> <method name="set_h_offset"> + <return type="void"> + </return> <argument index="0" name="h_offset" type="float"> </argument> <description> @@ -30264,6 +34012,8 @@ </description> </method> <method name="set_loop"> + <return type="void"> + </return> <argument index="0" name="loop" type="bool"> </argument> <description> @@ -30271,6 +34021,8 @@ </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="float"> </argument> <description> @@ -30278,13 +34030,17 @@ </description> </method> <method name="set_rotation_mode"> - <argument index="0" name="rotation_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="rotation_mode" type="int" enum="PathFollow.RotationMode"> </argument> <description> Allows or forbids rotation on one or more axes, per the constants below. </description> </method> <method name="set_unit_offset"> + <return type="void"> + </return> <argument index="0" name="unit_offset" type="float"> </argument> <description> @@ -30292,6 +34048,8 @@ </description> </method> <method name="set_v_offset"> + <return type="void"> + </return> <argument index="0" name="v_offset" type="float"> </argument> <description> @@ -30373,6 +34131,8 @@ </description> </method> <method name="set_cubic_interpolation"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -30382,6 +34142,8 @@ </description> </method> <method name="set_h_offset"> + <return type="void"> + </return> <argument index="0" name="h_offset" type="float"> </argument> <description> @@ -30390,6 +34152,8 @@ </description> </method> <method name="set_loop"> + <return type="void"> + </return> <argument index="0" name="loop" type="bool"> </argument> <description> @@ -30397,6 +34161,8 @@ </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="float"> </argument> <description> @@ -30404,6 +34170,8 @@ </description> </method> <method name="set_rotate"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -30411,6 +34179,8 @@ </description> </method> <method name="set_unit_offset"> + <return type="void"> + </return> <argument index="0" name="unit_offset" type="float"> </argument> <description> @@ -30418,6 +34188,8 @@ </description> </method> <method name="set_v_offset"> + <return type="void"> + </return> <argument index="0" name="v_offset" type="float"> </argument> <description> @@ -30437,7 +34209,7 @@ <method name="get_monitor" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="monitor" type="int"> + <argument index="0" name="monitor" type="int" enum="Performance.Monitor"> </argument> <description> </description> @@ -30678,6 +34450,8 @@ </description> </method> <method name="integrate_forces"> + <return type="void"> + </return> <description> Call the built-in force integration code. </description> @@ -30690,6 +34464,8 @@ </description> </method> <method name="set_angular_velocity"> + <return type="void"> + </return> <argument index="0" name="velocity" type="float"> </argument> <description> @@ -30697,6 +34473,8 @@ </description> </method> <method name="set_linear_velocity"> + <return type="void"> + </return> <argument index="0" name="velocity" type="Vector2"> </argument> <description> @@ -30704,6 +34482,8 @@ </description> </method> <method name="set_sleep_state"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -30711,6 +34491,8 @@ </description> </method> <method name="set_transform"> + <return type="void"> + </return> <argument index="0" name="transform" type="Transform2D"> </argument> <description> @@ -30787,7 +34569,7 @@ </argument> <argument index="1" name="max_results" type="int" default="32"> </argument> - <argument index="2" name="exclude" type="Array" default="[]"> + <argument index="2" name="exclude" type="Array" default="[ ]"> </argument> <argument index="3" name="collision_layer" type="int" default="2147483647"> </argument> @@ -30810,7 +34592,7 @@ </argument> <argument index="1" name="to" type="Vector2"> </argument> - <argument index="2" name="exclude" type="Array" default="[]"> + <argument index="2" name="exclude" type="Array" default="[ ]"> </argument> <argument index="3" name="collision_layer" type="int" default="2147483647"> </argument> @@ -30877,17 +34659,21 @@ </description> <methods> <method name="area_add_shape"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="shape" type="RID"> </argument> - <argument index="2" name="transform" type="Transform2D" default="((1, 0), (0, 1), (0, 0))"> + <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> </argument> <description> Add a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. </description> </method> <method name="area_attach_object_instance_id"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="id" type="int"> @@ -30897,6 +34683,8 @@ </description> </method> <method name="area_clear_shapes"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <description> @@ -30920,9 +34708,11 @@ </description> </method> <method name="area_get_param" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="area" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.AreaParameter"> </argument> <description> Return an area parameter value. @@ -30969,7 +34759,7 @@ </description> </method> <method name="area_get_space_override_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Physics2DServer.AreaSpaceOverrideMode"> </return> <argument index="0" name="area" type="RID"> </argument> @@ -30987,6 +34777,8 @@ </description> </method> <method name="area_remove_shape"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -30996,6 +34788,8 @@ </description> </method> <method name="area_set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="layer" type="int"> @@ -31005,6 +34799,8 @@ </description> </method> <method name="area_set_collision_mask"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="mask" type="int"> @@ -31014,6 +34810,8 @@ </description> </method> <method name="area_set_monitor_callback"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="receiver" type="Object"> @@ -31030,9 +34828,11 @@ </description> </method> <method name="area_set_param"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.AreaParameter"> </argument> <argument index="2" name="value" type="Variant"> </argument> @@ -31041,6 +34841,8 @@ </description> </method> <method name="area_set_shape"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31052,6 +34854,8 @@ </description> </method> <method name="area_set_shape_disabled"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31062,6 +34866,8 @@ </description> </method> <method name="area_set_shape_transform"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31073,6 +34879,8 @@ </description> </method> <method name="area_set_space"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="space" type="RID"> @@ -31082,15 +34890,19 @@ </description> </method> <method name="area_set_space_override_mode"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="Physics2DServer.AreaSpaceOverrideMode"> </argument> <description> Set the space override mode for the area. The modes are described in the constants AREA_SPACE_OVERRIDE_*. </description> </method> <method name="area_set_transform"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="transform" type="Transform2D"> @@ -31100,6 +34912,8 @@ </description> </method> <method name="body_add_collision_exception"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="excepted_body" type="RID"> @@ -31109,6 +34923,8 @@ </description> </method> <method name="body_add_force"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="offset" type="Vector2"> @@ -31120,17 +34936,21 @@ </description> </method> <method name="body_add_shape"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape" type="RID"> </argument> - <argument index="2" name="transform" type="Transform2D" default="((1, 0), (0, 1), (0, 0))"> + <argument index="2" name="transform" type="Transform2D" default="Transform2D( 1, 0, 0, 1, 0, 0 )"> </argument> <description> Add a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. </description> </method> <method name="body_apply_impulse"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="pos" type="Vector2"> @@ -31142,6 +34962,8 @@ </description> </method> <method name="body_attach_object_instance_id"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="id" type="int"> @@ -31151,6 +34973,8 @@ </description> </method> <method name="body_clear_shapes"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <description> @@ -31160,7 +34984,7 @@ <method name="body_create"> <return type="RID"> </return> - <argument index="0" name="mode" type="int" default="2"> + <argument index="0" name="mode" type="int" enum="Physics2DServer.BodyMode" default="2"> </argument> <argument index="1" name="init_sleeping" type="bool" default="false"> </argument> @@ -31187,7 +35011,7 @@ </description> </method> <method name="body_get_continuous_collision_detection_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Physics2DServer.CCDMode"> </return> <argument index="0" name="body" type="RID"> </argument> @@ -31205,7 +35029,7 @@ </description> </method> <method name="body_get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Physics2DServer.BodyMode"> </return> <argument index="0" name="body" type="RID"> </argument> @@ -31227,7 +35051,7 @@ </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.BodyParameter"> </argument> <description> Return the value of a body parameter. @@ -31254,6 +35078,8 @@ </description> </method> <method name="body_get_shape_metadata" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31283,9 +35109,11 @@ </description> </method> <method name="body_get_state" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="state" type="int"> + <argument index="1" name="state" type="int" enum="Physics2DServer.BodyState"> </argument> <description> Return a body state. @@ -31301,6 +35129,8 @@ </description> </method> <method name="body_remove_collision_exception"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="excepted_body" type="RID"> @@ -31310,6 +35140,8 @@ </description> </method> <method name="body_remove_shape"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31319,6 +35151,8 @@ </description> </method> <method name="body_set_axis_velocity"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="axis_velocity" type="Vector2"> @@ -31328,6 +35162,8 @@ </description> </method> <method name="body_set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="layer" type="int"> @@ -31337,6 +35173,8 @@ </description> </method> <method name="body_set_collision_mask"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="mask" type="int"> @@ -31346,9 +35184,11 @@ </description> </method> <method name="body_set_continuous_collision_detection_mode"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="Physics2DServer.CCDMode"> </argument> <description> Set the continuous collision detection mode from any of the CCD_MODE_* constants. @@ -31356,19 +35196,23 @@ </description> </method> <method name="body_set_force_integration_callback"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="receiver" type="Object"> </argument> <argument index="2" name="method" type="String"> </argument> - <argument index="3" name="userdata" type="Variant" default="NULL"> + <argument index="3" name="userdata" type="Variant" default="null"> </argument> <description> Set the function used to calculate physics for an object, if that object allows it (see [method body_set_omit_force integration]). </description> </method> <method name="body_set_max_contacts_reported"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="amount" type="int"> @@ -31378,15 +35222,19 @@ </description> </method> <method name="body_set_mode"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="Physics2DServer.BodyMode"> </argument> <description> Set the body mode, from one of the constants BODY_MODE*. </description> </method> <method name="body_set_omit_force_integration"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="enable" type="bool"> @@ -31396,9 +35244,11 @@ </description> </method> <method name="body_set_param"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.BodyParameter"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -31407,6 +35257,8 @@ </description> </method> <method name="body_set_shape"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31418,6 +35270,8 @@ </description> </method> <method name="body_set_shape_as_one_way_collision"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31428,6 +35282,8 @@ </description> </method> <method name="body_set_shape_disabled"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31438,6 +35294,8 @@ </description> </method> <method name="body_set_shape_metadata"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31449,6 +35307,8 @@ </description> </method> <method name="body_set_shape_transform"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -31460,6 +35320,8 @@ </description> </method> <method name="body_set_space"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="space" type="RID"> @@ -31469,9 +35331,11 @@ </description> </method> <method name="body_set_state"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="state" type="int"> + <argument index="1" name="state" type="int" enum="Physics2DServer.BodyState"> </argument> <argument index="2" name="value" type="Variant"> </argument> @@ -31490,7 +35354,7 @@ </argument> <argument index="3" name="margin" type="float" default="0.08"> </argument> - <argument index="4" name="result" type="Physics2DTestMotionResult" default="NULL"> + <argument index="4" name="result" type="Physics2DTestMotionResult" default="null"> </argument> <description> Return whether a body can move from a given point in a given direction. Apart from the boolean return value, a [Physics2DTestMotionResult] can be passed to return additional information in. @@ -31505,7 +35369,7 @@ </argument> <argument index="2" name="body_a" type="RID"> </argument> - <argument index="3" name="body_b" type="RID" default="[RID]"> + <argument index="3" name="body_b" type="RID"> </argument> <description> Create a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself. @@ -31516,16 +35380,18 @@ </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.DampedStringParam"> </argument> <description> Return the value of a damped spring joint parameter. </description> </method> <method name="damped_string_joint_set_param"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.DampedStringParam"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -31534,6 +35400,8 @@ </description> </method> <method name="free_rid"> + <return type="void"> + </return> <argument index="0" name="rid" type="RID"> </argument> <description> @@ -31543,7 +35411,7 @@ <method name="get_process_info"> <return type="int"> </return> - <argument index="0" name="process_info" type="int"> + <argument index="0" name="process_info" type="int" enum="Physics2DServer.ProcessInfo"> </argument> <description> Return information about the current state of the 2D physics engine. The states are listed under the INFO_* constants. @@ -31558,9 +35426,9 @@ </argument> <argument index="2" name="anchor_b" type="Vector2"> </argument> - <argument index="3" name="body_a" type="RID" default="[RID]"> + <argument index="3" name="body_a" type="RID"> </argument> - <argument index="4" name="body_b" type="RID" default="[RID]"> + <argument index="4" name="body_b" type="RID"> </argument> <description> Create a groove joint between two bodies. If not specified, the bodyies are assumed to be the joint itself. @@ -31571,14 +35439,14 @@ </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.JointParam"> </argument> <description> Return the value of a joint parameter. </description> </method> <method name="joint_get_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Physics2DServer.JointType"> </return> <argument index="0" name="joint" type="RID"> </argument> @@ -31587,9 +35455,11 @@ </description> </method> <method name="joint_set_param"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.JointParam"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -31604,13 +35474,15 @@ </argument> <argument index="1" name="body_a" type="RID"> </argument> - <argument index="2" name="body_b" type="RID" default="[RID]"> + <argument index="2" name="body_b" type="RID"> </argument> <description> Create a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself. </description> </method> <method name="set_active"> + <return type="void"> + </return> <argument index="0" name="active" type="bool"> </argument> <description> @@ -31620,13 +35492,15 @@ <method name="shape_create"> <return type="RID"> </return> - <argument index="0" name="type" type="int"> + <argument index="0" name="type" type="int" enum="Physics2DServer.ShapeType"> </argument> <description> Create a shape of type SHAPE_*. Does not assign it to a body or an area. To do so, you must use [method area_set_shape] or [method body_set_shape]. </description> </method> <method name="shape_get_data" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="shape" type="RID"> </argument> <description> @@ -31634,7 +35508,7 @@ </description> </method> <method name="shape_get_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Physics2DServer.ShapeType"> </return> <argument index="0" name="shape" type="RID"> </argument> @@ -31643,6 +35517,8 @@ </description> </method> <method name="shape_set_data"> + <return type="void"> + </return> <argument index="0" name="shape" type="RID"> </argument> <argument index="1" name="data" type="Variant"> @@ -31672,7 +35548,7 @@ </return> <argument index="0" name="space" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.SpaceParameter"> </argument> <description> Return the value of a space parameter. @@ -31688,6 +35564,8 @@ </description> </method> <method name="space_set_active"> + <return type="void"> + </return> <argument index="0" name="space" type="RID"> </argument> <argument index="1" name="active" type="bool"> @@ -31697,9 +35575,11 @@ </description> </method> <method name="space_set_param"> + <return type="void"> + </return> <argument index="0" name="space" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="Physics2DServer.SpaceParameter"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -31956,6 +35836,8 @@ </description> </method> <method name="set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="collision_layer" type="int"> </argument> <description> @@ -31963,6 +35845,8 @@ </description> </method> <method name="set_exclude"> + <return type="void"> + </return> <argument index="0" name="exclude" type="Array"> </argument> <description> @@ -31970,6 +35854,8 @@ </description> </method> <method name="set_margin"> + <return type="void"> + </return> <argument index="0" name="margin" type="float"> </argument> <description> @@ -31977,6 +35863,8 @@ </description> </method> <method name="set_motion"> + <return type="void"> + </return> <argument index="0" name="motion" type="Vector2"> </argument> <description> @@ -31984,6 +35872,8 @@ </description> </method> <method name="set_object_type_mask"> + <return type="void"> + </return> <argument index="0" name="object_type_mask" type="int"> </argument> <description> @@ -31991,13 +35881,17 @@ </description> </method> <method name="set_shape"> - <argument index="0" name="shape" type="Shape2D"> + <return type="void"> + </return> + <argument index="0" name="shape" type="Resource"> </argument> <description> Set the [Shape2D] that will be used for collision/intersection queries. </description> </method> <method name="set_shape_rid"> + <return type="void"> + </return> <argument index="0" name="shape" type="RID"> </argument> <description> @@ -32005,6 +35899,8 @@ </description> </method> <method name="set_transform"> + <return type="void"> + </return> <argument index="0" name="transform" type="Transform2D"> </argument> <description> @@ -32136,9 +36032,12 @@ </description> <methods> <method name="add_collision_exception_with"> - <argument index="0" name="body" type="PhysicsBody"> + <return type="void"> + </return> + <argument index="0" name="body" type="Node"> </argument> <description> + Adds a body to the collision exception list. This list contains bodies that this body will not collide with. </description> </method> <method name="get_collision_layer" qualifiers="const"> @@ -32170,18 +36069,25 @@ </description> </method> <method name="remove_collision_exception_with"> - <argument index="0" name="body" type="PhysicsBody"> + <return type="void"> + </return> + <argument index="0" name="body" type="Node"> </argument> <description> + Removes a body from the collision exception list. </description> </method> <method name="set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> </description> </method> <method name="set_collision_layer_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -32190,12 +36096,16 @@ </description> </method> <method name="set_collision_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> </description> </method> <method name="set_collision_mask_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -32222,10 +36132,11 @@ </description> <methods> <method name="add_collision_exception_with"> - <argument index="0" name="body" type="PhysicsBody2D"> + <return type="void"> + </return> + <argument index="0" name="body" type="Node"> </argument> <description> - Adds a body to the collision exception list. This list contains bodies that this body will not collide with. </description> </method> <method name="get_collision_layer" qualifiers="const"> @@ -32261,13 +36172,16 @@ </description> </method> <method name="remove_collision_exception_with"> - <argument index="0" name="body" type="PhysicsBody2D"> + <return type="void"> + </return> + <argument index="0" name="body" type="Node"> </argument> <description> - Removes a body from the collision exception list. </description> </method> <method name="set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> @@ -32277,6 +36191,8 @@ </description> </method> <method name="set_collision_layer_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -32286,6 +36202,8 @@ </description> </method> <method name="set_collision_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> @@ -32293,6 +36211,8 @@ </description> </method> <method name="set_collision_mask_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -32320,6 +36240,8 @@ </description> <methods> <method name="add_force"> + <return type="void"> + </return> <argument index="0" name="force" type="Vector3"> </argument> <argument index="1" name="pos" type="Vector3"> @@ -32328,6 +36250,8 @@ </description> </method> <method name="apply_impulse"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector3"> </argument> <argument index="1" name="j" type="Vector3"> @@ -32336,6 +36260,8 @@ </description> </method> <method name="apply_torqe_impulse"> + <return type="void"> + </return> <argument index="0" name="j" type="Vector3"> </argument> <description> @@ -32492,6 +36418,8 @@ </description> </method> <method name="integrate_forces"> + <return type="void"> + </return> <description> </description> </method> @@ -32502,24 +36430,32 @@ </description> </method> <method name="set_angular_velocity"> + <return type="void"> + </return> <argument index="0" name="velocity" type="Vector3"> </argument> <description> </description> </method> <method name="set_linear_velocity"> + <return type="void"> + </return> <argument index="0" name="velocity" type="Vector3"> </argument> <description> </description> </method> <method name="set_sleep_state"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_transform"> + <return type="void"> + </return> <argument index="0" name="transform" type="Transform"> </argument> <description> @@ -32580,7 +36516,7 @@ </argument> <argument index="1" name="to" type="Vector3"> </argument> - <argument index="2" name="exclude" type="Array" default="[]"> + <argument index="2" name="exclude" type="Array" default="[ ]"> </argument> <argument index="3" name="collision_layer" type="int" default="2147483647"> </argument> @@ -32622,16 +36558,20 @@ </description> <methods> <method name="area_add_shape"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="shape" type="RID"> </argument> - <argument index="2" name="transform" type="Transform" default="Transform()"> + <argument index="2" name="transform" type="Transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> </argument> <description> </description> </method> <method name="area_attach_object_instance_id"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="id" type="int"> @@ -32640,6 +36580,8 @@ </description> </method> <method name="area_clear_shapes"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <description> @@ -32660,9 +36602,11 @@ </description> </method> <method name="area_get_param" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="area" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.AreaParameter"> </argument> <description> </description> @@ -32704,7 +36648,7 @@ </description> </method> <method name="area_get_space_override_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="PhysicsServer.AreaSpaceOverrideMode"> </return> <argument index="0" name="area" type="RID"> </argument> @@ -32728,6 +36672,8 @@ </description> </method> <method name="area_remove_shape"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -32736,6 +36682,8 @@ </description> </method> <method name="area_set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="layer" type="int"> @@ -32744,6 +36692,8 @@ </description> </method> <method name="area_set_collision_mask"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="mask" type="int"> @@ -32752,6 +36702,8 @@ </description> </method> <method name="area_set_monitor_callback"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="receiver" type="Object"> @@ -32762,9 +36714,11 @@ </description> </method> <method name="area_set_param"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.AreaParameter"> </argument> <argument index="2" name="value" type="Variant"> </argument> @@ -32772,6 +36726,8 @@ </description> </method> <method name="area_set_ray_pickable"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="enable" type="bool"> @@ -32780,6 +36736,8 @@ </description> </method> <method name="area_set_shape"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -32790,6 +36748,8 @@ </description> </method> <method name="area_set_shape_transform"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -32800,6 +36760,8 @@ </description> </method> <method name="area_set_space"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="space" type="RID"> @@ -32808,14 +36770,18 @@ </description> </method> <method name="area_set_space_override_mode"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="PhysicsServer.AreaSpaceOverrideMode"> </argument> <description> </description> </method> <method name="area_set_transform"> + <return type="void"> + </return> <argument index="0" name="area" type="RID"> </argument> <argument index="1" name="transform" type="Transform"> @@ -32824,6 +36790,8 @@ </description> </method> <method name="body_add_collision_exception"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="excepted_body" type="RID"> @@ -32832,16 +36800,20 @@ </description> </method> <method name="body_add_shape"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape" type="RID"> </argument> - <argument index="2" name="transform" type="Transform" default="Transform()"> + <argument index="2" name="transform" type="Transform" default="Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )"> </argument> <description> </description> </method> <method name="body_apply_impulse"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="pos" type="Vector3"> @@ -32852,6 +36824,8 @@ </description> </method> <method name="body_apply_torque_impulse"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="impulse" type="Vector3"> @@ -32860,6 +36834,8 @@ </description> </method> <method name="body_attach_object_instance_id"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="id" type="int"> @@ -32868,6 +36844,8 @@ </description> </method> <method name="body_clear_shapes"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <description> @@ -32876,7 +36854,7 @@ <method name="body_create"> <return type="RID"> </return> - <argument index="0" name="mode" type="int" default="2"> + <argument index="0" name="mode" type="int" enum="PhysicsServer.BodyMode" default="2"> </argument> <argument index="1" name="init_sleeping" type="bool" default="false"> </argument> @@ -32884,7 +36862,7 @@ </description> </method> <method name="body_get_axis_lock" qualifiers="const"> - <return type="int"> + <return type="int" enum="PhysicsServer.BodyAxisLock"> </return> <argument index="0" name="body" type="RID"> </argument> @@ -32916,7 +36894,7 @@ </description> </method> <method name="body_get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="PhysicsServer.BodyMode"> </return> <argument index="0" name="body" type="RID"> </argument> @@ -32936,7 +36914,7 @@ </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.BodyParameter"> </argument> <description> </description> @@ -32978,9 +36956,11 @@ </description> </method> <method name="body_get_state" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="state" type="int"> + <argument index="1" name="state" type="int" enum="PhysicsServer.BodyState"> </argument> <description> </description> @@ -33010,6 +36990,8 @@ </description> </method> <method name="body_remove_collision_exception"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="excepted_body" type="RID"> @@ -33018,6 +37000,8 @@ </description> </method> <method name="body_remove_shape"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -33026,14 +37010,18 @@ </description> </method> <method name="body_set_axis_lock"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="axis" type="int"> + <argument index="1" name="axis" type="int" enum="PhysicsServer.BodyAxisLock"> </argument> <description> </description> </method> <method name="body_set_axis_velocity"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="axis_velocity" type="Vector3"> @@ -33042,6 +37030,8 @@ </description> </method> <method name="body_set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="layer" type="int"> @@ -33050,6 +37040,8 @@ </description> </method> <method name="body_set_collision_mask"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="mask" type="int"> @@ -33058,6 +37050,8 @@ </description> </method> <method name="body_set_enable_continuous_collision_detection"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="enable" type="bool"> @@ -33066,18 +37060,22 @@ </description> </method> <method name="body_set_force_integration_callback"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="receiver" type="Object"> </argument> <argument index="2" name="method" type="String"> </argument> - <argument index="3" name="userdata" type="Variant" default="NULL"> + <argument index="3" name="userdata" type="Variant" default="null"> </argument> <description> </description> </method> <method name="body_set_max_contacts_reported"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="amount" type="int"> @@ -33086,14 +37084,18 @@ </description> </method> <method name="body_set_mode"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="PhysicsServer.BodyMode"> </argument> <description> </description> </method> <method name="body_set_omit_force_integration"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="enable" type="bool"> @@ -33102,9 +37104,11 @@ </description> </method> <method name="body_set_param"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.BodyParameter"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -33112,6 +37116,8 @@ </description> </method> <method name="body_set_ray_pickable"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="enable" type="bool"> @@ -33120,6 +37126,8 @@ </description> </method> <method name="body_set_shape"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -33130,6 +37138,8 @@ </description> </method> <method name="body_set_shape_transform"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -33140,6 +37150,8 @@ </description> </method> <method name="body_set_space"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="space" type="RID"> @@ -33148,9 +37160,11 @@ </description> </method> <method name="body_set_state"> + <return type="void"> + </return> <argument index="0" name="body" type="RID"> </argument> - <argument index="1" name="state" type="int"> + <argument index="1" name="state" type="int" enum="PhysicsServer.BodyState"> </argument> <argument index="2" name="value" type="Variant"> </argument> @@ -33162,15 +37176,17 @@ </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.ConeTwistJointParam"> </argument> <description> </description> </method> <method name="cone_twist_joint_set_param"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.ConeTwistJointParam"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -33178,6 +37194,8 @@ </description> </method> <method name="free_rid"> + <return type="void"> + </return> <argument index="0" name="rid" type="RID"> </argument> <description> @@ -33188,9 +37206,9 @@ </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="axis" type="int"> + <argument index="1" name="axis" type="int" enum="Vector3.Axis"> </argument> - <argument index="2" name="flag" type="int"> + <argument index="2" name="flag" type="int" enum="PhysicsServer.G6DOFJointAxisFlag"> </argument> <description> </description> @@ -33200,19 +37218,21 @@ </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="axis" type="int"> + <argument index="1" name="axis" type="int" enum="Vector3.Axis"> </argument> - <argument index="2" name="param" type="int"> + <argument index="2" name="param" type="int" enum="PhysicsServer.G6DOFJointAxisParam"> </argument> <description> </description> </method> <method name="generic_6dof_joint_set_flag"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="axis" type="int"> + <argument index="1" name="axis" type="int" enum="Vector3.Axis"> </argument> - <argument index="2" name="flag" type="int"> + <argument index="2" name="flag" type="int" enum="PhysicsServer.G6DOFJointAxisFlag"> </argument> <argument index="3" name="enable" type="bool"> </argument> @@ -33220,11 +37240,13 @@ </description> </method> <method name="generic_6dof_joint_set_param"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="axis" type="int"> + <argument index="1" name="axis" type="int" enum="Vector3.Axis"> </argument> - <argument index="2" name="param" type="int"> + <argument index="2" name="param" type="int" enum="PhysicsServer.G6DOFJointAxisParam"> </argument> <argument index="3" name="value" type="float"> </argument> @@ -33234,7 +37256,7 @@ <method name="get_process_info"> <return type="int"> </return> - <argument index="0" name="process_info" type="int"> + <argument index="0" name="process_info" type="int" enum="PhysicsServer.ProcessInfo"> </argument> <description> </description> @@ -33244,7 +37266,7 @@ </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="flag" type="int"> + <argument index="1" name="flag" type="int" enum="PhysicsServer.HingeJointFlag"> </argument> <description> </description> @@ -33254,15 +37276,17 @@ </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.HingeJointParam"> </argument> <description> </description> </method> <method name="hinge_joint_set_flag"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="flag" type="int"> + <argument index="1" name="flag" type="int" enum="PhysicsServer.HingeJointFlag"> </argument> <argument index="2" name="enabled" type="bool"> </argument> @@ -33270,9 +37294,11 @@ </description> </method> <method name="hinge_joint_set_param"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.HingeJointParam"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -33358,7 +37384,7 @@ </description> </method> <method name="joint_get_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="PhysicsServer.JointType"> </return> <argument index="0" name="joint" type="RID"> </argument> @@ -33366,6 +37392,8 @@ </description> </method> <method name="joint_set_solver_priority"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> <argument index="1" name="priority" type="int"> @@ -33394,12 +37422,14 @@ </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.PinJointParam"> </argument> <description> </description> </method> <method name="pin_joint_set_local_a"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> <argument index="1" name="local_A" type="Vector3"> @@ -33408,6 +37438,8 @@ </description> </method> <method name="pin_joint_set_local_b"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> <argument index="1" name="local_B" type="Vector3"> @@ -33416,9 +37448,11 @@ </description> </method> <method name="pin_joint_set_param"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.PinJointParam"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -33426,6 +37460,8 @@ </description> </method> <method name="set_active"> + <return type="void"> + </return> <argument index="0" name="active" type="bool"> </argument> <description> @@ -33434,19 +37470,21 @@ <method name="shape_create"> <return type="RID"> </return> - <argument index="0" name="type" type="int"> + <argument index="0" name="type" type="int" enum="PhysicsServer.ShapeType"> </argument> <description> </description> </method> <method name="shape_get_data" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="shape" type="RID"> </argument> <description> </description> </method> <method name="shape_get_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="PhysicsServer.ShapeType"> </return> <argument index="0" name="shape" type="RID"> </argument> @@ -33454,6 +37492,8 @@ </description> </method> <method name="shape_set_data"> + <return type="void"> + </return> <argument index="0" name="shape" type="RID"> </argument> <argument index="1" name="data" type="Variant"> @@ -33466,15 +37506,17 @@ </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.SliderJointParam"> </argument> <description> </description> </method> <method name="slider_joint_set_param"> + <return type="void"> + </return> <argument index="0" name="joint" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.SliderJointParam"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -33500,7 +37542,7 @@ </return> <argument index="0" name="space" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.SpaceParameter"> </argument> <description> </description> @@ -33514,6 +37556,8 @@ </description> </method> <method name="space_set_active"> + <return type="void"> + </return> <argument index="0" name="space" type="RID"> </argument> <argument index="1" name="active" type="bool"> @@ -33522,9 +37566,11 @@ </description> </method> <method name="space_set_param"> + <return type="void"> + </return> <argument index="0" name="space" type="RID"> </argument> - <argument index="1" name="param" type="int"> + <argument index="1" name="param" type="int" enum="PhysicsServer.SpaceParameter"> </argument> <argument index="2" name="value" type="float"> </argument> @@ -33805,42 +37851,56 @@ </description> </method> <method name="set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="collision_layer" type="int"> </argument> <description> </description> </method> <method name="set_exclude"> + <return type="void"> + </return> <argument index="0" name="exclude" type="Array"> </argument> <description> </description> </method> <method name="set_margin"> + <return type="void"> + </return> <argument index="0" name="margin" type="float"> </argument> <description> </description> </method> <method name="set_object_type_mask"> + <return type="void"> + </return> <argument index="0" name="object_type_mask" type="int"> </argument> <description> </description> </method> <method name="set_shape"> - <argument index="0" name="shape" type="Shape"> + <return type="void"> + </return> + <argument index="0" name="shape" type="Resource"> </argument> <description> </description> </method> <method name="set_shape_rid"> + <return type="void"> + </return> <argument index="0" name="shape" type="RID"> </argument> <description> </description> </method> <method name="set_transform"> + <return type="void"> + </return> <argument index="0" name="transform" type="Transform"> </argument> <description> @@ -33908,13 +37968,15 @@ <method name="get_param" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="PinJoint.Param"> </argument> <description> </description> </method> <method name="set_param"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="PinJoint.Param"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -33954,6 +38016,8 @@ </description> </method> <method name="set_softness"> + <return type="void"> + </return> <argument index="0" name="softness" type="float"> </argument> <description> @@ -34124,8 +38188,10 @@ </class> <class name="PlaneMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a planar [PrimitiveMesh]. </brief_description> <description> + Class representing a planar [PrimitiveMesh]. This flat mesh does not have a thickness. </description> <methods> <method name="get_size" qualifiers="const"> @@ -34147,18 +38213,24 @@ </description> </method> <method name="set_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> </description> </method> <method name="set_subdivide_depth"> + <return type="void"> + </return> <argument index="0" name="subdivide" type="int"> </argument> <description> </description> </method> <method name="set_subdivide_width"> + <return type="void"> + </return> <argument index="0" name="subdivide" type="int"> </argument> <description> @@ -34167,10 +38239,13 @@ </methods> <members> <member name="size" type="Vector2" setter="set_size" getter="get_size" brief=""> + Size of the generated plane. Defaults to (2.0, 2.0). </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" brief=""> + Number of subdivision along the z-axis. Defaults to 0. </member> <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" brief=""> + Number of subdivision along the x-axis. Defaults to 0. </member> </members> <constants> @@ -34189,6 +38264,8 @@ </description> </method> <method name="set_plane"> + <return type="void"> + </return> <argument index="0" name="plane" type="Plane"> </argument> <description> @@ -34210,6 +38287,12 @@ A Polygon2D is defined by a set of n vertices connected together by line segments, meaning that the vertex 1 will be connected with vertex 2, vertex 2 with vertex 3 ..., vertex n-1 with vertex n and vertex n with vertex 1 in order to close the loop and define a polygon. </description> <methods> + <method name="get_antialiased" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="get_color" qualifiers="const"> <return type="Color"> </return> @@ -34246,7 +38329,7 @@ </description> </method> <method name="get_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> Return the polygon texture @@ -34287,7 +38370,17 @@ Return the list of vertex colors. </description> </method> + <method name="set_antialiased"> + <return type="void"> + </return> + <argument index="0" name="antialiased" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> @@ -34295,6 +38388,8 @@ </description> </method> <method name="set_invert"> + <return type="void"> + </return> <argument index="0" name="invert" type="bool"> </argument> <description> @@ -34302,6 +38397,8 @@ </description> </method> <method name="set_invert_border"> + <return type="void"> + </return> <argument index="0" name="invert_border" type="float"> </argument> <description> @@ -34309,6 +38406,8 @@ </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> @@ -34316,6 +38415,8 @@ </description> </method> <method name="set_polygon"> + <return type="void"> + </return> <argument index="0" name="polygon" type="PoolVector2Array"> </argument> <description> @@ -34323,13 +38424,16 @@ </description> </method> <method name="set_texture"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <description> - Set the polygon texture. </description> </method> <method name="set_texture_offset"> + <return type="void"> + </return> <argument index="0" name="texture_offset" type="Vector2"> </argument> <description> @@ -34337,6 +38441,8 @@ </description> </method> <method name="set_texture_rotation"> + <return type="void"> + </return> <argument index="0" name="texture_rotation" type="float"> </argument> <description> @@ -34344,6 +38450,8 @@ </description> </method> <method name="set_texture_scale"> + <return type="void"> + </return> <argument index="0" name="texture_scale" type="Vector2"> </argument> <description> @@ -34351,6 +38459,8 @@ </description> </method> <method name="set_uv"> + <return type="void"> + </return> <argument index="0" name="uv" type="PoolVector2Array"> </argument> <description> @@ -34358,6 +38468,8 @@ </description> </method> <method name="set_vertex_colors"> + <return type="void"> + </return> <argument index="0" name="vertex_colors" type="PoolColorArray"> </argument> <description> @@ -34367,6 +38479,8 @@ </method> </methods> <members> + <member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" brief=""> + </member> <member name="color" type="Color" setter="set_color" getter="get_color" brief=""> </member> <member name="invert_border" type="float" setter="set_invert_border" getter="get_invert_border" brief=""> @@ -34450,6 +38564,8 @@ </description> </method> <method name="set_point_penalty"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="penalty" type="float"> @@ -34458,6 +38574,8 @@ </description> </method> <method name="setup"> + <return type="void"> + </return> <argument index="0" name="points" type="PoolVector2Array"> </argument> <argument index="1" name="connections" type="PoolIntArray"> @@ -35157,27 +39275,35 @@ </description> </method> <method name="popup"> - <argument index="0" name="bounds" type="Rect2" default="Rect2(0, 0, 0, 0)"> + <return type="void"> + </return> + <argument index="0" name="bounds" type="Rect2" default="Rect2( 0, 0, 0, 0 )"> </argument> <description> Popup (show the control in modal form). </description> </method> <method name="popup_centered"> - <argument index="0" name="size" type="Vector2" default="Vector2(0, 0)"> + <return type="void"> + </return> + <argument index="0" name="size" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> Popup (show the control in modal form) in the center of the screen, at the current size, or at a size determined by "size". </description> </method> <method name="popup_centered_minsize"> - <argument index="0" name="minsize" type="Vector2" default="Vector2(0, 0)"> + <return type="void"> + </return> + <argument index="0" name="minsize" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> Popup (show the control in modal form) in the center of the screen, ensuring the size is never smaller than [code]minsize[/code]. </description> </method> <method name="popup_centered_ratio"> + <return type="void"> + </return> <argument index="0" name="ratio" type="float" default="0.75"> </argument> <description> @@ -35185,6 +39311,8 @@ </description> </method> <method name="set_exclusive"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -35209,10 +39337,10 @@ </signal> </signals> <constants> - <constant name="NOTIFICATION_POST_POPUP" value="80"> + <constant name="NOTIFICATION_POST_POPUP" value="80" enum=""> Notification sent right after the popup is shown. </constant> - <constant name="NOTIFICATION_POPUP_HIDE" value="81"> + <constant name="NOTIFICATION_POPUP_HIDE" value="81" enum=""> Notification sent right after the popup is hidden. </constant> </constants> @@ -35238,6 +39366,8 @@ </description> <methods> <method name="add_check_item"> + <return type="void"> + </return> <argument index="0" name="label" type="String"> </argument> <argument index="1" name="id" type="int" default="-1"> @@ -35249,6 +39379,8 @@ </description> </method> <method name="add_check_shortcut"> + <return type="void"> + </return> <argument index="0" name="shortcut" type="ShortCut"> </argument> <argument index="1" name="id" type="int" default="-1"> @@ -35259,7 +39391,9 @@ </description> </method> <method name="add_icon_check_item"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <argument index="1" name="label" type="String"> </argument> @@ -35268,11 +39402,14 @@ <argument index="3" name="accel" type="int" default="0"> </argument> <description> - Add a new checkable item with text "label" and icon "texture". An id can optionally be provided, as well as an accelerator. If no id is provided, one will be created from the index. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. + Add a new checkable item with text "label" and icon "texture". An id can optionally be provided, as well as an accelerator. If no id is provided, one will be + created from the index. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. </description> </method> <method name="add_icon_check_shortcut"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <argument index="1" name="shortcut" type="ShortCut"> </argument> @@ -35284,7 +39421,9 @@ </description> </method> <method name="add_icon_item"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <argument index="1" name="label" type="String"> </argument> @@ -35297,7 +39436,9 @@ </description> </method> <method name="add_icon_shortcut"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <argument index="1" name="shortcut" type="ShortCut"> </argument> @@ -35309,6 +39450,8 @@ </description> </method> <method name="add_item"> + <return type="void"> + </return> <argument index="0" name="label" type="String"> </argument> <argument index="1" name="id" type="int" default="-1"> @@ -35320,11 +39463,15 @@ </description> </method> <method name="add_separator"> + <return type="void"> + </return> <description> Add a separator between items. Separators also occupy an index. </description> </method> <method name="add_shortcut"> + <return type="void"> + </return> <argument index="0" name="shortcut" type="ShortCut"> </argument> <argument index="1" name="id" type="int" default="-1"> @@ -35335,6 +39482,8 @@ </description> </method> <method name="add_submenu_item"> + <return type="void"> + </return> <argument index="0" name="label" type="String"> </argument> <argument index="1" name="submenu" type="String"> @@ -35346,17 +39495,10 @@ </description> </method> <method name="clear"> - <description> - Clear the popup menu, in effect removing all items. - </description> - </method> - <method name="get_item_id" qualifiers="const"> - <return type="int"> + <return type="void"> </return> - <argument index="0" name="idx" type="int"> - </argument> <description> - Return the id of the item at index "idx". + Clear the popup menu, in effect removing all items. </description> </method> <method name="get_item_accelerator" qualifiers="const"> @@ -35376,7 +39518,7 @@ </description> </method> <method name="get_item_icon" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <argument index="0" name="idx" type="int"> </argument> @@ -35384,6 +39526,15 @@ Return the icon of the item at index "idx". </description> </method> + <method name="get_item_id" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <description> + Return the id of the item at index "idx". + </description> + </method> <method name="get_item_index" qualifiers="const"> <return type="int"> </return> @@ -35487,6 +39638,8 @@ </description> </method> <method name="remove_item"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -35494,6 +39647,8 @@ </description> </method> <method name="set_hide_on_checkable_item_selection"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -35501,22 +39656,17 @@ </description> </method> <method name="set_hide_on_item_selection"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> Sets whether or not the PopupMenu will hide on item selection. </description> </method> - <method name="set_item_id"> - <argument index="0" name="idx" type="int"> - </argument> - <argument index="1" name="id" type="int"> - </argument> - <description> - Set the id of the item at index "idx". - </description> - </method> <method name="set_item_accelerator"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="accel" type="int"> @@ -35526,6 +39676,8 @@ </description> </method> <method name="set_item_as_checkable"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="enable" type="bool"> @@ -35535,6 +39687,8 @@ </description> </method> <method name="set_item_as_separator"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="enable" type="bool"> @@ -35544,6 +39698,8 @@ </description> </method> <method name="set_item_checked"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="checked" type="bool"> @@ -35553,6 +39709,8 @@ </description> </method> <method name="set_item_disabled"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="disabled" type="bool"> @@ -35562,15 +39720,29 @@ </description> </method> <method name="set_item_icon"> + <return type="void"> + </return> + <argument index="0" name="idx" type="int"> + </argument> + <argument index="1" name="icon" type="Texture"> + </argument> + <description> + </description> + </method> + <method name="set_item_id"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> - <argument index="1" name="icon" type="Object"> + <argument index="1" name="id" type="int"> </argument> <description> - Set the icon of the item at index "idx". + Set the id of the item at index "idx". </description> </method> <method name="set_item_metadata"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="metadata" type="Variant"> @@ -35580,6 +39752,8 @@ </description> </method> <method name="set_item_shortcut"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="shortcut" type="ShortCut"> @@ -35590,6 +39764,8 @@ </description> </method> <method name="set_item_submenu"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="submenu" type="String"> @@ -35599,6 +39775,8 @@ </description> </method> <method name="set_item_text"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="text" type="String"> @@ -35608,6 +39786,8 @@ </description> </method> <method name="set_item_tooltip"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="tooltip" type="String"> @@ -35616,6 +39796,8 @@ </description> </method> <method name="toggle_item_checked"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -35695,88 +39877,6 @@ </theme_item> </theme_items> </class> -<class name="Portal" inherits="VisualInstance" category="Core"> - <brief_description> - Portals provide virtual openings to rooms. - </brief_description> - <description> - Portals provide virtual openings to [VisualInstance] nodes, so cameras can look at them from the outside. Note that portals are a visibility optimization technique, and are in no way related to the game of the same name (as in, they are not used for teleportation). For more information on how rooms and portals work, see [VisualInstance]. Portals are represented as 2D convex polygon shapes (in the X,Y local plane), and are placed on the surface of the areas occupied by a [VisualInstance], to indicate that the room can be accessed or looked-at through them. If two rooms are next to each other, and two similar portals in each of them share the same world position (and are parallel and opposed to each other), they will automatically "connect" and form "doors" (for example, the portals that connect a kitchen to a living room are placed in the door they share). Portals must always have a [VisualInstance] node as a parent, grandparent or far parent, or else they will not be active. - </description> - <methods> - <method name="get_connect_range" qualifiers="const"> - <return type="float"> - </return> - <description> - Return the range for auto-connecting two portals from different rooms sharing the same space. - </description> - </method> - <method name="get_disable_distance" qualifiers="const"> - <return type="float"> - </return> - <description> - Return the distance threshold for disabling the portal. Every time that the portal goes beyond "distance", it disables itself, becoming the opaque color (see [method set_disabled_color]). - </description> - </method> - <method name="get_disabled_color" qualifiers="const"> - <return type="Color"> - </return> - <description> - Return the color for when the portal goes beyond the disable distance (see [method set_disable_distance]) and becomes disabled. - </description> - </method> - <method name="get_shape" qualifiers="const"> - <return type="PoolVector2Array"> - </return> - <description> - Return the portal shape. The shape is an array of [Vector2] points, representing a convex polygon in the X,Y plane. - </description> - </method> - <method name="is_enabled" qualifiers="const"> - <return type="bool"> - </return> - <description> - Return whether the portal is active. When disabled it causes the parent [VisualInstance] to not be visible any longer when looking through the portal. - </description> - </method> - <method name="set_connect_range"> - <argument index="0" name="range" type="float"> - </argument> - <description> - Set the range for auto-connecting two portals from different rooms sharing the same space. - </description> - </method> - <method name="set_disable_distance"> - <argument index="0" name="distance" type="float"> - </argument> - <description> - Set the distance threshold for disabling the portal. Every time that the portal goes beyond "distance", it disables itself, becoming the opaque color (see [method set_disabled_color]). - </description> - </method> - <method name="set_disabled_color"> - <argument index="0" name="color" type="Color"> - </argument> - <description> - When the portal goes beyond the disable distance (see [method set_disable_distance]), it becomes opaque and displayed with color "color". - </description> - </method> - <method name="set_enabled"> - <argument index="0" name="enable" type="bool"> - </argument> - <description> - Enable the portal (it is enabled by default though), disabling it will cause the parent [VisualInstance] to not be visible any longer when looking through the portal. - </description> - </method> - <method name="set_shape"> - <argument index="0" name="points" type="PoolVector2Array"> - </argument> - <description> - Set the portal shape. The shape is an array of [Vector2] points, representing a convex polygon in the X,Y plane. - </description> - </method> - </methods> - <constants> - </constants> -</class> <class name="Position2D" inherits="Node2D" category="Core"> <brief_description> Generic 2D Position hint for editing. @@ -35803,8 +39903,10 @@ </class> <class name="PrimitiveMesh" inherits="Mesh" category="Core"> <brief_description> + Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. </brief_description> <description> + Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. </description> <methods> <method name="get_material" qualifiers="const"> @@ -35814,6 +39916,8 @@ </description> </method> <method name="set_material"> + <return type="void"> + </return> <argument index="0" name="material" type="Material"> </argument> <description> @@ -35822,6 +39926,7 @@ </methods> <members> <member name="material" type="Material" setter="set_material" getter="get_material" brief=""> + The current [Material] of the primitive mesh. </member> </members> <constants> @@ -35829,8 +39934,10 @@ </class> <class name="PrismMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a prism-shaped [PrimitiveMesh]. </brief_description> <description> + Class representing a prism-shaped [PrimitiveMesh]. </description> <methods> <method name="get_left_to_right" qualifiers="const"> @@ -35864,30 +39971,40 @@ </description> </method> <method name="set_left_to_right"> + <return type="void"> + </return> <argument index="0" name="left_to_right" type="float"> </argument> <description> </description> </method> <method name="set_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector3"> </argument> <description> </description> </method> <method name="set_subdivide_depth"> + <return type="void"> + </return> <argument index="0" name="segments" type="int"> </argument> <description> </description> </method> <method name="set_subdivide_height"> + <return type="void"> + </return> <argument index="0" name="segments" type="int"> </argument> <description> </description> </method> <method name="set_subdivide_width"> + <return type="void"> + </return> <argument index="0" name="segments" type="int"> </argument> <description> @@ -35896,14 +40013,19 @@ </methods> <members> <member name="left_to_right" type="float" setter="set_left_to_right" getter="get_left_to_right" brief=""> + Displacement of of the upper edge along the x-axis. 0.0 positions edge straight above the bottome left edge. Defaults to 0.5 (positioned on the midpoint). </member> - <member name="size" type="Vector2" setter="set_size" getter="get_size" brief=""> + <member name="size" type="Vector3" setter="set_size" getter="get_size" brief=""> + Size of the prism. Defaults to (2.0, 2.0, 2.0). </member> <member name="subdivide_depth" type="int" setter="set_subdivide_depth" getter="get_subdivide_depth" brief=""> + Number of added edge loops along the z-axis. Defaults to 0. </member> <member name="subdivide_height" type="int" setter="set_subdivide_height" getter="get_subdivide_height" brief=""> + Number of added edge loops along the y-axis. Defaults to 0. </member> <member name="subdivide_width" type="int" setter="set_subdivide_width" getter="get_subdivide_width" brief=""> + Number of added edge loops along the x-axis. Defaults to 0. </member> </members> <constants> @@ -36006,103 +40128,135 @@ </description> </method> <method name="get_texture_size" qualifiers="const"> - <return type="int"> + <return type="int" enum="ProceduralSky.TextureSize"> </return> <description> </description> </method> <method name="set_ground_bottom_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_ground_curve"> + <return type="void"> + </return> <argument index="0" name="curve" type="float"> </argument> <description> </description> </method> <method name="set_ground_energy"> + <return type="void"> + </return> <argument index="0" name="energy" type="float"> </argument> <description> </description> </method> <method name="set_ground_horizon_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_sky_curve"> + <return type="void"> + </return> <argument index="0" name="curve" type="float"> </argument> <description> </description> </method> <method name="set_sky_energy"> + <return type="void"> + </return> <argument index="0" name="energy" type="float"> </argument> <description> </description> </method> <method name="set_sky_horizon_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_sky_top_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_sun_angle_max"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> </description> </method> <method name="set_sun_angle_min"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> </description> </method> <method name="set_sun_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_sun_curve"> + <return type="void"> + </return> <argument index="0" name="curve" type="float"> </argument> <description> </description> </method> <method name="set_sun_energy"> + <return type="void"> + </return> <argument index="0" name="energy" type="float"> </argument> <description> </description> </method> <method name="set_sun_latitude"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> </description> </method> <method name="set_sun_longitude"> + <return type="void"> + </return> <argument index="0" name="degrees" type="float"> </argument> <description> </description> </method> <method name="set_texture_size"> - <argument index="0" name="size" type="int"> + <return type="void"> + </return> + <argument index="0" name="size" type="int" enum="ProceduralSky.TextureSize"> </argument> <description> </description> @@ -36139,10 +40293,22 @@ </member> <member name="sun_longitude" type="float" setter="set_sun_longitude" getter="get_sun_longitude" brief=""> </member> - <member name="texture_size" type="int" setter="set_texture_size" getter="get_texture_size" brief=""> + <member name="texture_size" type="int" setter="set_texture_size" getter="get_texture_size" brief="" enum="ProceduralSky.TextureSize"> </member> </members> <constants> + <constant name="TEXTURE_SIZE_256" value="0"> + </constant> + <constant name="TEXTURE_SIZE_512" value="1"> + </constant> + <constant name="TEXTURE_SIZE_1024" value="2"> + </constant> + <constant name="TEXTURE_SIZE_2048" value="3"> + </constant> + <constant name="TEXTURE_SIZE_4096" value="4"> + </constant> + <constant name="TEXTURE_SIZE_MAX" value="5"> + </constant> </constants> </class> <class name="ProgressBar" inherits="Range" category="Core"> @@ -36160,6 +40326,8 @@ </description> </method> <method name="set_percent_visible"> + <return type="void"> + </return> <argument index="0" name="visible" type="bool"> </argument> <description> @@ -36185,6 +40353,160 @@ </theme_item> </theme_items> </class> +<class name="ProjectSettings" inherits="Object" category="Core"> + <brief_description> + Contains global variables accessible from everywhere. + </brief_description> + <description> + Contains global variables accessible from everywhere. Use the normal [Object] API, such as "ProjectSettings.get(variable)", "ProjectSettings.set(variable,value)" or "ProjectSettings.has(variable)" to access them. Variables stored in project.godot are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options. + </description> + <methods> + <method name="add_property_info"> + <return type="void"> + </return> + <argument index="0" name="hint" type="Dictionary"> + </argument> + <description> + Add a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see TYPE_* in [@Global Scope]), and optionally hint:[int](see PROPERTY_HINT_* in [@Global Scope]), hint_string:[String]. + Example: + [codeblock] + ProjectSettings.set("category/property_name", 0) + + var property_info = { + "name": "category/property_name", + "type": TYPE_INT, + "hint": PROPERTY_HINT_ENUM, + "hint_string": "one,two,three" + } + + ProjectSettings.add_property_info(property_info) + [/codeblock] + </description> + </method> + <method name="clear"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + Clear the whole configuration (not recommended, may break things). + </description> + </method> + <method name="get_order" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + Return the order of a configuration value (influences when saved to the config file). + </description> + </method> + <method name="get_singleton" qualifiers="const"> + <return type="Object"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="globalize_path" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <description> + Convert a localized path (res://) to a full native OS path. + </description> + </method> + <method name="has" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + Return true if a configuration value is present. + </description> + </method> + <method name="has_singleton" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="load_resource_pack"> + <return type="bool"> + </return> + <argument index="0" name="pack" type="String"> + </argument> + <description> + </description> + </method> + <method name="localize_path" qualifiers="const"> + <return type="String"> + </return> + <argument index="0" name="path" type="String"> + </argument> + <description> + Convert a path to a localized path (res:// path). + </description> + </method> + <method name="property_can_revert"> + <return type="bool"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="property_get_revert"> + <return type="Variant"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="save"> + <return type="int" enum="Error"> + </return> + <description> + </description> + </method> + <method name="save_custom"> + <return type="int" enum="Error"> + </return> + <argument index="0" name="file" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_initial_value"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <argument index="1" name="value" type="Variant"> + </argument> + <description> + </description> + </method> + <method name="set_order"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> + </argument> + <argument index="1" name="pos" type="int"> + </argument> + <description> + Set the order of a configuration value (influences when saved to the config file). + </description> + </method> + </methods> + <constants> + </constants> +</class> <class name="ProximityGroup" inherits="Spatial" category="Core"> <brief_description> General purpose proximity-detection node. @@ -36194,6 +40516,8 @@ </description> <methods> <method name="broadcast"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="parameters" type="Variant"> @@ -36208,18 +40532,24 @@ </description> </method> <method name="set_dispatch_mode"> + <return type="void"> + </return> <argument index="0" name="mode" type="int"> </argument> <description> </description> </method> <method name="set_grid_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="Vector3"> </argument> <description> </description> </method> <method name="set_group_name"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -36245,8 +40575,10 @@ </class> <class name="QuadMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a square mesh. </brief_description> <description> + Class representing a square mesh with size (2,2,0). Consider using a [PlaneMesh] if you require a differently sized plane. </description> <methods> </methods> @@ -36486,6 +40818,8 @@ </description> </method> <method name="set_as_ratio"> + <return type="void"> + </return> <argument index="0" name="value" type="float"> </argument> <description> @@ -36493,18 +40827,24 @@ </description> </method> <method name="set_exp_ratio"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_max"> + <return type="void"> + </return> <argument index="0" name="maximum" type="float"> </argument> <description> </description> </method> <method name="set_min"> + <return type="void"> + </return> <argument index="0" name="minimum" type="float"> </argument> <description> @@ -36512,6 +40852,8 @@ </description> </method> <method name="set_page"> + <return type="void"> + </return> <argument index="0" name="pagesize" type="float"> </argument> <description> @@ -36519,6 +40861,8 @@ </description> </method> <method name="set_step"> + <return type="void"> + </return> <argument index="0" name="step" type="float"> </argument> <description> @@ -36526,24 +40870,32 @@ </description> </method> <method name="set_use_rounded_values"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_value"> + <return type="void"> + </return> <argument index="0" name="value" type="float"> </argument> <description> </description> </method> <method name="share"> - <argument index="0" name="with" type="Object"> + <return type="void"> + </return> + <argument index="0" name="with" type="Node"> </argument> <description> </description> </method> <method name="unshare"> + <return type="void"> + </return> <description> </description> </method> @@ -36586,36 +40938,46 @@ Query the closest object intersecting a ray. </brief_description> <description> - A RayCast represents a line from its origin to its destination position [code]cast_to[/code], it is used to query the 3D space in order to find the closest object intersecting with the ray. + A RayCast represents a line from its origin to its destination position, [code]cast_to[/code]. It is used to query the 3D space in order to find the closest object along the path of the ray. - RayCast can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks. + RayCast can ignore some objects by adding them to the exception list via [code]add_exception[/code], by setting proper filtering with collision layers, or by filtering object types with type masks. - Only enabled raycasts will be able to query the space and report collisions! + Only enabled raycasts will be able to query the space and report collisions. RayCast calculates intersection every fixed frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between fixed frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. </description> <methods> <method name="add_exception"> + <return type="void"> + </return> <argument index="0" name="node" type="Object"> </argument> <description> - Adds a collision exception so the ray does not report collisions with the specified [code]node[/code]. + Adds a collision exception so the ray does not report collisions with the specified node. </description> </method> <method name="add_exception_rid"> + <return type="void"> + </return> <argument index="0" name="rid" type="RID"> </argument> <description> + Adds a collision exception so the ray does not report collisions with the specified [RID]. </description> </method> <method name="clear_exceptions"> + <return type="void"> + </return> <description> - Removes all collision exception for this ray. + Removes all collision exceptions for this ray. </description> </method> <method name="force_raycast_update"> + <return type="void"> + </return> <description> - Updates the collision information in case if this object's properties changed during the current frame (for example position, rotation or the cast_point). Note, [code]set_enabled[/code] is not required for this to work. + Updates the collision information for the ray. + Use this method to update the collision information immediately instead of waiting for the next [code]_fixed_process[/code] call, for example if the ray or its parent has changed state. Note: [code]enabled == true[/code] is not required for this to work. </description> </method> <method name="get_cast_to" qualifiers="const"> @@ -36629,14 +40991,24 @@ <return type="Object"> </return> <description> - Return the closest object the ray is pointing to. Note that this does not consider the length of the vector, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Return the closest object the ray is pointing to. Note that this does not consider the length of the ray, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Example: + [codeblock] + if RayCast.is_colliding(): + var collider = RayCast.get_collider() + [/codeblock] </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="int"> </return> <description> - Returns the collision shape of the closest object the ray is pointing to. + Returns the collision shape of the closest object the ray is pointing to. Note that this does not consider the length of the ray, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Example: + [codeblock] + if RayCast.is_colliding(): + var shape = RayCast.get_collider_shape() + [/codeblock] </description> </method> <method name="get_collision_layer" qualifiers="const"> @@ -36650,14 +41022,14 @@ <return type="Vector3"> </return> <description> - Returns the normal of the intersecting object shape face containing the collision point. + Returns the normal of the intersecting object's shape at the collision point. </description> </method> <method name="get_collision_point" qualifiers="const"> <return type="Vector3"> </return> <description> - Returns collision point. This point is in [b]global[/b] coordinate system. + Returns the collision point at which the ray intersects the closest object. Note: this point is in the [b]global[/b] coordinate system. </description> </method> <method name="get_type_mask" qualifiers="const"> @@ -36678,30 +41050,39 @@ <return type="bool"> </return> <description> - Returns whether this raycast is enabled or not. + Returns whether the ray is enabled or not. </description> </method> <method name="remove_exception"> + <return type="void"> + </return> <argument index="0" name="node" type="Object"> </argument> <description> - Removes a collision exception so the ray does report collisions with the specified [code]node[/code]. + Removes a collision exception so the ray does report collisions with the specified node. </description> </method> <method name="remove_exception_rid"> + <return type="void"> + </return> <argument index="0" name="rid" type="RID"> </argument> <description> + Removes a collision exception so the ray does report collisions with the specified [RID]. </description> </method> <method name="set_cast_to"> + <return type="void"> + </return> <argument index="0" name="local_point" type="Vector3"> </argument> <description> - Sets to which point ray should be casted. This point is in [b]local[/b] coordinate system. + Sets the ray destination point, so that the ray will test from the ray's origin to [code]local_point[/code]. </description> </method> <method name="set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> @@ -36709,6 +41090,8 @@ </description> </method> <method name="set_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -36716,6 +41099,8 @@ </description> </method> <method name="set_type_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> @@ -36725,12 +41110,20 @@ </methods> <members> <member name="cast_to" type="Vector3" setter="set_cast_to" getter="get_cast_to" brief=""> + The ray's destination point, relative to the RayCast's [code]position[/code]. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> + The RayCast's collison layer(s). Only bodies in the same collision layer(s) will be detected. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief=""> + If [code]true[/code], collisions will be reported. Default value: [code]false[/code]. </member> <member name="type_mask" type="int" setter="set_type_mask" getter="get_type_mask" brief=""> + Object types to detect using a logical sum (OR operation) of type constants defined in [Physics2DDirectSpaceState]. + Example: + [codeblock] + RayCast.type_mask = Physics2DDirectSpaceState.TYPE_MASK_STATIC_BODY | Physics2DDirectSpaceState.TYPE_MASK_KINEMATIC_BODY + [/codeblock] </member> </members> <constants> @@ -36741,36 +41134,42 @@ Query the closest object intersecting a ray. </brief_description> <description> - A RayCast2D represents a line from its origin to its destination position [code]cast_to[/code], it is used to query the 2D space in order to find the closest object intersecting with the ray. - - RayCast2D can ignore some objects by adding them to the exception list via [code]add_exception[/code], setting proper filtering with layers, or by filtering object types with type masks. - - Only enabled raycasts will be able to query the space and report collisions! - + A RayCast represents a line from its origin to its destination position, [code]cast_to[/code]. It is used to query the 2D space in order to find the closest object along the path of the ray. + RayCast2D can ignore some objects by adding them to the exception list via [code]add_exception[/code], by setting proper filtering with collision layers, or by filtering object types with type masks. + Only enabled raycasts will be able to query the space and report collisions. RayCast2D calculates intersection every fixed frame (see [Node]), and the result is cached so it can be used later until the next frame. If multiple queries are required between fixed frames (or during the same frame) use [method force_raycast_update] after adjusting the raycast. </description> <methods> <method name="add_exception"> + <return type="void"> + </return> <argument index="0" name="node" type="Object"> </argument> <description> - Adds a collision exception so the ray does not report collisions with the specified [code]node[/code]. + Adds a collision exception so the ray does not report collisions with the specified node. </description> </method> <method name="add_exception_rid"> + <return type="void"> + </return> <argument index="0" name="rid" type="RID"> </argument> <description> + Adds a collision exception so the ray does not report collisions with the specified [RID]. </description> </method> <method name="clear_exceptions"> + <return type="void"> + </return> <description> - Removes all collision exception for this ray. + Removes all collision exceptions for this ray. </description> </method> <method name="force_raycast_update"> + <return type="void"> + </return> <description> - Updates the collision information in case if this object's properties changed during the current frame (for example position, rotation or the cast_point). Note, [code]set_enabled[/code] is not required for this to work. + Updates the collision information for the ray. Use this method to update the collision information immediately instead of waiting for the next [code]_fixed_process[/code] call, for example if the ray or its parent has changed state. Note: [code]enabled == true[/code] is not required for this to work. </description> </method> <method name="get_cast_to" qualifiers="const"> @@ -36784,14 +41183,24 @@ <return type="Object"> </return> <description> - Return the closest object the ray is pointing to. Note that this does not consider the length of the vector, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Returns the closest object the ray is pointing to. Note that this does not consider the length of the ray, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Example: + [codeblock] + if RayCast2D.is_colliding(): + var collider = RayCast2D.get_collider() + [/codeblock] </description> </method> <method name="get_collider_shape" qualifiers="const"> <return type="int"> </return> <description> - Returns the collision shape of the closest object the ray is pointing to. + Returns the collision shape of the closest object the ray is pointing to. Note that this does not consider the length of the ray, so you must also use [method is_colliding] to check if the object returned is actually colliding with the ray. + Example: + [codeblock] + if RayCast2D.is_colliding(): + var shape = RayCast2D.get_collider_shape() + [/codeblock] </description> </method> <method name="get_collision_layer" qualifiers="const"> @@ -36805,14 +41214,14 @@ <return type="Vector2"> </return> <description> - Returns the normal of the intersecting object shape face containing the collision point. + Returns the normal of the intersecting object's shape at the collision point. </description> </method> <method name="get_collision_point" qualifiers="const"> <return type="Vector2"> </return> <description> - Returns the collision point in which the ray intersects the closest object. This point is in [b]global[/b] coordinate system. + Returns the collision point at which the ray intersects the closest object. Note: this point is in the [b]global[/b] coordinate system. </description> </method> <method name="get_exclude_parent_body" qualifiers="const"> @@ -36844,19 +41253,26 @@ </description> </method> <method name="remove_exception"> + <return type="void"> + </return> <argument index="0" name="node" type="Object"> </argument> <description> - Removes a collision exception so the ray does report collisions with the specified [code]node[/code]. + Removes a collision exception so the ray does report collisions with the specified node. </description> </method> <method name="remove_exception_rid"> + <return type="void"> + </return> <argument index="0" name="rid" type="RID"> </argument> <description> + Removes a collision exception so the ray does report collisions with the specified [RID]. </description> </method> <method name="set_cast_to"> + <return type="void"> + </return> <argument index="0" name="local_point" type="Vector2"> </argument> <description> @@ -36864,6 +41280,8 @@ </description> </method> <method name="set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> @@ -36871,6 +41289,8 @@ </description> </method> <method name="set_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -36878,6 +41298,8 @@ </description> </method> <method name="set_exclude_parent_body"> + <return type="void"> + </return> <argument index="0" name="mask" type="bool"> </argument> <description> @@ -36885,6 +41307,8 @@ </description> </method> <method name="set_type_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> @@ -36894,14 +41318,23 @@ </methods> <members> <member name="cast_to" type="Vector2" setter="set_cast_to" getter="get_cast_to" brief=""> + The ray's destination point, relative to the RayCast's [code]position[/code]. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> + The RayCast2D's collison layer(s). Only bodies in the same collision layer(s) will be detected. </member> <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief=""> + If [code]true[/code], collisions will be reported. Default value: [code]false[/code]. </member> <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" brief=""> + If [code]true[/code], the parent node will be excluded from collision detection. Default value: [code]true[/code]. </member> <member name="type_mask" type="int" setter="set_type_mask" getter="get_type_mask" brief=""> + Object types to detect using a logical sum (OR operation) of type constants defined in [Physics2DDirectSpaceState]. + Example: + [codeblock] + RayCast.type_mask = Physics2DDirectSpaceState.TYPE_MASK_STATIC_BODY | Physics2DDirectSpaceState.TYPE_MASK_KINEMATIC_BODY + [/codeblock] </member> </members> <constants> @@ -36920,6 +41353,8 @@ </description> </method> <method name="set_length"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> @@ -36949,6 +41384,8 @@ </description> </method> <method name="set_length"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> @@ -37326,6 +41763,8 @@ </description> </method> <method name="set_extents"> + <return type="void"> + </return> <argument index="0" name="extents" type="Vector2"> </argument> <description> @@ -37355,6 +41794,8 @@ </description> </method> <method name="reference"> + <return type="void"> + </return> <description> Increase the internal reference counter. Use this only if you really know what you are doing. </description> @@ -37447,7 +41888,7 @@ </description> </method> <method name="get_update_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="ReflectionProbe.UpdateMode"> </return> <description> </description> @@ -37465,73 +41906,97 @@ </description> </method> <method name="set_as_interior"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_cull_mask"> + <return type="void"> + </return> <argument index="0" name="layers" type="int"> </argument> <description> </description> </method> <method name="set_enable_box_projection"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_enable_shadows"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_extents"> + <return type="void"> + </return> <argument index="0" name="extents" type="Vector3"> </argument> <description> </description> </method> <method name="set_intensity"> + <return type="void"> + </return> <argument index="0" name="intensity" type="float"> </argument> <description> </description> </method> <method name="set_interior_ambient"> + <return type="void"> + </return> <argument index="0" name="ambient" type="Color"> </argument> <description> </description> </method> <method name="set_interior_ambient_energy"> + <return type="void"> + </return> <argument index="0" name="ambient_energy" type="float"> </argument> <description> </description> </method> <method name="set_interior_ambient_probe_contribution"> + <return type="void"> + </return> <argument index="0" name="ambient_probe_contribution" type="float"> </argument> <description> </description> </method> <method name="set_max_distance"> + <return type="void"> + </return> <argument index="0" name="max_distance" type="float"> </argument> <description> </description> </method> <method name="set_origin_offset"> + <return type="void"> + </return> <argument index="0" name="origin_offset" type="Vector3"> </argument> <description> </description> </method> <method name="set_update_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="ReflectionProbe.UpdateMode"> </argument> <description> </description> @@ -37544,7 +42009,7 @@ </member> <member name="enable_shadows" type="bool" setter="set_enable_shadows" getter="are_shadows_enabled" brief=""> </member> - <member name="extents" type="Vector2" setter="set_extents" getter="get_extents" brief=""> + <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" brief=""> </member> <member name="intensity" type="float" setter="set_intensity" getter="get_intensity" brief=""> </member> @@ -37558,9 +42023,9 @@ </member> <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" brief=""> </member> - <member name="origin_offset" type="Vector2" setter="set_origin_offset" getter="get_origin_offset" brief=""> + <member name="origin_offset" type="Vector3" setter="set_origin_offset" getter="get_origin_offset" brief=""> </member> - <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" brief=""> + <member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" brief="" enum="ReflectionProbe.UpdateMode"> </member> </members> <constants> @@ -37570,7 +42035,7 @@ </constant> </constants> </class> -<class name="RegEx" inherits="Resource" category="Core"> +<class name="RegEx" inherits="Reference" category="Core"> <brief_description> Simple regular expression matcher. </brief_description> @@ -37602,12 +42067,14 @@ </description> <methods> <method name="clear"> + <return type="void"> + </return> <description> This method resets the state of the object, as it was freshly created. Namely, it unassigns the regular expression of this object. </description> </method> <method name="compile"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="pattern" type="String"> </argument> @@ -37646,9 +42113,9 @@ <method name="search" qualifiers="const"> <return type="RegExMatch"> </return> - <argument index="0" name="text" type="String"> + <argument index="0" name="subject" type="String"> </argument> - <argument index="1" name="start" type="int" default="0"> + <argument index="1" name="offset" type="int" default="0"> </argument> <argument index="2" name="end" type="int" default="-1"> </argument> @@ -37659,13 +42126,13 @@ <method name="sub" qualifiers="const"> <return type="String"> </return> - <argument index="0" name="text" type="String"> + <argument index="0" name="subject" type="String"> </argument> <argument index="1" name="replacement" type="String"> </argument> <argument index="2" name="all" type="bool" default="false"> </argument> - <argument index="3" name="start" type="int" default="0"> + <argument index="3" name="offset" type="int" default="0"> </argument> <argument index="4" name="end" type="int" default="-1"> </argument> @@ -37674,10 +42141,6 @@ </description> </method> </methods> - <members> - <member name="pattern" type="String" setter="compile" getter="get_pattern" brief=""> - </member> - </members> <constants> </constants> </class> @@ -37687,15 +42150,6 @@ <description> </description> <methods> - <method name="expand" qualifiers="const"> - <return type="String"> - </return> - <argument index="0" name="template" type="String"> - </argument> - <description> - Using results from the search, returns the specified string with escapes and backreferences such as [code]\1[/code] and [code]\g<name>[/code] expanded and resolved. - </description> - </method> <method name="get_end" qualifiers="const"> <return type="int"> </return> @@ -37705,13 +42159,6 @@ Returns the end position of the match in the string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). </description> </method> - <method name="get_group_array" qualifiers="const"> - <return type="Array"> - </return> - <description> - Returns an array of the results of the numeric groups. - </description> - </method> <method name="get_group_count" qualifiers="const"> <return type="int"> </return> @@ -37719,15 +42166,8 @@ Returns the number of numeric capturing groups. </description> </method> - <method name="get_name_dict" qualifiers="const"> - <return type="Dictionary"> - </return> - <description> - Returns a dictionary containing the named capturing groups and their results. - </description> - </method> <method name="get_names" qualifiers="const"> - <return type="Array"> + <return type="Dictionary"> </return> <description> Returns an array of names of named capturing groups. @@ -37751,6 +42191,18 @@ Returns the result of the match in the string. An integer can be specified for numeric groups or a string for named groups. Returns -1 if that group wasn't found or doesn't exist. Defaults to 0 (whole pattern). </description> </method> + <method name="get_strings" qualifiers="const"> + <return type="Array"> + </return> + <description> + </description> + </method> + <method name="get_subject" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> </methods> <constants> </constants> @@ -37792,30 +42244,40 @@ </description> </method> <method name="set_remote_node"> + <return type="void"> + </return> <argument index="0" name="path" type="NodePath"> </argument> <description> </description> </method> <method name="set_update_position"> + <return type="void"> + </return> <argument index="0" name="update_remote_position" type="bool"> </argument> <description> </description> </method> <method name="set_update_rotation"> + <return type="void"> + </return> <argument index="0" name="update_remote_rotation" type="bool"> </argument> <description> </description> </method> <method name="set_update_scale"> + <return type="void"> + </return> <argument index="0" name="update_remote_scale" type="bool"> </argument> <description> </description> </method> <method name="set_use_global_coordinates"> + <return type="void"> + </return> <argument index="0" name="use_global_coordinates" type="bool"> </argument> <description> @@ -37874,30 +42336,40 @@ </description> </method> <method name="set_remote_node"> + <return type="void"> + </return> <argument index="0" name="path" type="NodePath"> </argument> <description> </description> </method> <method name="set_update_position"> + <return type="void"> + </return> <argument index="0" name="update_remote_position" type="bool"> </argument> <description> </description> </method> <method name="set_update_rotation"> + <return type="void"> + </return> <argument index="0" name="update_remote_rotation" type="bool"> </argument> <description> </description> </method> <method name="set_update_scale"> + <return type="void"> + </return> <argument index="0" name="update_remote_scale" type="bool"> </argument> <description> </description> </method> <method name="set_use_global_coordinates"> + <return type="void"> + </return> <argument index="0" name="use_global_coordinates" type="bool"> </argument> <description> @@ -37928,11 +42400,13 @@ </description> <methods> <method name="_setup_local_to_scene" qualifiers="virtual"> + <return type="void"> + </return> <description> </description> </method> <method name="duplicate" qualifiers="const"> - <return type="Object"> + <return type="Resource"> </return> <argument index="0" name="subresources" type="bool" default="false"> </argument> @@ -37973,12 +42447,16 @@ </description> </method> <method name="set_local_to_scene"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_name"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -37986,6 +42464,8 @@ </description> </method> <method name="set_path"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> @@ -37993,10 +42473,14 @@ </description> </method> <method name="setup_local_to_scene"> + <return type="void"> + </return> <description> </description> </method> <method name="take_over_path"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> @@ -38050,7 +42534,7 @@ </description> <methods> <method name="get_resource"> - <return type="Object"> + <return type="Resource"> </return> <description> Return the loaded resource (only if loaded). Otherwise, returns null. @@ -38071,14 +42555,14 @@ </description> </method> <method name="poll"> - <return type="int"> + <return type="int" enum="Error"> </return> <description> Poll the load. If OK is returned, this means poll will have to be called again. If ERR_FILE_EOF is returned, them the load has finished and the resource can be obtained by calling [method get_resource]. </description> </method> <method name="wait"> - <return type="int"> + <return type="int" enum="Error"> </return> <description> </description> @@ -38144,6 +42628,8 @@ </description> </method> <method name="set_abort_on_missing_resources"> + <return type="void"> + </return> <argument index="0" name="abort" type="bool"> </argument> <description> @@ -38163,16 +42649,17 @@ </description> <methods> <method name="add_resource"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> - <argument index="1" name="resource" type="Object"> + <argument index="1" name="resource" type="Resource"> </argument> <description> - Add a resource to the preloader. Set the text-id that will be used to identify it (retrieve it/erase it/etc). </description> </method> <method name="get_resource" qualifiers="const"> - <return type="Object"> + <return type="Resource"> </return> <argument index="0" name="name" type="String"> </argument> @@ -38197,6 +42684,8 @@ </description> </method> <method name="remove_resource"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -38204,6 +42693,8 @@ </description> </method> <method name="rename_resource"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="newname" type="String"> @@ -38231,14 +42722,14 @@ <method name="get_recognized_extensions"> <return type="PoolStringArray"> </return> - <argument index="0" name="type" type="Object"> + <argument index="0" name="type" type="Resource"> </argument> <description> Return the list of extensions available for saving a resource of a given type. </description> </method> <method name="save"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -38275,19 +42766,23 @@ </description> <methods> <method name="add_image"> + <return type="void"> + </return> <argument index="0" name="image" type="Texture"> </argument> <description> </description> </method> <method name="add_text"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> </description> </method> <method name="append_bbcode"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="bbcode" type="String"> </argument> @@ -38295,6 +42790,8 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> </description> </method> @@ -38373,11 +42870,13 @@ </description> </method> <method name="newline"> + <return type="void"> + </return> <description> </description> </method> <method name="parse_bbcode"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="bbcode" type="String"> </argument> @@ -38385,104 +42884,138 @@ </description> </method> <method name="pop"> + <return type="void"> + </return> <description> </description> </method> <method name="push_align"> - <argument index="0" name="align" type="int"> + <return type="void"> + </return> + <argument index="0" name="align" type="int" enum="RichTextLabel.Align"> </argument> <description> </description> </method> <method name="push_cell"> + <return type="void"> + </return> <description> </description> </method> <method name="push_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="push_font"> + <return type="void"> + </return> <argument index="0" name="font" type="Font"> </argument> <description> </description> </method> <method name="push_indent"> + <return type="void"> + </return> <argument index="0" name="level" type="int"> </argument> <description> </description> </method> <method name="push_list"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="RichTextLabel.ListType"> </argument> <description> </description> </method> <method name="push_meta"> + <return type="void"> + </return> <argument index="0" name="data" type="Variant"> </argument> <description> </description> </method> <method name="push_table"> + <return type="void"> + </return> <argument index="0" name="columns" type="int"> </argument> <description> </description> </method> <method name="push_underline"> + <return type="void"> + </return> <description> </description> </method> <method name="remove_line"> <return type="bool"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="line" type="int"> </argument> <description> </description> </method> <method name="scroll_to_line"> + <return type="void"> + </return> <argument index="0" name="line" type="int"> </argument> <description> </description> </method> <method name="set_bbcode"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> </description> </method> <method name="set_meta_underline"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_percent_visible"> + <return type="void"> + </return> <argument index="0" name="percent_visible" type="float"> </argument> <description> </description> </method> <method name="set_scroll_active"> + <return type="void"> + </return> <argument index="0" name="active" type="bool"> </argument> <description> </description> </method> <method name="set_scroll_follow"> + <return type="void"> + </return> <argument index="0" name="follow" type="bool"> </argument> <description> </description> </method> <method name="set_selection_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -38490,12 +43023,16 @@ </description> </method> <method name="set_tab_size"> + <return type="void"> + </return> <argument index="0" name="spaces" type="int"> </argument> <description> </description> </method> <method name="set_table_column_expand"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="expand" type="bool"> @@ -38506,18 +43043,24 @@ </description> </method> <method name="set_text"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> </description> </method> <method name="set_use_bbcode"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_visible_characters"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> @@ -38597,6 +43140,8 @@ </theme_item> <theme_item name="mono_font" type="Font"> </theme_item> + <theme_item name="normal" type="StyleBox"> + </theme_item> <theme_item name="normal_font" type="Font"> </theme_item> <theme_item name="selection_color" type="Color"> @@ -38616,6 +43161,8 @@ </description> <methods> <method name="_integrate_forces" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="state" type="PhysicsDirectBodyState"> </argument> <description> @@ -38623,6 +43170,8 @@ </description> </method> <method name="apply_impulse"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector3"> </argument> <argument index="1" name="impulse" type="Vector3"> @@ -38646,7 +43195,7 @@ </description> </method> <method name="get_axis_lock" qualifiers="const"> - <return type="int"> + <return type="int" enum="RigidBody.AxisLock"> </return> <description> Return the current axis lock of the body. One of AXIS_LOCK_* enum. @@ -38709,7 +43258,7 @@ </description> </method> <method name="get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="RigidBody.Mode"> </return> <description> Return the current body mode, see [method set_mode]. @@ -38758,6 +43307,8 @@ </description> </method> <method name="set_angular_damp"> + <return type="void"> + </return> <argument index="0" name="angular_damp" type="float"> </argument> <description> @@ -38765,6 +43316,8 @@ </description> </method> <method name="set_angular_velocity"> + <return type="void"> + </return> <argument index="0" name="angular_velocity" type="Vector3"> </argument> <description> @@ -38772,13 +43325,17 @@ </description> </method> <method name="set_axis_lock"> - <argument index="0" name="axis_lock" type="int"> + <return type="void"> + </return> + <argument index="0" name="axis_lock" type="int" enum="RigidBody.AxisLock"> </argument> <description> Set the axis lock of the body, from the AXIS_LOCK_* enum. Axis lock stops the body from moving along the specified axis(X/Y/Z) and rotating along the other two axes. </description> </method> <method name="set_axis_velocity"> + <return type="void"> + </return> <argument index="0" name="axis_velocity" type="Vector3"> </argument> <description> @@ -38786,6 +43343,8 @@ </description> </method> <method name="set_bounce"> + <return type="void"> + </return> <argument index="0" name="bounce" type="float"> </argument> <description> @@ -38793,6 +43352,8 @@ </description> </method> <method name="set_can_sleep"> + <return type="void"> + </return> <argument index="0" name="able_to_sleep" type="bool"> </argument> <description> @@ -38801,6 +43362,8 @@ </description> </method> <method name="set_contact_monitor"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -38808,6 +43371,8 @@ </description> </method> <method name="set_friction"> + <return type="void"> + </return> <argument index="0" name="friction" type="float"> </argument> <description> @@ -38815,6 +43380,8 @@ </description> </method> <method name="set_gravity_scale"> + <return type="void"> + </return> <argument index="0" name="gravity_scale" type="float"> </argument> <description> @@ -38822,6 +43389,8 @@ </description> </method> <method name="set_linear_damp"> + <return type="void"> + </return> <argument index="0" name="linear_damp" type="float"> </argument> <description> @@ -38829,6 +43398,8 @@ </description> </method> <method name="set_linear_velocity"> + <return type="void"> + </return> <argument index="0" name="linear_velocity" type="Vector3"> </argument> <description> @@ -38836,6 +43407,8 @@ </description> </method> <method name="set_mass"> + <return type="void"> + </return> <argument index="0" name="mass" type="float"> </argument> <description> @@ -38843,6 +43416,8 @@ </description> </method> <method name="set_max_contacts_reported"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> @@ -38850,13 +43425,17 @@ </description> </method> <method name="set_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="RigidBody.Mode"> </argument> <description> Set the body mode, from the MODE_* enum. This allows to change to a static body or a character body. </description> </method> <method name="set_sleeping"> + <return type="void"> + </return> <argument index="0" name="sleeping" type="bool"> </argument> <description> @@ -38864,6 +43443,8 @@ </description> </method> <method name="set_use_continuous_collision_detection"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -38872,6 +43453,8 @@ </description> </method> <method name="set_use_custom_integrator"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -38879,6 +43462,8 @@ </description> </method> <method name="set_weight"> + <return type="void"> + </return> <argument index="0" name="weight" type="float"> </argument> <description> @@ -38888,38 +43473,55 @@ </methods> <members> <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief=""> + Dampens rotational forces of the Rigid body by the 'angular_damp' rate. </member> <member name="angular_velocity" type="Vector3" setter="set_angular_velocity" getter="get_angular_velocity" brief=""> + The current rotational velocity of the Rigid body </member> - <member name="axis_lock" type="int" setter="set_axis_lock" getter="get_axis_lock" brief=""> + <member name="axis_lock" type="int" setter="set_axis_lock" getter="get_axis_lock" brief="" enum="RigidBody.AxisLock"> + Locks the rotational forces to a particular axis, preventing rotations on other axes. </member> <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" brief=""> + Bounciness of the Rigid body. </member> <member name="can_sleep" type="bool" setter="set_can_sleep" getter="is_able_to_sleep" brief=""> + If true, the Rigid body will no longer calculate forces when there is no movement and will act as a static body. It will wake up when other forces are applied through other collisions or when the 'apply_impulse' method is used. </member> <member name="contact_monitor" type="bool" setter="set_contact_monitor" getter="is_contact_monitor_enabled" brief=""> + If true, the Rigid body will emit signals when it collides with another Rigid body. </member> <member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" brief=""> + The maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0. </member> <member name="continuous_cd" type="bool" setter="set_use_continuous_collision_detection" getter="is_using_continuous_collision_detection" brief=""> + Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. The first is more precise, and misses less impacts by small, fast-moving objects. The second is faster to compute, but can miss small, fast-moving objects. </member> <member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" brief=""> + If true, internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] function, if defined. </member> <member name="friction" type="float" setter="set_friction" getter="get_friction" brief=""> + The body friction, from 0 (frictionless) to 1 (max friction). </member> <member name="gravity_scale" type="float" setter="set_gravity_scale" getter="get_gravity_scale" brief=""> + The 'gravity_scale' for this Rigid body will be multiplied by the global 3d gravity setting found in "Project > Project Settings > Physics > 3d". A value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. </member> <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" brief=""> + The linear damp for this body. Default of -1, cannot be less than -1. If this value is different from -1, any linear damp derived from the world or areas will be overridden. </member> <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" brief=""> + The body linear velocity. Can be used sporadically, but [b]DON'T SET THIS IN EVERY FRAME[/b], because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. </member> <member name="mass" type="float" setter="set_mass" getter="get_mass" brief=""> + The body mass. </member> - <member name="mode" type="int" setter="set_mode" getter="get_mode" brief=""> + <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="" enum="RigidBody.Mode"> + The body mode from the MODE_* enum. Modes include: MODE_STATIC, MODE_KINEMATIC, MODE_RIGID, and MODE_CHARACTER. </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" brief=""> + The current 'sleeping' state of the Rigid body. </member> <member name="weight" type="float" setter="set_weight" getter="get_weight" brief=""> + The body weight given standard earth-weight (gravity 9.8). </member> </members> <signals> @@ -38997,6 +43599,8 @@ </description> <methods> <method name="_integrate_forces" qualifiers="virtual"> + <return type="void"> + </return> <argument index="0" name="state" type="Physics2DDirectBodyState"> </argument> <description> @@ -39004,6 +43608,8 @@ </description> </method> <method name="add_force"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <argument index="1" name="force" type="Vector2"> @@ -39013,6 +43619,8 @@ </description> </method> <method name="apply_impulse"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <argument index="1" name="impulse" type="Vector2"> @@ -39064,7 +43672,7 @@ </description> </method> <method name="get_continuous_collision_detection_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="RigidBody2D.CCDMode"> </return> <description> Return whether this body is using continuous collision detection. @@ -39120,7 +43728,7 @@ </description> </method> <method name="get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="RigidBody2D.Mode"> </return> <description> Return the current body mode, see [method set_mode]. @@ -39162,6 +43770,8 @@ </description> </method> <method name="set_angular_damp"> + <return type="void"> + </return> <argument index="0" name="angular_damp" type="float"> </argument> <description> @@ -39169,6 +43779,8 @@ </description> </method> <method name="set_angular_velocity"> + <return type="void"> + </return> <argument index="0" name="angular_velocity" type="float"> </argument> <description> @@ -39176,6 +43788,8 @@ </description> </method> <method name="set_applied_force"> + <return type="void"> + </return> <argument index="0" name="force" type="Vector2"> </argument> <description> @@ -39183,6 +43797,8 @@ </description> </method> <method name="set_applied_torque"> + <return type="void"> + </return> <argument index="0" name="torque" type="float"> </argument> <description> @@ -39190,6 +43806,8 @@ </description> </method> <method name="set_axis_velocity"> + <return type="void"> + </return> <argument index="0" name="axis_velocity" type="Vector2"> </argument> <description> @@ -39197,6 +43815,8 @@ </description> </method> <method name="set_bounce"> + <return type="void"> + </return> <argument index="0" name="bounce" type="float"> </argument> <description> @@ -39204,6 +43824,8 @@ </description> </method> <method name="set_can_sleep"> + <return type="void"> + </return> <argument index="0" name="able_to_sleep" type="bool"> </argument> <description> @@ -39212,6 +43834,8 @@ </description> </method> <method name="set_contact_monitor"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -39219,7 +43843,9 @@ </description> </method> <method name="set_continuous_collision_detection_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="RigidBody2D.CCDMode"> </argument> <description> Set the continuous collision detection mode from the enum CCD_MODE_*. @@ -39227,6 +43853,8 @@ </description> </method> <method name="set_friction"> + <return type="void"> + </return> <argument index="0" name="friction" type="float"> </argument> <description> @@ -39234,6 +43862,8 @@ </description> </method> <method name="set_gravity_scale"> + <return type="void"> + </return> <argument index="0" name="gravity_scale" type="float"> </argument> <description> @@ -39241,6 +43871,8 @@ </description> </method> <method name="set_inertia"> + <return type="void"> + </return> <argument index="0" name="inertia" type="float"> </argument> <description> @@ -39248,6 +43880,8 @@ </description> </method> <method name="set_linear_damp"> + <return type="void"> + </return> <argument index="0" name="linear_damp" type="float"> </argument> <description> @@ -39255,6 +43889,8 @@ </description> </method> <method name="set_linear_velocity"> + <return type="void"> + </return> <argument index="0" name="linear_velocity" type="Vector2"> </argument> <description> @@ -39262,6 +43898,8 @@ </description> </method> <method name="set_mass"> + <return type="void"> + </return> <argument index="0" name="mass" type="float"> </argument> <description> @@ -39269,6 +43907,8 @@ </description> </method> <method name="set_max_contacts_reported"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> @@ -39276,13 +43916,17 @@ </description> </method> <method name="set_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="RigidBody2D.Mode"> </argument> <description> Set the body mode, from the MODE_* enum. This allows to change to a static body or a character body. </description> </method> <method name="set_sleeping"> + <return type="void"> + </return> <argument index="0" name="sleeping" type="bool"> </argument> <description> @@ -39290,6 +43934,8 @@ </description> </method> <method name="set_use_custom_integrator"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -39297,6 +43943,8 @@ </description> </method> <method name="set_weight"> + <return type="void"> + </return> <argument index="0" name="weight" type="float"> </argument> <description> @@ -39310,7 +43958,7 @@ </argument> <argument index="1" name="margin" type="float" default="0.08"> </argument> - <argument index="2" name="result" type="Physics2DTestMotionResult" default="NULL"> + <argument index="2" name="result" type="Physics2DTestMotionResult" default="null"> </argument> <description> Return whether the body would collide, if it tried to move in the given vector. This method allows two extra parameters: A margin, which increases slightly the size of the shapes involved in the collision detection, and an object of type [Physics2DTestMotionResult], which will store additional information about the collision (should there be one). @@ -39330,7 +43978,7 @@ </member> <member name="contacts_reported" type="int" setter="set_max_contacts_reported" getter="get_max_contacts_reported" brief=""> </member> - <member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" brief=""> + <member name="continuous_cd" type="int" setter="set_continuous_collision_detection_mode" getter="get_continuous_collision_detection_mode" brief="" enum="RigidBody2D.CCDMode"> </member> <member name="custom_integrator" type="bool" setter="set_use_custom_integrator" getter="is_using_custom_integrator" brief=""> </member> @@ -39344,7 +43992,7 @@ </member> <member name="mass" type="float" setter="set_mass" getter="get_mass" brief=""> </member> - <member name="mode" type="int" setter="set_mode" getter="get_mode" brief=""> + <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="" enum="RigidBody2D.Mode"> </member> <member name="sleeping" type="bool" setter="set_sleeping" getter="is_sleeping" brief=""> </member> @@ -39424,60 +44072,6 @@ </constant> </constants> </class> -<class name="Room" inherits="VisualInstance" category="Core"> - <brief_description> - Room data resource. - </brief_description> - <description> - Room contains the data to define the bounds of a scene (using a BSP Tree). It is instanced by a [VisualInstance] node to create rooms. See that class documentation for more information about rooms. - </description> - <methods> - <method name="get_room" qualifiers="const"> - <return type="Room"> - </return> - <description> - </description> - </method> - <method name="set_room"> - <argument index="0" name="room" type="Room"> - </argument> - <description> - </description> - </method> - </methods> - <members> - <member name="room/room" type="Area" setter="set_room" getter="get_room" brief=""> - </member> - </members> - <constants> - </constants> -</class> -<class name="RoomBounds" inherits="Resource" category="Core"> - <brief_description> - </brief_description> - <description> - </description> - <methods> - <method name="get_geometry_hint" qualifiers="const"> - <return type="PoolVector3Array"> - </return> - <description> - </description> - </method> - <method name="set_geometry_hint"> - <argument index="0" name="triangles" type="PoolVector3Array"> - </argument> - <description> - </description> - </method> - </methods> - <members> - <member name="geometry_hint" type="PoolVector3Array" setter="set_geometry_hint" getter="get_geometry_hint" brief=""> - </member> - </members> - <constants> - </constants> -</class> <class name="SceneState" inherits="Reference" category="Core"> <brief_description> </brief_description> @@ -39655,6 +44249,8 @@ </description> <methods> <method name="call_group" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="group" type="String"> </argument> <argument index="1" name="method" type="String"> @@ -39663,6 +44259,8 @@ </description> </method> <method name="call_group_flags" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="flags" type="int"> </argument> <argument index="1" name="group" type="String"> @@ -39673,7 +44271,7 @@ </description> </method> <method name="change_scene"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -39681,7 +44279,7 @@ </description> </method> <method name="change_scene_to"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="packed_scene" type="PackedScene"> </argument> @@ -39705,7 +44303,7 @@ </description> </method> <method name="get_edited_scene_root" qualifiers="const"> - <return type="Object"> + <return type="Node"> </return> <description> </description> @@ -39748,6 +44346,12 @@ <description> </description> </method> + <method name="get_rpc_sender_id" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="has_group" qualifiers="const"> <return type="bool"> </return> @@ -39775,12 +44379,6 @@ <description> </description> </method> - <method name="is_editor_hint" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> <method name="is_input_handled"> <return type="bool"> </return> @@ -39807,14 +44405,18 @@ </description> </method> <method name="notify_group"> - <argument index="0" name="call_flags" type="String"> + <return type="void"> + </return> + <argument index="0" name="group" type="String"> </argument> - <argument index="1" name="group" type="int"> + <argument index="1" name="notification" type="int"> </argument> <description> </description> </method> <method name="notify_group_flags"> + <return type="void"> + </return> <argument index="0" name="call_flags" type="int"> </argument> <argument index="1" name="group" type="String"> @@ -39825,68 +44427,80 @@ </description> </method> <method name="queue_delete"> + <return type="void"> + </return> <argument index="0" name="obj" type="Object"> </argument> <description> </description> </method> <method name="quit"> + <return type="void"> + </return> <description> </description> </method> <method name="reload_current_scene"> - <return type="int"> + <return type="int" enum="Error"> </return> <description> </description> </method> <method name="set_auto_accept_quit"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_current_scene"> + <return type="void"> + </return> <argument index="0" name="child_node" type="Node"> </argument> <description> </description> </method> <method name="set_debug_collisions_hint"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_debug_navigation_hint"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_edited_scene_root"> - <argument index="0" name="scene" type="Object"> - </argument> - <description> - </description> - </method> - <method name="set_editor_hint"> - <argument index="0" name="enable" type="bool"> + <return type="void"> + </return> + <argument index="0" name="scene" type="Node"> </argument> <description> </description> </method> <method name="set_group"> - <argument index="0" name="call_flags" type="String"> + <return type="void"> + </return> + <argument index="0" name="group" type="String"> </argument> - <argument index="1" name="group" type="String"> + <argument index="1" name="property" type="String"> </argument> - <argument index="2" name="property" type="Variant"> + <argument index="2" name="value" type="Variant"> </argument> <description> </description> </method> <method name="set_group_flags"> + <return type="void"> + </return> <argument index="0" name="call_flags" type="int"> </argument> <argument index="1" name="group" type="String"> @@ -39899,10 +44513,14 @@ </description> </method> <method name="set_input_as_handled"> + <return type="void"> + </return> <description> </description> </method> <method name="set_network_peer"> + <return type="void"> + </return> <argument index="0" name="peer" type="NetworkedMultiplayerPeer"> </argument> <description> @@ -39910,24 +44528,32 @@ </description> </method> <method name="set_pause"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_refuse_new_network_connections"> + <return type="void"> + </return> <argument index="0" name="refuse" type="bool"> </argument> <description> </description> </method> <method name="set_screen_stretch"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="SceneTree.StretchMode"> </argument> - <argument index="1" name="aspect" type="int"> + <argument index="1" name="aspect" type="int" enum="SceneTree.StretchAspect"> </argument> <argument index="2" name="minsize" type="Vector2"> </argument> + <argument index="3" name="shrink" type="int" default="1"> + </argument> <description> </description> </method> @@ -40032,6 +44658,8 @@ </description> </method> <method name="set_time_left"> + <return type="void"> + </return> <argument index="0" name="time" type="float"> </argument> <description> @@ -40049,31 +44677,47 @@ </class> <class name="Script" inherits="Resource" category="Core"> <brief_description> - Base class for scripts. + A class stored as a resource. </brief_description> <description> - Base class for scripts. Any script that is loaded becomes one of these resources, which can then create instances. + A class stored as a resource. The script exends the functionality of all objects that instance it. + The 'new' method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> <methods> <method name="can_instance" qualifiers="const"> <return type="bool"> </return> <description> - Return true if this script can be instance (ie not a library). + Returns true if the script can be instanced. + </description> + </method> + <method name="get_node_type" qualifiers="const"> + <return type="String"> + </return> + <description> </description> </method> <method name="get_source_code" qualifiers="const"> <return type="String"> </return> <description> - Return the script source code (if available). + Returns the script source code, or an empty string if source code is not available. + </description> + </method> + <method name="has_script_signal" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="signal_name" type="String"> + </argument> + <description> + Returns true if the script, or a base class, defines a signal with the given name. </description> </method> <method name="has_source_code" qualifiers="const"> <return type="bool"> </return> <description> - Return true if the script contains source code. + Returns true if the script contains non-empty source code. </description> </method> <method name="instance_has" qualifiers="const"> @@ -40082,25 +44726,76 @@ <argument index="0" name="base_object" type="Object"> </argument> <description> - Return true if a given object uses an instance of this script. + Returns true if 'base_object' is an instance of this script. + </description> + </method> + <method name="is_tool" qualifiers="const"> + <return type="bool"> + </return> + <description> + Returns true if the script is a tool script. A tool script can run in the editor. </description> </method> <method name="reload"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="keep_state" type="bool" default="false"> + If true, preserve existing script instances and subclasses. </argument> <description> + Reloads the script's class implementation. Returns an error code. </description> </method> <method name="set_source_code"> + <return type="void"> + </return> <argument index="0" name="source" type="String"> </argument> <description> - Set the script source code. + Sets the script source code. Does not reload the class implementation. + </description> + </method> + </methods> + <constants> + </constants> +</class> +<class name="ScriptEditor" inherits="PanelContainer" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_current_script"> + <return type="Script"> + </return> + <description> + Returns a [Script] that is currently active in editor. + </description> + </method> + <method name="get_open_scripts" qualifiers="const"> + <return type="Array"> + </return> + <description> + Returns an array with all [Script] objects which are currently open in editor. </description> </method> </methods> + <signals> + <signal name="editor_script_changed"> + <argument index="0" name="script" type="Object"> + </argument> + <description> + Emitted when user changed active script. Argument is a freshly activated [Script]. + </description> + </signal> + <signal name="script_close"> + <argument index="0" name="script" type="Object"> + </argument> + <description> + Emitted when editor is about to close the active script. Argument is a [Script] that is going to be closed. + </description> + </signal> + </signals> <constants> </constants> </class> @@ -40119,6 +44814,8 @@ </description> </method> <method name="set_custom_step"> + <return type="void"> + </return> <argument index="0" name="step" type="float"> </argument> <description> @@ -40129,6 +44826,12 @@ <member name="custom_step" type="float" setter="set_custom_step" getter="get_custom_step" brief=""> </member> </members> + <signals> + <signal name="scrolling"> + <description> + </description> + </signal> + </signals> <constants> </constants> </class> @@ -40169,6 +44872,8 @@ </description> </method> <method name="set_enable_h_scroll"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -40176,6 +44881,8 @@ </description> </method> <method name="set_enable_v_scroll"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -40183,6 +44890,8 @@ </description> </method> <method name="set_h_scroll"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -40190,6 +44899,8 @@ </description> </method> <method name="set_v_scroll"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -40206,44 +44917,6 @@ <constants> </constants> </class> -<class name="ScriptEditor" inherits="PanelContainer" category="Core"> - <brief_description> - </brief_description> - <description> - </description> - <methods> - <method name="get_current_script"> - <return type="Script"> - </return> - <description> - Returns a [Script] that is currently active in editor. - </description> - </method> - <method name="get_open_scripts"> - <return type="Array"> - </return> - <description> - Returns an array with all [Script] objects which are currently open in editor. - </description> - </method> - </methods> - <signals> - <signal name="editor_script_changed"> - <argument index="0" name="script" type="Script"> - </argument> - <description> - Emitted when user changed active script. Argument is a freshly activated [Script]. - </description> - </signal> - <signal name="script_close"> - <argument index="0" name="script" type="Script"> - </argument> - <description> - Emitted when editor is about to close the active script. Argument is a [Script] that is going to be closed. - </description> - </signal> - </signals> -</class> <class name="SegmentShape2D" inherits="Shape2D" category="Core"> <brief_description> Segment Shape for 2D Collision Detection. @@ -40267,6 +44940,8 @@ </description> </method> <method name="set_a"> + <return type="void"> + </return> <argument index="0" name="a" type="Vector2"> </argument> <description> @@ -40274,6 +44949,8 @@ </description> </method> <method name="set_b"> + <return type="void"> + </return> <argument index="0" name="b" type="Vector2"> </argument> <description> @@ -40299,14 +44976,14 @@ </description> <methods> <method name="post"> - <return type="Error"> + <return type="int" enum="Error"> </return> <description> Lowers the [Semaphore], allowing one more thread in. </description> </method> <method name="wait"> - <return type="Error"> + <return type="int" enum="Error"> </return> <description> Tries to wait for the [Semaphore], if its value is zero, blocks until non-zero. @@ -40351,7 +45028,7 @@ </description> </method> <method name="get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Shader.Mode"> </return> <description> </description> @@ -40365,12 +45042,16 @@ </description> </method> <method name="set_code"> + <return type="void"> + </return> <argument index="0" name="code" type="String"> </argument> <description> </description> </method> <method name="set_default_texture_param"> + <return type="void"> + </return> <argument index="0" name="param" type="String"> </argument> <argument index="1" name="texture" type="Texture"> @@ -40413,12 +45094,16 @@ </description> </method> <method name="set_shader"> + <return type="void"> + </return> <argument index="0" name="shader" type="Shader"> </argument> <description> </description> </method> <method name="set_shader_param"> + <return type="void"> + </return> <argument index="0" name="param" type="String"> </argument> <argument index="1" name="value" type="Variant"> @@ -40520,6 +45205,8 @@ </description> </method> <method name="set_custom_solver_bias"> + <return type="void"> + </return> <argument index="0" name="bias" type="float"> </argument> <description> @@ -40568,6 +45255,8 @@ </description> </method> <method name="set_shortcut"> + <return type="void"> + </return> <argument index="0" name="event" type="InputEvent"> </argument> <description> @@ -40590,6 +45279,8 @@ </description> <methods> <method name="add_bone"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -40597,6 +45288,8 @@ </description> </method> <method name="bind_child_node_to_bone"> + <return type="void"> + </return> <argument index="0" name="bone_idx" type="int"> </argument> <argument index="1" name="node" type="Node"> @@ -40606,6 +45299,8 @@ </description> </method> <method name="clear_bones"> + <return type="void"> + </return> <description> Clear all the bones in this skeleton. </description> @@ -40704,6 +45399,8 @@ </description> </method> <method name="set_bone_custom_pose"> + <return type="void"> + </return> <argument index="0" name="bone_idx" type="int"> </argument> <argument index="1" name="custom_pose" type="Transform"> @@ -40712,6 +45409,8 @@ </description> </method> <method name="set_bone_disable_rest"> + <return type="void"> + </return> <argument index="0" name="bone_idx" type="int"> </argument> <argument index="1" name="disable" type="bool"> @@ -40720,6 +45419,8 @@ </description> </method> <method name="set_bone_global_pose"> + <return type="void"> + </return> <argument index="0" name="bone_idx" type="int"> </argument> <argument index="1" name="pose" type="Transform"> @@ -40728,6 +45429,8 @@ </description> </method> <method name="set_bone_parent"> + <return type="void"> + </return> <argument index="0" name="bone_idx" type="int"> </argument> <argument index="1" name="parent_idx" type="int"> @@ -40737,6 +45440,8 @@ </description> </method> <method name="set_bone_pose"> + <return type="void"> + </return> <argument index="0" name="bone_idx" type="int"> </argument> <argument index="1" name="pose" type="Transform"> @@ -40746,6 +45451,8 @@ </description> </method> <method name="set_bone_rest"> + <return type="void"> + </return> <argument index="0" name="bone_idx" type="int"> </argument> <argument index="1" name="rest" type="Transform"> @@ -40755,6 +45462,8 @@ </description> </method> <method name="unbind_child_node_from_bone"> + <return type="void"> + </return> <argument index="0" name="bone_idx" type="int"> </argument> <argument index="1" name="node" type="Node"> @@ -40764,6 +45473,8 @@ </description> </method> <method name="unparent_bone_and_rest"> + <return type="void"> + </return> <argument index="0" name="bone_idx" type="int"> </argument> <description> @@ -40771,7 +45482,7 @@ </method> </methods> <constants> - <constant name="NOTIFICATION_UPDATE_SKELETON" value="50"> + <constant name="NOTIFICATION_UPDATE_SKELETON" value="50" enum=""> </constant> </constants> </class> @@ -40782,32 +45493,40 @@ </description> <methods> <method name="get_radiance_size" qualifiers="const"> - <return type="int"> + <return type="int" enum="Sky.RadianceSize"> </return> <description> </description> </method> <method name="set_radiance_size"> - <argument index="0" name="size" type="int"> + <return type="void"> + </return> + <argument index="0" name="size" type="int" enum="Sky.RadianceSize"> </argument> <description> </description> </method> </methods> <members> - <member name="radiance_size" type="int" setter="set_radiance_size" getter="get_radiance_size" brief=""> + <member name="radiance_size" type="int" setter="set_radiance_size" getter="get_radiance_size" brief="" enum="Sky.RadianceSize"> </member> </members> <constants> - <constant name="RADIANCE_SIZE_256" value="0"> + <constant name="RADIANCE_SIZE_32" value="0"> + </constant> + <constant name="RADIANCE_SIZE_64" value="1"> + </constant> + <constant name="RADIANCE_SIZE_128" value="2"> </constant> - <constant name="RADIANCE_SIZE_512" value="1"> + <constant name="RADIANCE_SIZE_256" value="3"> </constant> - <constant name="RADIANCE_SIZE_1024" value="2"> + <constant name="RADIANCE_SIZE_512" value="4"> </constant> - <constant name="RADIANCE_SIZE_2048" value="3"> + <constant name="RADIANCE_SIZE_1024" value="5"> </constant> - <constant name="RADIANCE_SIZE_MAX" value="4"> + <constant name="RADIANCE_SIZE_2048" value="6"> + </constant> + <constant name="RADIANCE_SIZE_MAX" value="7"> </constant> </constants> </class> @@ -40840,12 +45559,16 @@ </description> </method> <method name="set_editable"> + <return type="void"> + </return> <argument index="0" name="editable" type="bool"> </argument> <description> </description> </method> <method name="set_ticks"> + <return type="void"> + </return> <argument index="0" name="count" type="int"> </argument> <description> @@ -40853,6 +45576,8 @@ </description> </method> <method name="set_ticks_on_borders"> + <return type="void"> + </return> <argument index="0" name="ticks_on_border" type="bool"> </argument> <description> @@ -40863,7 +45588,7 @@ <members> <member name="editable" type="bool" setter="set_editable" getter="is_editable" brief=""> </member> - <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" brief=""> + <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" brief="" enum="Control.FocusMode"> </member> <member name="tick_count" type="int" setter="set_ticks" getter="get_ticks" brief=""> </member> @@ -40882,13 +45607,15 @@ <method name="get_param" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> + <argument index="0" name="param" type="int" enum="SliderJoint.Param"> </argument> <description> </description> </method> <method name="set_param"> - <argument index="0" name="param" type="int"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="SliderJoint.Param"> </argument> <argument index="1" name="value" type="float"> </argument> @@ -40993,16 +45720,17 @@ </class> <class name="Spatial" inherits="Node" category="Core"> <brief_description> - Base class for all 3D nodes. + Most basic 3D game object, parent of all 3D related nodes. </brief_description> <description> - Spatial is the base for every type of 3D [Node]. It contains a 3D [Transform] which can be set or get as local or global. If a Spatial [Node] has Spatial children, their transforms will be relative to the parent. + Most basic 3D game object, with a 3D [Transform] and visibility settings. All 3D physics nodes and sprites inherit from Spatial. Use Spatial as a parent node to move, scale, rotate and show/hide children in a 3D project. </description> <methods> <method name="get_gizmo" qualifiers="const"> <return type="SpatialGizmo"> </return> <description> + Return the SpatialGizmo for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor. </description> </method> <method name="get_global_transform" qualifiers="const"> @@ -41013,7 +45741,7 @@ </description> </method> <method name="get_parent_spatial" qualifiers="const"> - <return type="Object"> + <return type="Spatial"> </return> <description> Return the parent [Spatial], or an empty [Object] if no parent exists or parent is not of type [Spatial]. @@ -41056,65 +45784,85 @@ <return type="World"> </return> <description> + Return current [World] resource this Spatial node is registered to. </description> </method> <method name="global_rotate"> + <return type="void"> + </return> <argument index="0" name="normal" type="Vector3"> </argument> <argument index="1" name="radians" type="float"> </argument> <description> + Rotate current node along normal [Vector3] by angle in radians in Global space. </description> </method> <method name="global_translate"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector3"> </argument> <description> + Move current node by [Vector3] offset in Global space. </description> </method> <method name="hide"> + <return type="void"> + </return> <description> + Disable rendering of this node. Change Spatial Visible property to false. </description> </method> <method name="is_local_transform_notification_enabled" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether node sends notification that its local transformation changed. Spatial will not propagate this by default. </description> </method> <method name="is_set_as_toplevel" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether this node is set as Toplevel, ignoring its parent node transformations. </description> </method> <method name="is_transform_notification_enabled" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether node sends notification that its transformation changed. Spatial will not propagate this by default. </description> </method> <method name="is_visible" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether this node is set to be visible. </description> </method> <method name="is_visible_in_tree" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether this node is visible, taking into consideration that its parents visibility. </description> </method> <method name="look_at"> + <return type="void"> + </return> <argument index="0" name="target" type="Vector3"> </argument> <argument index="1" name="up" type="Vector3"> </argument> <description> + Rotates itself to point into direction of target position. Operations take place in global space. </description> </method> <method name="look_at_from_pos"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector3"> </argument> <argument index="1" name="target" type="Vector3"> @@ -41122,80 +45870,118 @@ <argument index="2" name="up" type="Vector3"> </argument> <description> + Moves itself to specified position and then rotates itself to point into direction of target position. Operations take place in global space. </description> </method> <method name="orthonormalize"> + <return type="void"> + </return> <description> + Reset this node transformations (like scale, skew and taper) preserving its rotation and translation. Performs orthonormalization on this node [Transform3D]. </description> </method> <method name="rotate"> + <return type="void"> + </return> <argument index="0" name="normal" type="Vector3"> </argument> <argument index="1" name="radians" type="float"> </argument> <description> + Rotates node in local space on given normal [Vector3] by angle in radians. </description> </method> <method name="rotate_x"> + <return type="void"> + </return> <argument index="0" name="radians" type="float"> </argument> <description> + Rotates node in local space on X axis by angle in radians. </description> </method> <method name="rotate_y"> + <return type="void"> + </return> <argument index="0" name="radians" type="float"> </argument> <description> + Rotates node in local space on Y axis by angle in radians. </description> </method> <method name="rotate_z"> + <return type="void"> + </return> <argument index="0" name="radians" type="float"> </argument> <description> + Rotates node in local space on Z axis by angle in radians. </description> </method> <method name="set_as_toplevel"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> + Makes this node ignore its parents tranformations. Node tranformations are only in global space. </description> </method> <method name="set_gizmo"> + <return type="void"> + </return> <argument index="0" name="gizmo" type="SpatialGizmo"> </argument> <description> + Set [SpatialGizmo] for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor. </description> </method> <method name="set_global_transform"> + <return type="void"> + </return> <argument index="0" name="global" type="Transform"> </argument> <description> - Set the transform globally, relative to worldspace. + Set the transform globally, relative to world space. </description> </method> <method name="set_identity"> + <return type="void"> + </return> <description> + Reset all tranformations for this node. Set its [Transform3D] to identity matrix. </description> </method> <method name="set_ignore_transform_notification"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> + Set whether this node ignores notification that its transformation changed. </description> </method> <method name="set_notify_local_transform"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> + Set whether this node sends notification that its local transformation changed. Spatial will not propagate this by default. </description> </method> <method name="set_notify_transform"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> + Set whether this node sends notification that its transformation changed. Spatial will not propagate this by default. </description> </method> <method name="set_rotation"> + <return type="void"> + </return> <argument index="0" name="rotation_rad" type="Vector3"> </argument> <description> @@ -41203,6 +45989,8 @@ </description> </method> <method name="set_rotation_deg"> + <return type="void"> + </return> <argument index="0" name="rotation_deg" type="Vector3"> </argument> <description> @@ -41210,12 +45998,17 @@ </description> </method> <method name="set_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="Vector3"> </argument> <description> + Set the scale. </description> </method> <method name="set_transform"> + <return type="void"> + </return> <argument index="0" name="local" type="Transform"> </argument> <description> @@ -41223,63 +46016,106 @@ </description> </method> <method name="set_translation"> + <return type="void"> + </return> <argument index="0" name="translation" type="Vector3"> </argument> <description> </description> </method> <method name="set_visible"> - <argument index="0" name="arg0" type="bool"> + <return type="void"> + </return> + <argument index="0" name="visible" type="bool"> </argument> <description> </description> </method> <method name="show"> + <return type="void"> + </return> <description> + Enable rendering of this node. Change Spatial Visible property to false. + </description> + </method> + <method name="to_global" qualifiers="const"> + <return type="Vector3"> + </return> + <argument index="0" name="local_point" type="Vector3"> + </argument> + <description> + Tranform [Vector3] from this node local space to world space. + </description> + </method> + <method name="to_local" qualifiers="const"> + <return type="Vector3"> + </return> + <argument index="0" name="global_point" type="Vector3"> + </argument> + <description> + Tranform [Vector3] from world space to this node local space. </description> </method> <method name="translate"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector3"> </argument> <description> + Change node position by given offset [Vector3]. </description> </method> <method name="update_gizmo"> + <return type="void"> + </return> <description> + Update [SpatialGizmo] of this node. </description> </method> </methods> <members> <member name="global_transform" type="Transform" setter="set_global_transform" getter="get_global_transform" brief=""> + World space (global) [Transform] of this node. </member> <member name="rotation" type="Vector3" setter="set_rotation" getter="get_rotation" brief=""> + Local euler rotation in radians of this node. </member> <member name="rotation_deg" type="Vector3" setter="set_rotation_deg" getter="get_rotation_deg" brief=""> + Local euler rotation in degrees of this node. </member> <member name="scale" type="Vector3" setter="set_scale" getter="get_scale" brief=""> + Local scale of this node. </member> <member name="transform" type="Transform" setter="set_transform" getter="get_transform" brief=""> + Local space [Transform] of this node. </member> <member name="translation" type="Vector3" setter="set_translation" getter="get_translation" brief=""> + Local translation of this node. </member> <member name="visible" type="bool" setter="set_visible" getter="is_visible" brief=""> + Visibility of this node. Toggles if this node is rendered. </member> </members> <signals> <signal name="visibility_changed"> <description> + Emitted when node visibility changed. </description> </signal> </signals> <constants> - <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="29"> - Spatial nodes receive this notification with their global transform changes. This means that either the current or a parent node changed its transform. + <constant name="NOTIFICATION_TRANSFORM_CHANGED" value="29" enum=""> + Spatial nodes receive this notification when their global transform changes. This means that either the current or a parent node changed its transform. + In order for NOTIFICATION_TRANSFORM_CHANGED to work user first needs to ask for it, with set_notify_transform(true). </constant> - <constant name="NOTIFICATION_ENTER_WORLD" value="41"> + <constant name="NOTIFICATION_ENTER_WORLD" value="41" enum=""> + Spatial nodes receive this notification when they are registered to new [World] resource. </constant> - <constant name="NOTIFICATION_EXIT_WORLD" value="42"> + <constant name="NOTIFICATION_EXIT_WORLD" value="42" enum=""> + Spatial nodes receive this notification when they are unregistered from current [World] resource. </constant> - <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="43"> + <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="43" enum=""> + Spatial nodes receive this notification when their visibility changes. </constant> </constants> </class> @@ -41305,20 +46141,32 @@ <description> </description> </method> + <method name="get_alpha_scissor_threshold" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="get_anisotropy" qualifiers="const"> <return type="float"> </return> <description> </description> </method> + <method name="get_ao_texture_channel" qualifiers="const"> + <return type="int" enum="SpatialMaterial.TextureChannel"> + </return> + <description> + </description> + </method> <method name="get_billboard_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="SpatialMaterial.BillboardMode"> </return> <description> </description> </method> <method name="get_blend_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="SpatialMaterial.BlendMode"> </return> <description> </description> @@ -41336,7 +46184,7 @@ </description> </method> <method name="get_cull_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="SpatialMaterial.CullMode"> </return> <description> </description> @@ -41354,7 +46202,7 @@ </description> </method> <method name="get_depth_draw_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="SpatialMaterial.DepthDrawMode"> </return> <description> </description> @@ -41366,19 +46214,19 @@ </description> </method> <method name="get_detail_blend_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="SpatialMaterial.BlendMode"> </return> <description> </description> </method> <method name="get_detail_uv" qualifiers="const"> - <return type="int"> + <return type="int" enum="SpatialMaterial.DetailUV"> </return> <description> </description> </method> <method name="get_diffuse_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="SpatialMaterial.DiffuseMode"> </return> <description> </description> @@ -41398,7 +46246,7 @@ <method name="get_feature" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="feature" type="int"> + <argument index="0" name="feature" type="int" enum="SpatialMaterial.Feature"> </argument> <description> </description> @@ -41406,7 +46254,7 @@ <method name="get_flag" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="arg0" type="int"> + <argument index="0" name="flag" type="int" enum="SpatialMaterial.Flags"> </argument> <description> </description> @@ -41429,6 +46277,12 @@ <description> </description> </method> + <method name="get_metallic_texture_channel" qualifiers="const"> + <return type="int" enum="SpatialMaterial.TextureChannel"> + </return> + <description> + </description> + </method> <method name="get_normal_scale" qualifiers="const"> <return type="float"> </return> @@ -41465,6 +46319,12 @@ <description> </description> </method> + <method name="get_refraction_texture_channel" qualifiers="const"> + <return type="int" enum="SpatialMaterial.TextureChannel"> + </return> + <description> + </description> + </method> <method name="get_rim" qualifiers="const"> <return type="float"> </return> @@ -41483,6 +46343,12 @@ <description> </description> </method> + <method name="get_roughness_texture_channel" qualifiers="const"> + <return type="int" enum="SpatialMaterial.TextureChannel"> + </return> + <description> + </description> + </method> <method name="get_specular" qualifiers="const"> <return type="float"> </return> @@ -41490,7 +46356,7 @@ </description> </method> <method name="get_specular_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="SpatialMaterial.SpecularMode"> </return> <description> </description> @@ -41504,11 +46370,17 @@ <method name="get_texture" qualifiers="const"> <return type="Texture"> </return> - <argument index="0" name="param" type="Texture"> + <argument index="0" name="param" type="int" enum="SpatialMaterial.TextureParam"> </argument> <description> </description> </method> + <method name="get_transmission" qualifiers="const"> + <return type="Color"> + </return> + <description> + </description> + </method> <method name="get_uv1_offset" qualifiers="const"> <return type="Vector3"> </return> @@ -41558,109 +46430,161 @@ </description> </method> <method name="set_albedo"> + <return type="void"> + </return> <argument index="0" name="albedo" type="Color"> </argument> <description> </description> </method> + <method name="set_alpha_scissor_threshold"> + <return type="void"> + </return> + <argument index="0" name="threshold" type="float"> + </argument> + <description> + </description> + </method> <method name="set_anisotropy"> + <return type="void"> + </return> <argument index="0" name="anisotropy" type="float"> </argument> <description> </description> </method> + <method name="set_ao_texture_channel"> + <return type="void"> + </return> + <argument index="0" name="channel" type="int" enum="SpatialMaterial.TextureChannel"> + </argument> + <description> + </description> + </method> <method name="set_billboard_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="SpatialMaterial.BillboardMode"> </argument> <description> </description> </method> <method name="set_blend_mode"> - <argument index="0" name="blend_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="blend_mode" type="int" enum="SpatialMaterial.BlendMode"> </argument> <description> </description> </method> <method name="set_clearcoat"> + <return type="void"> + </return> <argument index="0" name="clearcoat" type="float"> </argument> <description> </description> </method> <method name="set_clearcoat_gloss"> + <return type="void"> + </return> <argument index="0" name="clearcoat_gloss" type="float"> </argument> <description> </description> </method> <method name="set_cull_mode"> - <argument index="0" name="cull_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="cull_mode" type="int" enum="SpatialMaterial.CullMode"> </argument> <description> </description> </method> <method name="set_depth_deep_parallax"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_depth_deep_parallax_max_layers"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> </description> </method> <method name="set_depth_deep_parallax_min_layers"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> </description> </method> <method name="set_depth_draw_mode"> - <argument index="0" name="depth_draw_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="depth_draw_mode" type="int" enum="SpatialMaterial.DepthDrawMode"> </argument> <description> </description> </method> <method name="set_depth_scale"> + <return type="void"> + </return> <argument index="0" name="depth_scale" type="float"> </argument> <description> </description> </method> <method name="set_detail_blend_mode"> - <argument index="0" name="detail_blend_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="detail_blend_mode" type="int" enum="SpatialMaterial.BlendMode"> </argument> <description> </description> </method> <method name="set_detail_uv"> - <argument index="0" name="detail_uv" type="int"> + <return type="void"> + </return> + <argument index="0" name="detail_uv" type="int" enum="SpatialMaterial.DetailUV"> </argument> <description> </description> </method> <method name="set_diffuse_mode"> - <argument index="0" name="diffuse_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="diffuse_mode" type="int" enum="SpatialMaterial.DiffuseMode"> </argument> <description> </description> </method> <method name="set_emission"> + <return type="void"> + </return> <argument index="0" name="emission" type="Color"> </argument> <description> </description> </method> <method name="set_emission_energy"> + <return type="void"> + </return> <argument index="0" name="emission_energy" type="float"> </argument> <description> </description> </method> <method name="set_feature"> - <argument index="0" name="feature" type="int"> + <return type="void"> + </return> + <argument index="0" name="feature" type="int" enum="SpatialMaterial.Feature"> </argument> <argument index="1" name="enable" type="bool"> </argument> @@ -41668,7 +46592,9 @@ </description> </method> <method name="set_flag"> - <argument index="0" name="flag" type="int"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="SpatialMaterial.Flags"> </argument> <argument index="1" name="enable" type="bool"> </argument> @@ -41676,140 +46602,218 @@ </description> </method> <method name="set_grow"> + <return type="void"> + </return> <argument index="0" name="amount" type="float"> </argument> <description> </description> </method> <method name="set_grow_enabled"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_line_width"> + <return type="void"> + </return> <argument index="0" name="line_width" type="float"> </argument> <description> </description> </method> <method name="set_metallic"> + <return type="void"> + </return> <argument index="0" name="metallic" type="float"> </argument> <description> </description> </method> + <method name="set_metallic_texture_channel"> + <return type="void"> + </return> + <argument index="0" name="channel" type="int" enum="SpatialMaterial.TextureChannel"> + </argument> + <description> + </description> + </method> <method name="set_normal_scale"> + <return type="void"> + </return> <argument index="0" name="normal_scale" type="float"> </argument> <description> </description> </method> <method name="set_particles_anim_h_frames"> + <return type="void"> + </return> <argument index="0" name="frames" type="int"> </argument> <description> </description> </method> <method name="set_particles_anim_loop"> + <return type="void"> + </return> <argument index="0" name="frames" type="int"> </argument> <description> </description> </method> <method name="set_particles_anim_v_frames"> + <return type="void"> + </return> <argument index="0" name="frames" type="int"> </argument> <description> </description> </method> <method name="set_point_size"> + <return type="void"> + </return> <argument index="0" name="point_size" type="float"> </argument> <description> </description> </method> <method name="set_refraction"> + <return type="void"> + </return> <argument index="0" name="refraction" type="float"> </argument> <description> </description> </method> + <method name="set_refraction_texture_channel"> + <return type="void"> + </return> + <argument index="0" name="channel" type="int" enum="SpatialMaterial.TextureChannel"> + </argument> + <description> + </description> + </method> <method name="set_rim"> + <return type="void"> + </return> <argument index="0" name="rim" type="float"> </argument> <description> </description> </method> <method name="set_rim_tint"> + <return type="void"> + </return> <argument index="0" name="rim_tint" type="float"> </argument> <description> </description> </method> <method name="set_roughness"> + <return type="void"> + </return> <argument index="0" name="roughness" type="float"> </argument> <description> </description> </method> + <method name="set_roughness_texture_channel"> + <return type="void"> + </return> + <argument index="0" name="channel" type="int" enum="SpatialMaterial.TextureChannel"> + </argument> + <description> + </description> + </method> <method name="set_specular"> + <return type="void"> + </return> <argument index="0" name="specular" type="float"> </argument> <description> </description> </method> <method name="set_specular_mode"> - <argument index="0" name="specular_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="specular_mode" type="int" enum="SpatialMaterial.SpecularMode"> </argument> <description> </description> </method> <method name="set_subsurface_scattering_strength"> + <return type="void"> + </return> <argument index="0" name="strength" type="float"> </argument> <description> </description> </method> <method name="set_texture"> - <argument index="0" name="param" type="Texture"> + <return type="void"> + </return> + <argument index="0" name="param" type="int" enum="SpatialMaterial.TextureParam"> </argument> - <argument index="1" name="texture" type="Object"> + <argument index="1" name="texture" type="Texture"> + </argument> + <description> + </description> + </method> + <method name="set_transmission"> + <return type="void"> + </return> + <argument index="0" name="transmission" type="Color"> </argument> <description> </description> </method> <method name="set_uv1_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector3"> </argument> <description> </description> </method> <method name="set_uv1_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="Vector3"> </argument> <description> </description> </method> <method name="set_uv1_triplanar_blend_sharpness"> + <return type="void"> + </return> <argument index="0" name="sharpness" type="float"> </argument> <description> </description> </method> <method name="set_uv2_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector3"> </argument> <description> </description> </method> <method name="set_uv2_scale"> + <return type="void"> + </return> <argument index="0" name="scale" type="Vector3"> </argument> <description> </description> </method> <method name="set_uv2_triplanar_blend_sharpness"> + <return type="void"> + </return> <argument index="0" name="sharpness" type="float"> </argument> <description> @@ -41833,6 +46837,8 @@ </member> <member name="ao_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> + <member name="ao_texture_channel" type="int" setter="set_ao_texture_channel" getter="get_ao_texture_channel" brief="" enum="SpatialMaterial.TextureChannel"> + </member> <member name="clearcoat" type="float" setter="set_clearcoat" getter="get_clearcoat" brief=""> </member> <member name="clearcoat_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> @@ -41855,7 +46861,7 @@ </member> <member name="detail_albedo" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> - <member name="detail_blend_mode" type="int" setter="set_detail_blend_mode" getter="get_detail_blend_mode" brief=""> + <member name="detail_blend_mode" type="int" setter="set_detail_blend_mode" getter="get_detail_blend_mode" brief="" enum="SpatialMaterial.BlendMode"> </member> <member name="detail_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> </member> @@ -41863,7 +46869,7 @@ </member> <member name="detail_normal" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> - <member name="detail_uv_layer" type="int" setter="set_detail_uv" getter="get_detail_uv" brief=""> + <member name="detail_uv_layer" type="int" setter="set_detail_uv" getter="get_detail_uv" brief="" enum="SpatialMaterial.DetailUV"> </member> <member name="emission" type="Color" setter="set_emission" getter="get_emission" brief=""> </member> @@ -41875,7 +46881,7 @@ </member> <member name="flags_fixed_size" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> - <member name="flags_on_top" type="bool" setter="set_flag" getter="get_flag" brief=""> + <member name="flags_no_depth_test" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> <member name="flags_transparent" type="bool" setter="set_feature" getter="get_feature" brief=""> </member> @@ -41883,27 +46889,35 @@ </member> <member name="flags_use_point_size" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> + <member name="flags_vertex_lighting" type="bool" setter="set_flag" getter="get_flag" brief=""> + </member> + <member name="flags_world_triplanar" type="bool" setter="set_flag" getter="get_flag" brief=""> + </member> <member name="metallic" type="float" setter="set_metallic" getter="get_metallic" brief=""> </member> <member name="metallic_specular" type="float" setter="set_specular" getter="get_specular" brief=""> </member> <member name="metallic_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> + <member name="metallic_texture_channel" type="int" setter="set_metallic_texture_channel" getter="get_metallic_texture_channel" brief="" enum="SpatialMaterial.TextureChannel"> + </member> <member name="normal_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> </member> <member name="normal_scale" type="float" setter="set_normal_scale" getter="get_normal_scale" brief=""> </member> <member name="normal_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> - <member name="params_billboard_mode" type="int" setter="set_billboard_mode" getter="get_billboard_mode" brief=""> + <member name="params_alpha_scissor_threshold" type="float" setter="set_alpha_scissor_threshold" getter="get_alpha_scissor_threshold" brief=""> </member> - <member name="params_blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" brief=""> + <member name="params_billboard_mode" type="int" setter="set_billboard_mode" getter="get_billboard_mode" brief="" enum="SpatialMaterial.BillboardMode"> </member> - <member name="params_cull_mode" type="int" setter="set_cull_mode" getter="get_cull_mode" brief=""> + <member name="params_blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" brief="" enum="SpatialMaterial.BlendMode"> </member> - <member name="params_depth_draw_mode" type="int" setter="set_depth_draw_mode" getter="get_depth_draw_mode" brief=""> + <member name="params_cull_mode" type="int" setter="set_cull_mode" getter="get_cull_mode" brief="" enum="SpatialMaterial.CullMode"> </member> - <member name="params_diffuse_mode" type="int" setter="set_diffuse_mode" getter="get_diffuse_mode" brief=""> + <member name="params_depth_draw_mode" type="int" setter="set_depth_draw_mode" getter="get_depth_draw_mode" brief="" enum="SpatialMaterial.DepthDrawMode"> + </member> + <member name="params_diffuse_mode" type="int" setter="set_diffuse_mode" getter="get_diffuse_mode" brief="" enum="SpatialMaterial.DiffuseMode"> </member> <member name="params_grow" type="bool" setter="set_grow_enabled" getter="is_grow_enabled" brief=""> </member> @@ -41913,11 +46927,13 @@ </member> <member name="params_point_size" type="float" setter="set_point_size" getter="get_point_size" brief=""> </member> - <member name="params_specular_mode" type="int" setter="set_specular_mode" getter="get_specular_mode" brief=""> + <member name="params_specular_mode" type="int" setter="set_specular_mode" getter="get_specular_mode" brief="" enum="SpatialMaterial.SpecularMode"> + </member> + <member name="params_use_alpha_scissor" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> <member name="particles_anim_h_frames" type="int" setter="set_particles_anim_h_frames" getter="get_particles_anim_h_frames" brief=""> </member> - <member name="particles_anim_loop" type="bool" setter="set_particles_anim_loop" getter="get_particles_anim_loop" brief=""> + <member name="particles_anim_loop" type="int" setter="set_particles_anim_loop" getter="get_particles_anim_loop" brief=""> </member> <member name="particles_anim_v_frames" type="int" setter="set_particles_anim_v_frames" getter="get_particles_anim_v_frames" brief=""> </member> @@ -41927,6 +46943,8 @@ </member> <member name="refraction_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> + <member name="refraction_texture_channel" type="int" setter="set_refraction_texture_channel" getter="get_refraction_texture_channel" brief="" enum="SpatialMaterial.TextureChannel"> + </member> <member name="rim" type="float" setter="set_rim" getter="get_rim" brief=""> </member> <member name="rim_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> @@ -41939,12 +46957,20 @@ </member> <member name="roughness_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> + <member name="roughness_texture_channel" type="int" setter="set_roughness_texture_channel" getter="get_roughness_texture_channel" brief="" enum="SpatialMaterial.TextureChannel"> + </member> <member name="subsurf_scatter_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> </member> <member name="subsurf_scatter_strength" type="float" setter="set_subsurface_scattering_strength" getter="get_subsurface_scattering_strength" brief=""> </member> <member name="subsurf_scatter_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> + <member name="transmission" type="Color" setter="set_transmission" getter="get_transmission" brief=""> + </member> + <member name="transmission_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> + </member> + <member name="transmission_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> + </member> <member name="uv1_offset" type="Vector3" setter="set_uv1_offset" getter="get_uv1_offset" brief=""> </member> <member name="uv1_scale" type="Vector3" setter="set_uv1_scale" getter="get_uv1_scale" brief=""> @@ -41989,15 +47015,17 @@ </constant> <constant name="TEXTURE_SUBSURFACE_SCATTERING" value="10"> </constant> - <constant name="TEXTURE_REFRACTION" value="11"> + <constant name="TEXTURE_TRANSMISSION" value="11"> + </constant> + <constant name="TEXTURE_REFRACTION" value="12"> </constant> - <constant name="TEXTURE_DETAIL_MASK" value="12"> + <constant name="TEXTURE_DETAIL_MASK" value="13"> </constant> - <constant name="TEXTURE_DETAIL_ALBEDO" value="13"> + <constant name="TEXTURE_DETAIL_ALBEDO" value="14"> </constant> - <constant name="TEXTURE_DETAIL_NORMAL" value="14"> + <constant name="TEXTURE_DETAIL_NORMAL" value="15"> </constant> - <constant name="TEXTURE_MAX" value="15"> + <constant name="TEXTURE_MAX" value="16"> </constant> <constant name="DETAIL_UV_1" value="0"> </constant> @@ -42021,11 +47049,13 @@ </constant> <constant name="FEATURE_SUBSURACE_SCATTERING" value="8"> </constant> - <constant name="FEATURE_REFRACTION" value="9"> + <constant name="FEATURE_TRANSMISSION" value="9"> </constant> - <constant name="FEATURE_DETAIL" value="10"> + <constant name="FEATURE_REFRACTION" value="10"> </constant> - <constant name="FEATURE_MAX" value="11"> + <constant name="FEATURE_DETAIL" value="11"> + </constant> + <constant name="FEATURE_MAX" value="12"> </constant> <constant name="BLEND_MODE_MIX" value="0"> </constant> @@ -42051,21 +47081,33 @@ </constant> <constant name="FLAG_UNSHADED" value="0"> </constant> - <constant name="FLAG_ONTOP" value="1"> + <constant name="FLAG_USE_VERTEX_LIGHTING" value="1"> + </constant> + <constant name="FLAG_DISABLE_DEPTH_TEST" value="2"> + </constant> + <constant name="FLAG_ALBEDO_FROM_VERTEX_COLOR" value="3"> + </constant> + <constant name="FLAG_SRGB_VERTEX_COLOR" value="4"> + </constant> + <constant name="FLAG_USE_POINT_SIZE" value="5"> + </constant> + <constant name="FLAG_FIXED_SIZE" value="6"> + </constant> + <constant name="FLAG_UV1_USE_TRIPLANAR" value="7"> </constant> - <constant name="FLAG_ALBEDO_FROM_VERTEX_COLOR" value="2"> + <constant name="FLAG_UV2_USE_TRIPLANAR" value="8"> </constant> - <constant name="FLAG_SRGB_VERTEX_COLOR" value="3"> + <constant name="FLAG_AO_ON_UV2" value="10"> </constant> - <constant name="FLAG_USE_POINT_SIZE" value="4"> + <constant name="FLAG_USE_ALPHA_SCISSOR" value="11"> </constant> - <constant name="FLAG_FIXED_SIZE" value="5"> + <constant name="FLAG_TRIPLANAR_USE_WORLD" value="9"> </constant> - <constant name="FLAG_MAX" value="9"> + <constant name="FLAG_MAX" value="12"> </constant> <constant name="DIFFUSE_LAMBERT" value="0"> </constant> - <constant name="DIFFUSE_HALF_LAMBERT" value="1"> + <constant name="DIFFUSE_LAMBERT_WRAP" value="1"> </constant> <constant name="DIFFUSE_OREN_NAYAR" value="2"> </constant> @@ -42091,6 +47133,16 @@ </constant> <constant name="BILLBOARD_PARTICLES" value="3"> </constant> + <constant name="TEXTURE_CHANNEL_RED" value="0"> + </constant> + <constant name="TEXTURE_CHANNEL_GREEN" value="1"> + </constant> + <constant name="TEXTURE_CHANNEL_BLUE" value="2"> + </constant> + <constant name="TEXTURE_CHANNEL_ALPHA" value="3"> + </constant> + <constant name="TEXTURE_CHANNEL_GRAYSCALE" value="4"> + </constant> </constants> </class> <class name="SpatialVelocityTracker" inherits="Reference" category="Core"> @@ -42112,18 +47164,24 @@ </description> </method> <method name="reset"> + <return type="void"> + </return> <argument index="0" name="position" type="Vector3"> </argument> <description> </description> </method> <method name="set_track_fixed_step"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="update_position"> + <return type="void"> + </return> <argument index="0" name="position" type="Vector3"> </argument> <description> @@ -42135,8 +47193,10 @@ </class> <class name="SphereMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> + Class representing a spherical [PrimitiveMesh]. </brief_description> <description> + Class representing a spherical [PrimitiveMesh]. </description> <methods> <method name="get_height" qualifiers="const"> @@ -42170,30 +47230,40 @@ </description> </method> <method name="set_height"> + <return type="void"> + </return> <argument index="0" name="height" type="float"> </argument> <description> </description> </method> <method name="set_is_hemisphere"> + <return type="void"> + </return> <argument index="0" name="is_hemisphere" type="bool"> </argument> <description> </description> </method> <method name="set_radial_segments"> + <return type="void"> + </return> <argument index="0" name="radial_segments" type="int"> </argument> <description> </description> </method> <method name="set_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> </description> </method> <method name="set_rings"> + <return type="void"> + </return> <argument index="0" name="rings" type="int"> </argument> <description> @@ -42202,14 +47272,19 @@ </methods> <members> <member name="height" type="float" setter="set_height" getter="get_height" brief=""> + Full height of the sphere. Defaults to 2.0. </member> <member name="is_hemisphere" type="bool" setter="set_is_hemisphere" getter="get_is_hemisphere" brief=""> + Determines whether a full sphere or a hemisphere is created. Attention: To get a regular hemisphere the height and radius of the sphere have to equal. Defaults to false. </member> <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" brief=""> + Number of radial segments on the sphere. Defaults to 64. </member> <member name="radius" type="float" setter="set_radius" getter="get_radius" brief=""> + Radius of sphere. Defaults to 1.0. </member> <member name="rings" type="int" setter="set_rings" getter="get_rings" brief=""> + Number of segments along the height of the sphere. Defaults to 32. </member> </members> <constants> @@ -42228,6 +47303,8 @@ </description> </method> <method name="set_radius"> + <return type="void"> + </return> <argument index="0" name="radius" type="float"> </argument> <description> @@ -42250,7 +47327,7 @@ </description> <methods> <method name="get_line_edit"> - <return type="Object"> + <return type="LineEdit"> </return> <description> </description> @@ -42276,6 +47353,8 @@ </description> </method> <method name="set_editable"> + <return type="void"> + </return> <argument index="0" name="editable" type="bool"> </argument> <description> @@ -42283,6 +47362,8 @@ </description> </method> <method name="set_prefix"> + <return type="void"> + </return> <argument index="0" name="prefix" type="String"> </argument> <description> @@ -42290,6 +47371,8 @@ </description> </method> <method name="set_suffix"> + <return type="void"> + </return> <argument index="0" name="suffix" type="String"> </argument> <description> @@ -42321,7 +47404,7 @@ </description> <methods> <method name="get_dragger_visibility" qualifiers="const"> - <return type="int"> + <return type="int" enum="SplitContainer.DraggerVisibility"> </return> <description> Return visibility of the split dragger (one of [DRAGGER_VISIBLE], [DRAGGER_HIDDEN] or [DRAGGER_HIDDEN_COLLAPSED]). @@ -42342,6 +47425,8 @@ </description> </method> <method name="set_collapsed"> + <return type="void"> + </return> <argument index="0" name="collapsed" type="bool"> </argument> <description> @@ -42349,13 +47434,17 @@ </description> </method> <method name="set_dragger_visibility"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="SplitContainer.DraggerVisibility"> </argument> <description> Set visibility of the split dragger ([i]mode[/i] must be one of [DRAGGER_VISIBLE], [DRAGGER_HIDDEN] or [DRAGGER_HIDDEN_COLLAPSED]). </description> </method> <method name="set_split_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="int"> </argument> <description> @@ -42366,7 +47455,7 @@ <members> <member name="collapsed" type="bool" setter="set_collapsed" getter="is_collapsed" brief=""> </member> - <member name="dragger_visibility" type="int" setter="set_dragger_visibility" getter="get_dragger_visibility" brief=""> + <member name="dragger_visibility" type="int" setter="set_dragger_visibility" getter="get_dragger_visibility" brief="" enum="SplitContainer.DraggerVisibility"> </member> <member name="split_offset" type="int" setter="set_split_offset" getter="get_split_offset" brief=""> </member> @@ -42505,6 +47594,8 @@ </description> </method> <method name="set_centered"> + <return type="void"> + </return> <argument index="0" name="centered" type="bool"> </argument> <description> @@ -42512,6 +47603,8 @@ </description> </method> <method name="set_flip_h"> + <return type="void"> + </return> <argument index="0" name="flip_h" type="bool"> </argument> <description> @@ -42519,6 +47612,8 @@ </description> </method> <method name="set_flip_v"> + <return type="void"> + </return> <argument index="0" name="flip_v" type="bool"> </argument> <description> @@ -42526,6 +47621,8 @@ </description> </method> <method name="set_frame"> + <return type="void"> + </return> <argument index="0" name="frame" type="int"> </argument> <description> @@ -42533,6 +47630,8 @@ </description> </method> <method name="set_hframes"> + <return type="void"> + </return> <argument index="0" name="hframes" type="int"> </argument> <description> @@ -42540,12 +47639,16 @@ </description> </method> <method name="set_normal_map"> + <return type="void"> + </return> <argument index="0" name="normal_map" type="Texture"> </argument> <description> </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> @@ -42553,6 +47656,8 @@ </description> </method> <method name="set_region"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -42560,12 +47665,16 @@ </description> </method> <method name="set_region_filter_clip"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_region_rect"> + <return type="void"> + </return> <argument index="0" name="rect" type="Rect2"> </argument> <description> @@ -42573,6 +47682,8 @@ </description> </method> <method name="set_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> @@ -42580,6 +47691,8 @@ </description> </method> <method name="set_vframes"> + <return type="void"> + </return> <argument index="0" name="vframes" type="int"> </argument> <description> @@ -42669,36 +47782,48 @@ </description> </method> <method name="set_frame"> + <return type="void"> + </return> <argument index="0" name="frame" type="int"> </argument> <description> </description> </method> <method name="set_hframes"> + <return type="void"> + </return> <argument index="0" name="hframes" type="int"> </argument> <description> </description> </method> <method name="set_region"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_region_rect"> + <return type="void"> + </return> <argument index="0" name="rect" type="Rect2"> </argument> <description> </description> </method> <method name="set_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_vframes"> + <return type="void"> + </return> <argument index="0" name="vframes" type="int"> </argument> <description> @@ -42735,13 +47860,13 @@ </description> <methods> <method name="get_alpha_cut_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="SpriteBase3D.AlphaCutMode"> </return> <description> </description> </method> <method name="get_axis" qualifiers="const"> - <return type="int"> + <return type="int" enum="Vector3.Axis"> </return> <description> </description> @@ -42749,7 +47874,7 @@ <method name="get_draw_flag" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="flag" type="int"> + <argument index="0" name="flag" type="int" enum="SpriteBase3D.DrawFlags"> </argument> <description> </description> @@ -42803,25 +47928,33 @@ </description> </method> <method name="set_alpha_cut_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="SpriteBase3D.AlphaCutMode"> </argument> <description> </description> </method> <method name="set_axis"> - <argument index="0" name="axis" type="int"> + <return type="void"> + </return> + <argument index="0" name="axis" type="int" enum="Vector3.Axis"> </argument> <description> </description> </method> <method name="set_centered"> + <return type="void"> + </return> <argument index="0" name="centered" type="bool"> </argument> <description> </description> </method> <method name="set_draw_flag"> - <argument index="0" name="flag" type="int"> + <return type="void"> + </return> + <argument index="0" name="flag" type="int" enum="SpriteBase3D.DrawFlags"> </argument> <argument index="1" name="enabled" type="bool"> </argument> @@ -42829,36 +47962,48 @@ </description> </method> <method name="set_flip_h"> + <return type="void"> + </return> <argument index="0" name="flip_h" type="bool"> </argument> <description> </description> </method> <method name="set_flip_v"> + <return type="void"> + </return> <argument index="0" name="flip_v" type="bool"> </argument> <description> </description> </method> <method name="set_modulate"> + <return type="void"> + </return> <argument index="0" name="modulate" type="Color"> </argument> <description> </description> </method> <method name="set_offset"> + <return type="void"> + </return> <argument index="0" name="offset" type="Vector2"> </argument> <description> </description> </method> <method name="set_opacity"> + <return type="void"> + </return> <argument index="0" name="opacity" type="float"> </argument> <description> </description> </method> <method name="set_pixel_size"> + <return type="void"> + </return> <argument index="0" name="pixel_size" type="float"> </argument> <description> @@ -42866,9 +48011,9 @@ </method> </methods> <members> - <member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" brief=""> + <member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" brief="" enum="SpriteBase3D.AlphaCutMode"> </member> - <member name="axis" type="int" setter="set_axis" getter="get_axis" brief=""> + <member name="axis" type="int" setter="set_axis" getter="get_axis" brief="" enum="Vector3.Axis"> </member> <member name="centered" type="bool" setter="set_centered" getter="is_centered" brief=""> </member> @@ -42917,15 +48062,19 @@ </description> <methods> <method name="add_animation"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> <description> </description> </method> <method name="add_frame"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> - <argument index="1" name="frame" type="Object"> + <argument index="1" name="frame" type="Texture"> </argument> <argument index="2" name="atpos" type="int" default="-1"> </argument> @@ -42933,12 +48082,16 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> <description> </description> </method> <method name="clear_all"> + <return type="void"> + </return> <description> </description> </method> @@ -42959,7 +48112,7 @@ </description> </method> <method name="get_frame" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <argument index="0" name="anim" type="String"> </argument> @@ -42985,12 +48138,16 @@ </description> </method> <method name="remove_animation"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> <description> </description> </method> <method name="remove_frame"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> <argument index="1" name="idx" type="int"> @@ -42999,6 +48156,8 @@ </description> </method> <method name="rename_animation"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> <argument index="1" name="newname" type="String"> @@ -43007,6 +48166,8 @@ </description> </method> <method name="set_animation_loop"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> <argument index="1" name="loop" type="bool"> @@ -43015,6 +48176,8 @@ </description> </method> <method name="set_animation_speed"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> <argument index="1" name="speed" type="float"> @@ -43023,11 +48186,13 @@ </description> </method> <method name="set_frame"> + <return type="void"> + </return> <argument index="0" name="anim" type="String"> </argument> <argument index="1" name="idx" type="int"> </argument> - <argument index="2" name="txt" type="Object"> + <argument index="2" name="txt" type="Texture"> </argument> <description> </description> @@ -43081,6 +48246,8 @@ </description> </method> <method name="set_bounce"> + <return type="void"> + </return> <argument index="0" name="bounce" type="float"> </argument> <description> @@ -43088,6 +48255,8 @@ </description> </method> <method name="set_constant_angular_velocity"> + <return type="void"> + </return> <argument index="0" name="vel" type="Vector3"> </argument> <description> @@ -43095,6 +48264,8 @@ </description> </method> <method name="set_constant_linear_velocity"> + <return type="void"> + </return> <argument index="0" name="vel" type="Vector3"> </argument> <description> @@ -43102,6 +48273,8 @@ </description> </method> <method name="set_friction"> + <return type="void"> + </return> <argument index="0" name="friction" type="float"> </argument> <description> @@ -43111,12 +48284,16 @@ </methods> <members> <member name="bounce" type="float" setter="set_bounce" getter="get_bounce" brief=""> + The body bounciness. </member> <member name="constant_angular_velocity" type="Vector3" setter="set_constant_angular_velocity" getter="get_constant_angular_velocity" brief=""> + The constant angular velocity for the body. This does not rotate the body, but affects other bodies that touch it, as if it was in a state of rotation. </member> <member name="constant_linear_velocity" type="Vector3" setter="set_constant_linear_velocity" getter="get_constant_linear_velocity" brief=""> + The constant linear velocity for the body. This does not move the body, but affects other bodies that touch it, as if it was in a state of movement. </member> <member name="friction" type="float" setter="set_friction" getter="get_friction" brief=""> + The body friction, from 0 (frictionless) to 1 (full friction). </member> </members> <constants> @@ -43161,6 +48338,8 @@ </description> </method> <method name="set_bounce"> + <return type="void"> + </return> <argument index="0" name="bounce" type="float"> </argument> <description> @@ -43168,6 +48347,8 @@ </description> </method> <method name="set_constant_angular_velocity"> + <return type="void"> + </return> <argument index="0" name="vel" type="float"> </argument> <description> @@ -43175,6 +48356,8 @@ </description> </method> <method name="set_constant_linear_velocity"> + <return type="void"> + </return> <argument index="0" name="vel" type="Vector2"> </argument> <description> @@ -43182,6 +48365,8 @@ </description> </method> <method name="set_friction"> + <return type="void"> + </return> <argument index="0" name="friction" type="float"> </argument> <description> @@ -43320,7 +48505,7 @@ <argument index="0" name="bytes" type="int"> </argument> <description> - Get an utf8 string with byte-length "bytes" from the stream (this decodes the string sent as utf8). + Get a utf8 string with byte-length "bytes" from the stream (this decodes the string sent as utf8). </description> </method> <method name="get_var"> @@ -43338,6 +48523,8 @@ </description> </method> <method name="put_16"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -43345,6 +48532,8 @@ </description> </method> <method name="put_32"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -43352,6 +48541,8 @@ </description> </method> <method name="put_64"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -43359,6 +48550,8 @@ </description> </method> <method name="put_8"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -43366,7 +48559,7 @@ </description> </method> <method name="put_data"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="data" type="PoolByteArray"> </argument> @@ -43375,6 +48568,8 @@ </description> </method> <method name="put_double"> + <return type="void"> + </return> <argument index="0" name="val" type="float"> </argument> <description> @@ -43382,6 +48577,8 @@ </description> </method> <method name="put_float"> + <return type="void"> + </return> <argument index="0" name="val" type="float"> </argument> <description> @@ -43398,6 +48595,8 @@ </description> </method> <method name="put_u16"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -43405,6 +48604,8 @@ </description> </method> <method name="put_u32"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -43412,6 +48613,8 @@ </description> </method> <method name="put_u64"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -43419,6 +48622,8 @@ </description> </method> <method name="put_u8"> + <return type="void"> + </return> <argument index="0" name="val" type="int"> </argument> <description> @@ -43426,6 +48631,8 @@ </description> </method> <method name="put_utf8_string"> + <return type="void"> + </return> <argument index="0" name="val" type="String"> </argument> <description> @@ -43433,6 +48640,8 @@ </description> </method> <method name="put_var"> + <return type="void"> + </return> <argument index="0" name="val" type="Variant"> </argument> <description> @@ -43440,6 +48649,8 @@ </description> </method> <method name="set_big_endian"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -43457,6 +48668,8 @@ </description> <methods> <method name="clear"> + <return type="void"> + </return> <description> </description> </method> @@ -43485,18 +48698,24 @@ </description> </method> <method name="resize"> + <return type="void"> + </return> <argument index="0" name="size" type="int"> </argument> <description> </description> </method> <method name="seek"> + <return type="void"> + </return> <argument index="0" name="pos" type="int"> </argument> <description> </description> </method> <method name="set_data_array"> + <return type="void"> + </return> <argument index="0" name="data" type="PoolByteArray"> </argument> <description> @@ -43515,7 +48734,7 @@ </description> <methods> <method name="accept_stream"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="stream" type="StreamPeer"> </argument> @@ -43523,7 +48742,7 @@ </description> </method> <method name="connect_to_stream"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="stream" type="StreamPeer"> </argument> @@ -43536,12 +48755,14 @@ </description> </method> <method name="disconnect_from_stream"> + <return type="void"> + </return> <description> Disconnect from host. </description> </method> <method name="get_status" qualifiers="const"> - <return type="int"> + <return type="int" enum="StreamPeerSSL.Status"> </return> <description> Return the status of the connection, one of STATUS_* enum. @@ -43572,7 +48793,7 @@ </description> <methods> <method name="connect_to_host"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="host" type="String"> </argument> @@ -43583,6 +48804,8 @@ </description> </method> <method name="disconnect_from_host"> + <return type="void"> + </return> <description> Disconnect from host. </description> @@ -43602,7 +48825,7 @@ </description> </method> <method name="get_status" qualifiers="const"> - <return type="int"> + <return type="int" enum="StreamPeerTCP.Status"> </return> <description> Return the status of the connection, one of STATUS_* enum. @@ -43643,7 +48866,7 @@ </description> </method> <method name="load"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="path" type="String"> </argument> @@ -44009,7 +49232,7 @@ <return type="int"> </return> <description> - Convert a string containing an hexadecimal number into an int. + Convert a string containing a hexadecimal number into an int. </description> </method> <method name="insert"> @@ -44392,6 +49615,8 @@ </description> <methods> <method name="draw" qualifiers="const"> + <return type="void"> + </return> <argument index="0" name="canvas_item" type="RID"> </argument> <argument index="1" name="rect" type="Rect2"> @@ -44408,7 +49633,7 @@ <method name="get_default_margin" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> Return the default offset of the margin "margin" (see MARGIN_* enum) of a StyleBox, Controls that draw styleboxes with context inside need to know the margin, so the border of the stylebox is not occluded. @@ -44417,7 +49642,7 @@ <method name="get_margin" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> Return the offset of margin "margin" (see MARGIN_* enum). @@ -44438,7 +49663,9 @@ </description> </method> <method name="set_default_margin"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <argument index="1" name="offset" type="float"> </argument> @@ -44485,12 +49712,34 @@ </class> <class name="StyleBoxFlat" inherits="StyleBox" category="Core"> <brief_description> - Stylebox of a single color. + Customizable Stylebox with a given set of parameters. (no texture required) </brief_description> <description> - Stylebox of a single color. Displays the stylebox of a single color, alternatively a border with light/dark colors can be assigned. + This stylebox can be used to achieve all kinds of looks without the need of a texture. Those properties are customizable: + - Color + - Border width (individual width for each border) + - Rounded corners (individual radius for each corner) + - Shadow + About corner radius: + Setting corner radius to high values is allowed. As soon as corners would overlap the stylebox will switch to a relative system. Example: + [codeblock] + height = 30 + corner_radius_top_left = 50 + corner_raidus_bottom_left = 100 + [/codeblock] + The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will [b]never[/b] be more than the height. Result: + [codeblock] + corner_radius_top_left: 10 + corner_raidus_bottom_left: 20 + [/codeblock] </description> <methods> + <method name="get_aa_size" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="get_bg_color" qualifiers="const"> <return type="Color"> </return> @@ -44503,79 +49752,292 @@ <description> </description> </method> - <method name="get_border_size" qualifiers="const"> + <method name="get_border_color" qualifiers="const"> + <return type="Color"> + </return> + <description> + </description> + </method> + <method name="get_border_width" qualifiers="const"> <return type="int"> </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> <description> </description> </method> - <method name="get_dark_color" qualifiers="const"> + <method name="get_border_width_min" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_corner_detail" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_corner_radius" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="corner" type="int" enum="Corner"> + </argument> + <description> + </description> + </method> + <method name="get_expand_margin" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <description> + </description> + </method> + <method name="get_shadow_color" qualifiers="const"> <return type="Color"> </return> <description> </description> </method> + <method name="get_shadow_size" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="is_anti_aliased" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_draw_center_enabled" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> - <method name="get_light_color" qualifiers="const"> - <return type="Color"> + <method name="set_aa_size"> + <return type="void"> </return> + <argument index="0" name="size" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_anti_aliased"> + <return type="void"> + </return> + <argument index="0" name="anti_aliased" type="bool"> + </argument> <description> </description> </method> <method name="set_bg_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_border_blend"> + <return type="void"> + </return> <argument index="0" name="blend" type="bool"> </argument> <description> </description> </method> - <method name="set_border_size"> - <argument index="0" name="size" type="int"> + <method name="set_border_color"> + <return type="void"> + </return> + <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> - <method name="set_dark_color"> - <argument index="0" name="color" type="Color"> + <method name="set_border_width"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="width" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_border_width_all"> + <return type="void"> + </return> + <argument index="0" name="width" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_corner_detail"> + <return type="void"> + </return> + <argument index="0" name="detail" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_corner_radius"> + <return type="void"> + </return> + <argument index="0" name="corner" type="int" enum="Corner"> + </argument> + <argument index="1" name="radius" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_corner_radius_all"> + <return type="void"> + </return> + <argument index="0" name="radius" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_corner_radius_individual"> + <return type="void"> + </return> + <argument index="0" name="radius_top_left" type="int"> + </argument> + <argument index="1" name="radius_top_right" type="int"> + </argument> + <argument index="2" name="radius_botton_right" type="int"> + </argument> + <argument index="3" name="radius_bottom_left" type="int"> </argument> <description> </description> </method> <method name="set_draw_center"> - <argument index="0" name="size" type="bool"> + <return type="void"> + </return> + <argument index="0" name="draw_center" type="bool"> </argument> <description> </description> </method> - <method name="set_light_color"> + <method name="set_expand_margin"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> + <argument index="1" name="size" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_expand_margin_all"> + <return type="void"> + </return> + <argument index="0" name="size" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_expand_margin_individual"> + <return type="void"> + </return> + <argument index="0" name="size_left" type="float"> + </argument> + <argument index="1" name="size_top" type="float"> + </argument> + <argument index="2" name="size_right" type="float"> + </argument> + <argument index="3" name="size_bottom" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_shadow_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> + <method name="set_shadow_size"> + <return type="void"> + </return> + <argument index="0" name="size" type="int"> + </argument> + <description> + </description> + </method> </methods> <members> + <member name="anti_aliasing" type="bool" setter="set_anti_aliased" getter="is_anti_aliased" brief=""> + Anti Aliasing draws a small ring around edges. This ring fades to transparent. As a result edges look much smoother. This is only noticable when using rounded corners. + </member> + <member name="anti_aliasing_size" type="int" setter="set_aa_size" getter="get_aa_size" brief=""> + This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect. + </member> <member name="bg_color" type="Color" setter="set_bg_color" getter="get_bg_color" brief=""> + The background color of the stylebox. </member> <member name="border_blend" type="bool" setter="set_border_blend" getter="get_border_blend" brief=""> + When set to true, the border will fade into the background color. + </member> + <member name="border_color" type="Color" setter="set_border_color" getter="get_border_color" brief=""> + Sets the color of the border. + </member> + <member name="border_width_bottom" type="int" setter="set_border_width" getter="get_border_width" brief=""> + Border width for the bottom border. + </member> + <member name="border_width_left" type="int" setter="set_border_width" getter="get_border_width" brief=""> + Border width for the left border. + </member> + <member name="border_width_right" type="int" setter="set_border_width" getter="get_border_width" brief=""> + Border width for the right border. + </member> + <member name="border_width_top" type="int" setter="set_border_width" getter="get_border_width" brief=""> + Border width for the top border. + </member> + <member name="corner_detail" type="int" setter="set_corner_detail" getter="get_corner_detail" brief=""> + This sets the amount of vertices used for each corner. Higher values result in rounder corners but take more processing power to compute. When choosing a value you should take the corner radius ([method set_corner_radius]) into account. + For corner radius smaller than 10: 4-5 should be enough + For corner radius smaller than 30: 8-12 should be enough ... </member> - <member name="border_size" type="int" setter="set_border_size" getter="get_border_size" brief=""> + <member name="corner_radius_bottom_left" type="int" setter="set_corner_radius" getter="get_corner_radius" brief=""> + The corner radius of the bottom left corner. When set to 0 the corner is not rounded. </member> - <member name="dark_color" type="Color" setter="set_dark_color" getter="get_dark_color" brief=""> + <member name="corner_radius_bottom_right" type="int" setter="set_corner_radius" getter="get_corner_radius" brief=""> + The corner radius of the bottom right corner. When set to 0 the corner is not rounded. </member> - <member name="draw_bg" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" brief=""> + <member name="corner_radius_top_left" type="int" setter="set_corner_radius" getter="get_corner_radius" brief=""> + The corner radius of the top left corner. When set to 0 the corner is not rounded. </member> - <member name="light_color" type="Color" setter="set_light_color" getter="get_light_color" brief=""> + <member name="corner_radius_top_right" type="int" setter="set_corner_radius" getter="get_corner_radius" brief=""> + The corner radius of the top right corner. When set to 0 the corner is not rounded. + </member> + <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" brief=""> + Toggels drawing of the inner part of the stylebox. + </member> + <member name="expand_margin_bottom" type="float" setter="set_expand_margin" getter="get_expand_margin" brief=""> + Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with border_width_bottom. To draw a border outside the control rect. + </member> + <member name="expand_margin_left" type="float" setter="set_expand_margin" getter="get_expand_margin" brief=""> + Expands the stylebox outside of the control rect on the left edge. Useful in combination with border_width_left. To draw a border outside the control rect. + </member> + <member name="expand_margin_right" type="float" setter="set_expand_margin" getter="get_expand_margin" brief=""> + Expands the stylebox outside of the control rect on the right edge. Useful in combination with border_width_right. To draw a border outside the control rect. + </member> + <member name="expand_margin_top" type="float" setter="set_expand_margin" getter="get_expand_margin" brief=""> + Expands the stylebox outside of the control rect on the top edge. Useful in combination with border_width_top. To draw a border outside the control rect. + </member> + <member name="shadow_color" type="Color" setter="set_shadow_color" getter="get_shadow_color" brief=""> + The color of the shadow. (This has no effect when shadow_size < 1) + </member> + <member name="shadow_size" type="int" setter="set_shadow_size" getter="get_shadow_size" brief=""> + The shadow size in pixels. </member> </members> <constants> @@ -44589,24 +50051,24 @@ Texture Based 3x3 scale style. This stylebox performs a 3x3 scaling of a texture, where only the center cell is fully stretched. This allows for the easy creation of bordered styles. </description> <methods> - <method name="is_draw_center_enabled" qualifiers="const"> - <return type="bool"> + <method name="get_expand_margin_size" qualifiers="const"> + <return type="float"> </return> + <argument index="0" name="margin" type="int" enum="Margin"> + </argument> <description> </description> </method> - <method name="get_expand_margin_size" qualifiers="const"> - <return type="float"> + <method name="get_h_axis_stretch_mode" qualifiers="const"> + <return type="int" enum="StyleBoxTexture.AxisStretchMode"> </return> - <argument index="0" name="margin" type="int"> - </argument> <description> </description> </method> <method name="get_margin_size" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> </description> @@ -44618,7 +50080,7 @@ </description> </method> <method name="get_normal_map" qualifiers="const"> - <return type="Texture"> + <return type="Resource"> </return> <description> </description> @@ -44630,27 +50092,75 @@ </description> </method> <method name="get_texture" qualifiers="const"> - <return type="Texture"> + <return type="Resource"> + </return> + <description> + </description> + </method> + <method name="get_v_axis_stretch_mode" qualifiers="const"> + <return type="int" enum="StyleBoxTexture.AxisStretchMode"> + </return> + <description> + </description> + </method> + <method name="is_draw_center_enabled" qualifiers="const"> + <return type="bool"> </return> <description> </description> </method> <method name="set_draw_center"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> + <method name="set_expand_margin_all"> + <return type="void"> + </return> + <argument index="0" name="size" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_expand_margin_individual"> + <return type="void"> + </return> + <argument index="0" name="size_left" type="float"> + </argument> + <argument index="1" name="size_top" type="float"> + </argument> + <argument index="2" name="size_right" type="float"> + </argument> + <argument index="3" name="size_bottom" type="float"> + </argument> + <description> + </description> + </method> <method name="set_expand_margin_size"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <argument index="1" name="size" type="float"> </argument> <description> </description> </method> + <method name="set_h_axis_stretch_mode"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="StyleBoxTexture.AxisStretchMode"> + </argument> + <description> + </description> + </method> <method name="set_margin_size"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <argument index="1" name="size" type="float"> </argument> @@ -44658,31 +50168,51 @@ </description> </method> <method name="set_modulate"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> </description> </method> <method name="set_normal_map"> - <argument index="0" name="normal_map" type="Texture"> + <return type="void"> + </return> + <argument index="0" name="normal_map" type="Resource"> </argument> <description> </description> </method> <method name="set_region_rect"> + <return type="void"> + </return> <argument index="0" name="region" type="Rect2"> </argument> <description> </description> </method> <method name="set_texture"> - <argument index="0" name="texture" type="Texture"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Resource"> + </argument> + <description> + </description> + </method> + <method name="set_v_axis_stretch_mode"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="StyleBoxTexture.AxisStretchMode"> </argument> <description> </description> </method> </methods> <members> + <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" brief="" enum="StyleBoxTexture.AxisStretchMode"> + </member> + <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" brief="" enum="StyleBoxTexture.AxisStretchMode"> + </member> <member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled" brief=""> </member> <member name="expand_margin_bottom" type="float" setter="set_expand_margin_size" getter="get_expand_margin_size" brief=""> @@ -44703,11 +50233,11 @@ </member> <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" brief=""> </member> - <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" brief=""> + <member name="normal_map" type="Resource" setter="set_normal_map" getter="get_normal_map" brief=""> </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" brief=""> </member> - <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> + <member name="texture" type="Resource" setter="set_texture" getter="get_texture" brief=""> </member> </members> <signals> @@ -44717,6 +50247,12 @@ </signal> </signals> <constants> + <constant name="AXIS_STRETCH_MODE_STRETCH" value="0"> + </constant> + <constant name="AXIS_STRETCH_MODE_TILE" value="1"> + </constant> + <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2"> + </constant> </constants> </class> <class name="SurfaceTool" inherits="Reference" category="Core"> @@ -44737,6 +50273,8 @@ </description> <methods> <method name="add_bones"> + <return type="void"> + </return> <argument index="0" name="bones" type="PoolIntArray"> </argument> <description> @@ -44744,6 +50282,8 @@ </description> </method> <method name="add_color"> + <return type="void"> + </return> <argument index="0" name="color" type="Color"> </argument> <description> @@ -44751,6 +50291,8 @@ </description> </method> <method name="add_index"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <description> @@ -44758,6 +50300,8 @@ </description> </method> <method name="add_normal"> + <return type="void"> + </return> <argument index="0" name="normal" type="Vector3"> </argument> <description> @@ -44765,6 +50309,8 @@ </description> </method> <method name="add_smooth_group"> + <return type="void"> + </return> <argument index="0" name="smooth" type="bool"> </argument> <description> @@ -44772,30 +50318,44 @@ </description> </method> <method name="add_tangent"> + <return type="void"> + </return> <argument index="0" name="tangent" type="Plane"> </argument> <description> Specify a Tangent for the next Vertex to use. </description> </method> + <method name="add_to_format"> + <return type="void"> + </return> + <argument index="0" name="flags" type="int"> + </argument> + <description> + </description> + </method> <method name="add_triangle_fan"> + <return type="void"> + </return> <argument index="0" name="vertexes" type="PoolVector3Array"> </argument> - <argument index="1" name="uvs" type="PoolVector2Array" default="PoolVector2Array([])"> + <argument index="1" name="uvs" type="PoolVector2Array" default="PoolVector2Array( )"> </argument> - <argument index="2" name="colors" type="PoolColorArray" default="PoolColorArray([PoolColorArray])"> + <argument index="2" name="colors" type="PoolColorArray" default="PoolColorArray( )"> </argument> - <argument index="3" name="uv2s" type="PoolVector2Array" default="PoolVector2Array([])"> + <argument index="3" name="uv2s" type="PoolVector2Array" default="PoolVector2Array( )"> </argument> - <argument index="4" name="normals" type="PoolVector3Array" default="PoolVector3Array([])"> + <argument index="4" name="normals" type="PoolVector3Array" default="PoolVector3Array( )"> </argument> - <argument index="5" name="tangents" type="Array" default="[]"> + <argument index="5" name="tangents" type="Array" default="[ ]"> </argument> <description> Insert a triangle fan made of array data into [Mesh] being constructed. </description> </method> <method name="add_uv"> + <return type="void"> + </return> <argument index="0" name="uv" type="Vector2"> </argument> <description> @@ -44803,6 +50363,8 @@ </description> </method> <method name="add_uv2"> + <return type="void"> + </return> <argument index="0" name="uv2" type="Vector2"> </argument> <description> @@ -44810,6 +50372,8 @@ </description> </method> <method name="add_vertex"> + <return type="void"> + </return> <argument index="0" name="vertex" type="Vector3"> </argument> <description> @@ -44817,49 +50381,91 @@ </description> </method> <method name="add_weights"> + <return type="void"> + </return> <argument index="0" name="weights" type="PoolRealArray"> </argument> <description> Specify weight value for next Vertex to use. </description> </method> + <method name="append_from"> + <return type="void"> + </return> + <argument index="0" name="existing" type="Mesh"> + </argument> + <argument index="1" name="surface" type="int"> + </argument> + <argument index="2" name="transform" type="Transform"> + </argument> + <description> + </description> + </method> <method name="begin"> - <argument index="0" name="primitive" type="int"> + <return type="void"> + </return> + <argument index="0" name="primitive" type="int" enum="Mesh.PrimitiveType"> </argument> <description> Called before adding any Vertices. Takes the primitive type as an argument (e.g. Mesh.PRIMITIVE_TRIANGLES). </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clear all information passed into the surface tool so far. </description> </method> <method name="commit"> - <return type="Mesh"> + <return type="ArrayMesh"> + </return> + <argument index="0" name="existing" type="ArrayMesh" default="null"> + </argument> + <description> + Returns a constructed [ArrayMesh] from current information passed in. If an existing [ArrayMesh] is passed in as an argument, will add an extra surface to the existing [ArrayMesh]. + </description> + </method> + <method name="create_from"> + <return type="void"> </return> - <argument index="0" name="existing" type="Mesh" default="NULL"> + <argument index="0" name="existing" type="Mesh"> + </argument> + <argument index="1" name="surface" type="int"> </argument> <description> - Returns a constructed [Mesh] from current information passed in. If an existing [Mesh] is passed in as an argument, will add an extra surface to the existing [Mesh]. </description> </method> <method name="deindex"> + <return type="void"> + </return> <description> Removes index array by expanding Vertex array. </description> </method> <method name="generate_normals"> + <return type="void"> + </return> <description> Generates normals from Vertices so you do not have to do it manually. </description> </method> + <method name="generate_tangents"> + <return type="void"> + </return> + <description> + </description> + </method> <method name="index"> + <return type="void"> + </return> <description> Shrinks Vertex array by creating an index array. Avoids reusing Vertices. </description> </method> <method name="set_material"> + <return type="void"> + </return> <argument index="0" name="material" type="Material"> </argument> <description> @@ -44886,7 +50492,7 @@ </description> </method> <method name="listen"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="port" type="int"> </argument> @@ -44900,12 +50506,14 @@ </description> </method> <method name="stop"> + <return type="void"> + </return> <description> Stop listening. </description> </method> <method name="take_connection"> - <return type="Object"> + <return type="StreamPeerTCP"> </return> <description> If a connection is available, return a StreamPeerTCP with the connection/ @@ -44958,7 +50566,7 @@ </description> </method> <method name="get_tab_align" qualifiers="const"> - <return type="int"> + <return type="int" enum="TabContainer.TabAlign"> </return> <description> Return tab alignment, from the ALIGN_* enum. @@ -45006,6 +50614,8 @@ </description> </method> <method name="set_current_tab"> + <return type="void"> + </return> <argument index="0" name="tab_idx" type="int"> </argument> <description> @@ -45013,19 +50623,25 @@ </description> </method> <method name="set_popup"> - <argument index="0" name="popup" type="Popup"> + <return type="void"> + </return> + <argument index="0" name="popup" type="Node"> </argument> <description> </description> </method> <method name="set_tab_align"> - <argument index="0" name="align" type="int"> + <return type="void"> + </return> + <argument index="0" name="align" type="int" enum="TabContainer.TabAlign"> </argument> <description> Set tab alignment, from the ALIGN_* enum. Moves tabs to the left, right or center. </description> </method> <method name="set_tab_disabled"> + <return type="void"> + </return> <argument index="0" name="tab_idx" type="int"> </argument> <argument index="1" name="disabled" type="bool"> @@ -45034,6 +50650,8 @@ </description> </method> <method name="set_tab_icon"> + <return type="void"> + </return> <argument index="0" name="tab_idx" type="int"> </argument> <argument index="1" name="icon" type="Texture"> @@ -45043,6 +50661,8 @@ </description> </method> <method name="set_tab_title"> + <return type="void"> + </return> <argument index="0" name="tab_idx" type="int"> </argument> <argument index="1" name="title" type="String"> @@ -45052,6 +50672,8 @@ </description> </method> <method name="set_tabs_visible"> + <return type="void"> + </return> <argument index="0" name="visible" type="bool"> </argument> <description> @@ -45062,7 +50684,7 @@ <members> <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab" brief=""> </member> - <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" brief=""> + <member name="tab_align" type="int" setter="set_tab_align" getter="get_tab_align" brief="" enum="TabContainer.TabAlign"> </member> <member name="tabs_visible" type="bool" setter="set_tabs_visible" getter="are_tabs_visible" brief=""> </member> @@ -45137,14 +50759,18 @@ </description> <methods> <method name="add_tab"> - <argument index="0" name="title" type="String"> + <return type="void"> + </return> + <argument index="0" name="title" type="String" default=""""> </argument> - <argument index="1" name="icon" type="Texture"> + <argument index="1" name="icon" type="Texture" default="null"> </argument> <description> </description> </method> <method name="ensure_tab_visible"> + <return type="void"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -45157,7 +50783,13 @@ </description> </method> <method name="get_tab_align" qualifiers="const"> - <return type="int"> + <return type="int" enum="Tabs.TabAlign"> + </return> + <description> + </description> + </method> + <method name="get_tab_close_display_policy" qualifiers="const"> + <return type="int" enum="Tabs.CloseButtonDisplayPolicy"> </return> <description> </description> @@ -45184,7 +50816,7 @@ <description> </description> </method> - <method name="get_tab_rect"> + <method name="get_tab_rect" qualifiers="const"> <return type="Rect2"> </return> <argument index="0" name="tab_idx" type="int"> @@ -45202,6 +50834,8 @@ </description> </method> <method name="move_tab"> + <return type="void"> + </return> <argument index="0" name="from" type="int"> </argument> <argument index="1" name="to" type="int"> @@ -45211,24 +50845,40 @@ </description> </method> <method name="remove_tab"> + <return type="void"> + </return> <argument index="0" name="tab_idx" type="int"> </argument> <description> </description> </method> <method name="set_current_tab"> + <return type="void"> + </return> <argument index="0" name="tab_idx" type="int"> </argument> <description> </description> </method> <method name="set_tab_align"> - <argument index="0" name="align" type="int"> + <return type="void"> + </return> + <argument index="0" name="align" type="int" enum="Tabs.TabAlign"> + </argument> + <description> + </description> + </method> + <method name="set_tab_close_display_policy"> + <return type="void"> + </return> + <argument index="0" name="policy" type="int" enum="Tabs.CloseButtonDisplayPolicy"> </argument> <description> </description> </method> <method name="set_tab_disabled"> + <return type="void"> + </return> <argument index="0" name="tab_idx" type="int"> </argument> <argument index="1" name="disabled" type="bool"> @@ -45237,6 +50887,8 @@ </description> </method> <method name="set_tab_icon"> + <return type="void"> + </return> <argument index="0" name="tab_idx" type="int"> </argument> <argument index="1" name="icon" type="Texture"> @@ -45245,6 +50897,8 @@ </description> </method> <method name="set_tab_title"> + <return type="void"> + </return> <argument index="0" name="tab_idx" type="int"> </argument> <argument index="1" name="title" type="String"> @@ -45256,6 +50910,8 @@ <members> <member name="current_tab" type="int" setter="set_current_tab" getter="get_current_tab" brief=""> </member> + <member name="tab_close_display_policy" type="int" setter="set_tab_close_display_policy" getter="get_tab_close_display_policy" brief="" enum="Tabs.CloseButtonDisplayPolicy"> + </member> </members> <signals> <signal name="reposition_active_tab_request"> @@ -45276,6 +50932,12 @@ <description> </description> </signal> + <signal name="tab_clicked"> + <argument index="0" name="tab" type="int"> + </argument> + <description> + </description> + </signal> <signal name="tab_close"> <argument index="0" name="tab" type="int"> </argument> @@ -45296,12 +50958,16 @@ </constant> <constant name="ALIGN_RIGHT" value="2"> </constant> + <constant name="ALIGN_MAX" value="3"> + </constant> <constant name="CLOSE_BUTTON_SHOW_ACTIVE_ONLY" value="1"> </constant> <constant name="CLOSE_BUTTON_SHOW_ALWAYS" value="2"> </constant> <constant name="CLOSE_BUTTON_SHOW_NEVER" value="0"> </constant> + <constant name="CLOSE_BUTTON_MAX" value="3"> + </constant> </constants> <theme_items> <theme_item name="button" type="StyleBox"> @@ -45351,6 +51017,8 @@ </description> <methods> <method name="add_color_region"> + <return type="void"> + </return> <argument index="0" name="begin_key" type="String"> </argument> <argument index="1" name="end_key" type="String"> @@ -45364,6 +51032,8 @@ </description> </method> <method name="add_keyword_color"> + <return type="void"> + </return> <argument index="0" name="keyword" type="String"> </argument> <argument index="1" name="color" type="Color"> @@ -45373,16 +51043,22 @@ </description> </method> <method name="clear_colors"> + <return type="void"> + </return> <description> Clear all the syntax coloring information. </description> </method> <method name="clear_undo_history"> + <return type="void"> + </return> <description> Clear the undo history. </description> </method> <method name="copy"> + <return type="void"> + </return> <description> Copy the current selection. </description> @@ -45423,6 +51099,8 @@ </description> </method> <method name="cursor_set_blink_enabled"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -45430,6 +51108,8 @@ </description> </method> <method name="cursor_set_blink_speed"> + <return type="void"> + </return> <argument index="0" name="blink_speed" type="float"> </argument> <description> @@ -45437,6 +51117,8 @@ </description> </method> <method name="cursor_set_block_mode"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -45444,6 +51126,8 @@ </description> </method> <method name="cursor_set_column"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="adjust_viewport" type="bool" default="true"> @@ -45452,6 +51136,8 @@ </description> </method> <method name="cursor_set_line"> + <return type="void"> + </return> <argument index="0" name="line" type="int"> </argument> <argument index="1" name="adjust_viewport" type="bool" default="true"> @@ -45460,6 +51146,8 @@ </description> </method> <method name="cut"> + <return type="void"> + </return> <description> Cut the current selection. </description> @@ -45528,6 +51216,12 @@ Return the whole text. </description> </method> + <method name="get_v_scroll_speed" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="get_word_under_cursor" qualifiers="const"> <return type="String"> </return> @@ -45535,6 +51229,8 @@ </description> </method> <method name="insert_text_at_cursor"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> @@ -45562,6 +51258,12 @@ Returns true if line numbers are enabled. </description> </method> + <method name="is_smooth_scroll_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_syntax_coloring_enabled" qualifiers="const"> <return type="bool"> </return> @@ -45570,17 +51272,23 @@ </description> </method> <method name="menu_option"> - <argument index="0" name="arg0" type="int"> + <return type="void"> + </return> + <argument index="0" name="option" type="int"> </argument> <description> </description> </method> <method name="paste"> + <return type="void"> + </return> <description> Paste the current selection. </description> </method> <method name="redo"> + <return type="void"> + </return> <description> Perform redo operation. </description> @@ -45588,19 +51296,21 @@ <method name="search" qualifiers="const"> <return type="PoolIntArray"> </return> - <argument index="0" name="flags" type="String"> + <argument index="0" name="key" type="String"> </argument> - <argument index="1" name="from_line" type="int"> + <argument index="1" name="flags" type="int"> </argument> - <argument index="2" name="from_column" type="int"> + <argument index="2" name="from_line" type="int"> </argument> - <argument index="3" name="to_line" type="int"> + <argument index="3" name="from_column" type="int"> </argument> <description> Perform a search inside the text. Search flags can be specified in the SEARCH_* enum. </description> </method> <method name="select"> + <return type="void"> + </return> <argument index="0" name="from_line" type="int"> </argument> <argument index="1" name="from_column" type="int"> @@ -45614,11 +51324,15 @@ </description> </method> <method name="select_all"> + <return type="void"> + </return> <description> Select all the text. </description> </method> <method name="set_highlight_all_occurrences"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -45626,6 +51340,8 @@ </description> </method> <method name="set_max_chars"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> @@ -45633,6 +51349,8 @@ </description> </method> <method name="set_readonly"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -45640,13 +51358,25 @@ </description> </method> <method name="set_show_line_numbers"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> Set to enable showing line numbers. </description> </method> + <method name="set_smooth_scroll_enable"> + <return type="void"> + </return> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_syntax_coloring"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -45654,13 +51384,25 @@ </description> </method> <method name="set_text"> + <return type="void"> + </return> <argument index="0" name="text" type="String"> </argument> <description> Set the entire text. </description> </method> + <method name="set_v_scroll_speed"> + <return type="void"> + </return> + <argument index="0" name="speed" type="float"> + </argument> + <description> + </description> + </method> <method name="set_wrap"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -45668,6 +51410,8 @@ </description> </method> <method name="undo"> + <return type="void"> + </return> <description> Perform undo operation. </description> @@ -45684,8 +51428,12 @@ </member> <member name="show_line_numbers" type="bool" setter="set_show_line_numbers" getter="is_show_line_numbers_enabled" brief=""> </member> + <member name="smooth_scrolling" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled" brief=""> + </member> <member name="syntax_highlighting" type="bool" setter="set_syntax_coloring" getter="is_syntax_coloring_enabled" brief=""> </member> + <member name="v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed" brief=""> + </member> </members> <signals> <signal name="breakpoint_toggled"> @@ -45817,53 +51565,65 @@ </description> <methods> <method name="draw" qualifiers="const"> + <return type="void"> + </return> <argument index="0" name="canvas_item" type="RID"> </argument> <argument index="1" name="pos" type="Vector2"> </argument> - <argument index="2" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="2" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <argument index="3" name="transpose" type="bool" default="false"> </argument> - <argument index="4" name="normal_map" type="Texture" default="NULL"> + <argument index="4" name="normal_map" type="Texture" default="null"> </argument> <description> </description> </method> <method name="draw_rect" qualifiers="const"> + <return type="void"> + </return> <argument index="0" name="canvas_item" type="RID"> </argument> <argument index="1" name="rect" type="Rect2"> </argument> <argument index="2" name="tile" type="bool"> </argument> - <argument index="3" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> - <argument index="5" name="normal_map" type="Texture" default="NULL"> + <argument index="5" name="normal_map" type="Texture" default="null"> </argument> <description> </description> </method> <method name="draw_rect_region" qualifiers="const"> + <return type="void"> + </return> <argument index="0" name="canvas_item" type="RID"> </argument> <argument index="1" name="rect" type="Rect2"> </argument> <argument index="2" name="src_rect" type="Rect2"> </argument> - <argument index="3" name="modulate" type="Color" default="Color(1,1,1,1)"> + <argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )"> </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> - <argument index="5" name="normal_map" type="Texture" default="NULL"> + <argument index="5" name="normal_map" type="Texture" default="null"> </argument> <argument index="6" name="clip_uv" type="bool" default="true"> </argument> <description> </description> </method> + <method name="get_data" qualifiers="const"> + <return type="Image"> + </return> + <description> + </description> + </method> <method name="get_flags" qualifiers="const"> <return type="int"> </return> @@ -45899,6 +51659,8 @@ </description> </method> <method name="set_flags"> + <return type="void"> + </return> <argument index="0" name="flags" type="int"> </argument> <description> @@ -45982,55 +51744,71 @@ </description> </method> <method name="get_stretch_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="TextureButton.StretchMode"> </return> <description> </description> </method> <method name="set_click_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="BitMap"> </argument> <description> </description> </method> <method name="set_disabled_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_expand"> + <return type="void"> + </return> <argument index="0" name="p_expand" type="bool"> </argument> <description> </description> </method> <method name="set_focused_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_hover_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_normal_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_pressed_texture"> + <return type="void"> + </return> <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_stretch_mode"> - <argument index="0" name="p_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="p_mode" type="int" enum="TextureButton.StretchMode"> </argument> <description> </description> @@ -46039,7 +51817,7 @@ <members> <member name="expand" type="bool" setter="set_expand" getter="get_expand" brief=""> </member> - <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" brief=""> + <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" brief="" enum="TextureButton.StretchMode"> </member> <member name="texture_click_mask" type="BitMap" setter="set_click_mask" getter="get_click_mask" brief=""> </member> @@ -46091,7 +51869,7 @@ <description> </description> </method> - <method name="get_nine_patch_stretch"> + <method name="get_nine_patch_stretch" qualifiers="const"> <return type="bool"> </return> <description> @@ -46099,13 +51877,13 @@ </description> </method> <method name="get_over_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> </description> </method> <method name="get_progress_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> </description> @@ -46125,31 +51903,37 @@ <method name="get_stretch_margin" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="margin" type="int"> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> <description> Return nine-patch texture offset for a given margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). </description> </method> <method name="get_under_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> </description> </method> <method name="set_fill_degrees"> + <return type="void"> + </return> <argument index="0" name="mode" type="float"> </argument> <description> </description> </method> <method name="set_fill_mode"> + <return type="void"> + </return> <argument index="0" name="mode" type="int"> </argument> <description> </description> </method> <method name="set_nine_patch_stretch"> + <return type="void"> + </return> <argument index="0" name="stretch" type="bool"> </argument> <description> @@ -46157,40 +51941,52 @@ </description> </method> <method name="set_over_texture"> - <argument index="0" name="tex" type="Object"> + <return type="void"> + </return> + <argument index="0" name="tex" type="Texture"> </argument> <description> </description> </method> <method name="set_progress_texture"> - <argument index="0" name="tex" type="Object"> + <return type="void"> + </return> + <argument index="0" name="tex" type="Texture"> </argument> <description> </description> </method> <method name="set_radial_center_offset"> + <return type="void"> + </return> <argument index="0" name="mode" type="Vector2"> </argument> <description> </description> </method> <method name="set_radial_initial_angle"> + <return type="void"> + </return> <argument index="0" name="mode" type="float"> </argument> <description> </description> </method> <method name="set_stretch_margin"> - <argument index="0" name="margin" type="int"> + <return type="void"> + </return> + <argument index="0" name="margin" type="int" enum="Margin"> </argument> - <argument index="1" name="size" type="int"> + <argument index="1" name="value" type="int"> </argument> <description> Set nine-patch texture offset for a given margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). </description> </method> <method name="set_under_texture"> - <argument index="0" name="tex" type="Object"> + <return type="void"> + </return> + <argument index="0" name="tex" type="Texture"> </argument> <description> </description> @@ -46199,27 +51995,27 @@ <members> <member name="fill_mode" type="int" setter="set_fill_mode" getter="get_fill_mode" brief=""> </member> + <member name="nine_patch_stretch" type="bool" setter="set_nine_patch_stretch" getter="get_nine_patch_stretch" brief=""> + </member> <member name="radial_center_offset" type="Vector2" setter="set_radial_center_offset" getter="get_radial_center_offset" brief=""> </member> <member name="radial_fill_degrees" type="float" setter="set_fill_degrees" getter="get_fill_degrees" brief=""> </member> <member name="radial_initial_angle" type="float" setter="set_radial_initial_angle" getter="get_radial_initial_angle" brief=""> </member> - <member name="texture_over" type="Texture" setter="set_over_texture" getter="get_over_texture" brief=""> - </member> - <member name="texture_progress" type="Texture" setter="set_progress_texture" getter="get_progress_texture" brief=""> - </member> - <member name="texture_under" type="Texture" setter="set_under_texture" getter="get_under_texture" brief=""> - </member> - <member name="nine_patch_stretch" type="bool" setter="set_nine_patch_stretch" getter="get_nine_patch_stretch" brief=""> + <member name="stretch_margin_bottom" type="int" setter="set_stretch_margin" getter="get_stretch_margin" brief=""> </member> <member name="stretch_margin_left" type="int" setter="set_stretch_margin" getter="get_stretch_margin" brief=""> </member> + <member name="stretch_margin_right" type="int" setter="set_stretch_margin" getter="get_stretch_margin" brief=""> + </member> <member name="stretch_margin_top" type="int" setter="set_stretch_margin" getter="get_stretch_margin" brief=""> </member> - <member name="stretch_margin_right" type="int" setter="set_stretch_margin" getter="get_stretch_margin" brief=""> + <member name="texture_over" type="Texture" setter="set_over_texture" getter="get_over_texture" brief=""> </member> - <member name="stretch_margin_bottom" type="int" setter="set_stretch_margin" getter="get_stretch_margin" brief=""> + <member name="texture_progress" type="Texture" setter="set_progress_texture" getter="get_progress_texture" brief=""> + </member> + <member name="texture_under" type="Texture" setter="set_under_texture" getter="get_under_texture" brief=""> </member> </members> <constants> @@ -46239,20 +52035,20 @@ </class> <class name="TextureRect" inherits="Control" category="Core"> <brief_description> - Control Frame that draws a texture. + Control that draws a texture. </brief_description> <description> - Control frame that simply draws an assigned texture. It can stretch or not. It's a simple way to just show an image in a UI. + Control that draws a texture. </description> <methods> <method name="get_stretch_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="TextureRect.StretchMode"> </return> <description> </description> </method> <method name="get_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> </description> @@ -46264,19 +52060,25 @@ </description> </method> <method name="set_expand"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_stretch_mode"> - <argument index="0" name="stretch_mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="stretch_mode" type="int" enum="TextureRect.StretchMode"> </argument> <description> </description> </method> <method name="set_texture"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <description> </description> @@ -46284,10 +52086,13 @@ </methods> <members> <member name="expand" type="bool" setter="set_expand" getter="has_expand" brief=""> + If [code]true[/code] texture will expand to fit. Default value: [code]false[/code]. </member> - <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" brief=""> + <member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" brief="" enum="TextureRect.StretchMode"> + Stretch mode of the texture. Use STRETCH_* constants as value. </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> + The [Texture] resource for the node. </member> </members> <constants> @@ -46319,6 +52124,8 @@ </description> <methods> <method name="clear_color"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46327,6 +52134,8 @@ </description> </method> <method name="clear_constant"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46335,6 +52144,8 @@ </description> </method> <method name="clear_font"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46343,6 +52154,8 @@ </description> </method> <method name="clear_icon"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46351,6 +52164,8 @@ </description> </method> <method name="clear_stylebox"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46359,6 +52174,8 @@ </description> </method> <method name="copy_default_theme"> + <return type="void"> + </return> <description> </description> </method> @@ -46399,7 +52216,7 @@ </description> </method> <method name="get_default_font" qualifiers="const"> - <return type="Object"> + <return type="Font"> </return> <description> </description> @@ -46523,6 +52340,8 @@ </description> </method> <method name="set_color"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46533,6 +52352,8 @@ </description> </method> <method name="set_constant"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46543,12 +52364,16 @@ </description> </method> <method name="set_default_font"> - <argument index="0" name="font" type="Object"> + <return type="void"> + </return> + <argument index="0" name="font" type="Font"> </argument> <description> </description> </method> <method name="set_font"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46559,6 +52384,8 @@ </description> </method> <method name="set_icon"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46569,6 +52396,8 @@ </description> </method> <method name="set_stylebox"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="type" type="String"> @@ -46609,13 +52438,13 @@ </description> </method> <method name="start"> - <return type="Error"> + <return type="int" enum="Error"> </return> <argument index="0" name="instance" type="Object"> </argument> <argument index="1" name="method" type="String"> </argument> - <argument index="2" name="userdata" type="Variant" default="NULL"> + <argument index="2" name="userdata" type="Variant" default="null"> </argument> <argument index="3" name="priority" type="int" default="1"> </argument> @@ -46643,14 +52472,15 @@ </class> <class name="TileMap" inherits="Node2D" category="Core"> <brief_description> - Node for 2D tile-based games. + Node for 2D tile-based maps. </brief_description> <description> - Node for 2D tile-based games. Tilemaps use a [TileSet] which contain a list of tiles (textures, their rect and a collision) and are used to create complex grid-based maps. - To optimize drawing and culling (sort of like [GridMap]), you can specify a quadrant size, so chunks of the map will be batched together at drawing time. + Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps. </description> <methods> <method name="clear"> + <return type="void"> + </return> <description> Clear all cells. </description> @@ -46755,14 +52585,14 @@ </description> </method> <method name="get_half_offset" qualifiers="const"> - <return type="int"> + <return type="int" enum="TileMap.HalfOffset"> </return> <description> Return the current half offset configuration. </description> </method> <method name="get_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="TileMap.Mode"> </return> <description> Return the orientation mode. @@ -46782,7 +52612,7 @@ </description> </method> <method name="get_tile_origin" qualifiers="const"> - <return type="int"> + <return type="int" enum="TileMap.TileOrigin"> </return> <description> Return the tile origin configuration. @@ -46802,6 +52632,14 @@ Return an array of all cells containing a tile from the tileset (i.e. a tile index different from -1). </description> </method> + <method name="get_used_cells_by_id" qualifiers="const"> + <return type="Array"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> <method name="get_used_rect"> <return type="Rect2"> </return> @@ -46861,6 +52699,8 @@ </description> </method> <method name="set_cell"> + <return type="void"> + </return> <argument index="0" name="x" type="int"> </argument> <argument index="1" name="y" type="int"> @@ -46880,6 +52720,8 @@ </description> </method> <method name="set_cell_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> @@ -46887,6 +52729,8 @@ </description> </method> <method name="set_cellv"> + <return type="void"> + </return> <argument index="0" name="pos" type="Vector2"> </argument> <argument index="1" name="tile" type="int"> @@ -46904,6 +52748,8 @@ </description> </method> <method name="set_center_x"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -46911,6 +52757,8 @@ </description> </method> <method name="set_center_y"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -46918,6 +52766,8 @@ </description> </method> <method name="set_collision_bounce"> + <return type="void"> + </return> <argument index="0" name="value" type="float"> </argument> <description> @@ -46925,6 +52775,8 @@ </description> </method> <method name="set_collision_friction"> + <return type="void"> + </return> <argument index="0" name="value" type="float"> </argument> <description> @@ -46932,6 +52784,8 @@ </description> </method> <method name="set_collision_layer"> + <return type="void"> + </return> <argument index="0" name="layer" type="int"> </argument> <description> @@ -46940,6 +52794,8 @@ </description> </method> <method name="set_collision_layer_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -46948,6 +52804,8 @@ </description> </method> <method name="set_collision_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> @@ -46956,6 +52814,8 @@ </description> </method> <method name="set_collision_mask_bit"> + <return type="void"> + </return> <argument index="0" name="bit" type="int"> </argument> <argument index="1" name="value" type="bool"> @@ -46964,6 +52824,8 @@ </description> </method> <method name="set_collision_use_kinematic"> + <return type="void"> + </return> <argument index="0" name="use_kinematic" type="bool"> </argument> <description> @@ -46971,6 +52833,8 @@ </description> </method> <method name="set_custom_transform"> + <return type="void"> + </return> <argument index="0" name="custom_transform" type="Transform2D"> </argument> <description> @@ -46978,27 +52842,35 @@ </description> </method> <method name="set_half_offset"> - <argument index="0" name="half_offset" type="int"> + <return type="void"> + </return> + <argument index="0" name="half_offset" type="int" enum="TileMap.HalfOffset"> </argument> <description> - Set an half offset on the X coordinate, Y coordinate, or none (use HALF_OFFSET_* constants as argument). + Set a half offset on the X coordinate, Y coordinate, or none (use HALF_OFFSET_* constants as argument). Half offset sets every other tile off by a half tile size in the specified direction. </description> </method> <method name="set_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="TileMap.Mode"> </argument> <description> Set the orientation mode as square, isometric or custom (use MODE_* constants as argument). </description> </method> <method name="set_occluder_light_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> </description> </method> <method name="set_quadrant_size"> + <return type="void"> + </return> <argument index="0" name="size" type="int"> </argument> <description> @@ -47007,13 +52879,17 @@ </description> </method> <method name="set_tile_origin"> - <argument index="0" name="origin" type="int"> + <return type="void"> + </return> + <argument index="0" name="origin" type="int" enum="TileMap.TileOrigin"> </argument> <description> Set the tile origin to the tile center or its top-left corner (use TILE_ORIGIN_* constants as argument). </description> </method> <method name="set_tileset"> + <return type="void"> + </return> <argument index="0" name="tileset" type="TileSet"> </argument> <description> @@ -47021,6 +52897,8 @@ </description> </method> <method name="set_y_sort_mode"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -47040,45 +52918,60 @@ </methods> <members> <member name="cell_custom_transform" type="Transform2D" setter="set_custom_transform" getter="get_custom_transform" brief=""> + The custom [Transform2D] to be applied to the TileMap's cells. </member> - <member name="cell_half_offset" type="int" setter="set_half_offset" getter="get_half_offset" brief=""> + <member name="cell_half_offset" type="int" setter="set_half_offset" getter="get_half_offset" brief="" enum="TileMap.HalfOffset"> + Amount to offset alternating tiles. Uses HALF_OFFSET_* constants. Default value: HALF_OFFSET_DISABLED. </member> <member name="cell_quadrant_size" type="int" setter="set_quadrant_size" getter="get_quadrant_size" brief=""> + The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. Default value: 16. </member> <member name="cell_size" type="Vector2" setter="set_cell_size" getter="get_cell_size" brief=""> + The TileMap's cell size. </member> - <member name="cell_tile_origin" type="int" setter="set_tile_origin" getter="get_tile_origin" brief=""> + <member name="cell_tile_origin" type="int" setter="set_tile_origin" getter="get_tile_origin" brief="" enum="TileMap.TileOrigin"> + Position for tile origin. Uses TILE_ORIGIN_* constants. Default value: TILE_ORIGIN_TOP_LEFT. </member> <member name="cell_y_sort" type="bool" setter="set_y_sort_mode" getter="is_y_sort_mode_enabled" brief=""> + If [code]true[/code] the TileMap's children will be drawn in order of their Y coordinate. Default value: [code]false[/code]. </member> <member name="collision_bounce" type="float" setter="set_collision_bounce" getter="get_collision_bounce" brief=""> + Bounce value for static body collisions (see [code]collision_use_kinematic[/code]). Default value: 0. </member> <member name="collision_friction" type="float" setter="set_collision_friction" getter="get_collision_friction" brief=""> + Friction value for static body collisions (see [code]collision_use_kinematic[/code]). Default value: 1. </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> + The collision layer(s) for all colliders in the TileMap. </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief=""> + The collision mask(s) for all colliders in the TileMap. </member> <member name="collision_use_kinematic" type="bool" setter="set_collision_use_kinematic" getter="get_collision_use_kinematic" brief=""> + If [code]true[/code] TileMap collisions will be handled as a kinematic body. If [code]false[/code] collisions will be handled as static body. Default value: [code]false[/code]. </member> - <member name="mode" type="int" setter="set_mode" getter="get_mode" brief=""> + <member name="mode" type="int" setter="set_mode" getter="get_mode" brief="" enum="TileMap.Mode"> + The TileMap orientation mode. Uses MODE_* constants. Default value: MODE_SQUARE. </member> <member name="occluder_light_mask" type="int" setter="set_occluder_light_mask" getter="get_occluder_light_mask" brief=""> + The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s). </member> - <member name="tile_data" type="Object" setter="_set_tile_data" getter="_get_tile_data" brief=""> + <member name="tile_data" type="PoolIntArray" setter="_set_tile_data" getter="_get_tile_data" brief=""> + A [PoolIntArray] containing </member> <member name="tile_set" type="TileSet" setter="set_tileset" getter="get_tileset" brief=""> + The assigned [TileSet]. </member> </members> <signals> <signal name="settings_changed"> <description> - Signal indicating that a tilemap setting has changed. + Emitted when a tilemap setting has changed. </description> </signal> </signals> <constants> - <constant name="INVALID_CELL" value="-1"> + <constant name="INVALID_CELL" value="-1" enum=""> Returned when a cell doesn't exist. </constant> <constant name="MODE_SQUARE" value="0"> @@ -47119,11 +53012,15 @@ </description> <methods> <method name="clear"> + <return type="void"> + </return> <description> Clear all tiles. </description> </method> <method name="create_tile"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> @@ -47154,6 +53051,8 @@ </description> </method> <method name="remove_tile"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <description> @@ -47161,6 +53060,8 @@ </description> </method> <method name="tile_add_shape"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="shape" type="Shape2D"> @@ -47309,6 +53210,8 @@ </description> </method> <method name="tile_set_light_occluder"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="light_occluder" type="OccluderPolygon2D"> @@ -47318,6 +53221,8 @@ </description> </method> <method name="tile_set_material"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="material" type="ShaderMaterial"> @@ -47327,6 +53232,8 @@ </description> </method> <method name="tile_set_name"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="name" type="String"> @@ -47336,6 +53243,8 @@ </description> </method> <method name="tile_set_navigation_polygon"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="navigation_polygon" type="NavigationPolygon"> @@ -47345,6 +53254,8 @@ </description> </method> <method name="tile_set_navigation_polygon_offset"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="navigation_polygon_offset" type="Vector2"> @@ -47354,6 +53265,8 @@ </description> </method> <method name="tile_set_normal_map"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="normal_map" type="Texture"> @@ -47362,6 +53275,8 @@ </description> </method> <method name="tile_set_occluder_offset"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="occluder_offset" type="Vector2"> @@ -47371,6 +53286,8 @@ </description> </method> <method name="tile_set_region"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="region" type="Rect2"> @@ -47380,6 +53297,8 @@ </description> </method> <method name="tile_set_shape"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="shape_id" type="int"> @@ -47390,6 +53309,8 @@ </description> </method> <method name="tile_set_shape_one_way"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="shape_id" type="int"> @@ -47400,6 +53321,8 @@ </description> </method> <method name="tile_set_shape_transform"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="shape_id" type="int"> @@ -47410,6 +53333,8 @@ </description> </method> <method name="tile_set_shapes"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="shapes" type="Array"> @@ -47419,6 +53344,8 @@ </description> </method> <method name="tile_set_texture"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="texture" type="Texture"> @@ -47428,6 +53355,8 @@ </description> </method> <method name="tile_set_texture_offset"> + <return type="void"> + </return> <argument index="0" name="id" type="int"> </argument> <argument index="1" name="texture_offset" type="Vector2"> @@ -47442,10 +53371,10 @@ </class> <class name="Timer" inherits="Node" category="Core"> <brief_description> - A simple Timer node. + A countdown timer. </brief_description> <description> - Timer node. This is a simple node that will emit a timeout callback when the timer runs out. It can optionally be set to loop. + Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one shot" mode. </description> <methods> <method name="get_time_left" qualifiers="const"> @@ -47456,7 +53385,7 @@ </description> </method> <method name="get_timer_process_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Timer.TimerProcessMode"> </return> <description> Return the timer's processing mode. @@ -47497,6 +53426,8 @@ </description> </method> <method name="set_autostart"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -47504,6 +53435,8 @@ </description> </method> <method name="set_one_shot"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -47511,6 +53444,8 @@ </description> </method> <method name="set_paused"> + <return type="void"> + </return> <argument index="0" name="paused" type="bool"> </argument> <description> @@ -47518,13 +53453,17 @@ </description> </method> <method name="set_timer_process_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Timer.TimerProcessMode"> </argument> <description> Set the timer's processing mode (fixed or idle, use TIMER_PROCESS_* constants as argument). </description> </method> <method name="set_wait_time"> + <return type="void"> + </return> <argument index="0" name="time_sec" type="float"> </argument> <description> @@ -47532,46 +53471,61 @@ </description> </method> <method name="start"> + <return type="void"> + </return> <description> - Start the timer. + Start the Timer. </description> </method> <method name="stop"> + <return type="void"> + </return> <description> - Stop (cancel) the timer. + Stop (cancel) the Timer. </description> </method> </methods> <members> <member name="autostart" type="bool" setter="set_autostart" getter="has_autostart" brief=""> + If [code]true[/code], Timer will automatically start when entering the scene tree. Default value: [code]false[/code]. </member> <member name="one_shot" type="bool" setter="set_one_shot" getter="is_one_shot" brief=""> + If [code]true[/code], Timer will stop when reaching 0. If [code]false[/code], it will restart. Default value: [code]false[/code]. </member> - <member name="process_mode" type="int" setter="set_timer_process_mode" getter="get_timer_process_mode" brief=""> + <member name="process_mode" type="int" setter="set_timer_process_mode" getter="get_timer_process_mode" brief="" enum="Timer.TimerProcessMode"> + Processing mode. Uses TIMER_PROCESS_* constants as value. </member> <member name="wait_time" type="float" setter="set_wait_time" getter="get_wait_time" brief=""> + Wait time in seconds. </member> </members> <signals> <signal name="timeout"> <description> - Emitted when the time runs out. + Emitted when the Timer reaches 0. </description> </signal> </signals> <constants> <constant name="TIMER_PROCESS_FIXED" value="0"> - Update the timer at fixed intervals (framerate processing). + Update the Timer at fixed intervals (framerate processing). </constant> <constant name="TIMER_PROCESS_IDLE" value="1"> - Update the timer during the idle time at each frame. + Update the Timer during the idle time at each frame. </constant> </constants> </class> <class name="ToolButton" inherits="Button" category="Core"> <brief_description> + Flat button helper class. </brief_description> <description> + This is a helper class to generate a flat [Button] (see [method Button.set_flat]), creating a ToolButton is equivalent to: + + [codeblock] + var btn = Button.new() + btn.set_flat(true) + [/codeblock] </description> <methods> </methods> @@ -47615,31 +53569,31 @@ </description> </method> <method name="get_bitmask" qualifiers="const"> - <return type="Object"> + <return type="BitMap"> </return> <description> </description> </method> <method name="get_shape" qualifiers="const"> - <return type="Object"> + <return type="Shape2D"> </return> <description> </description> </method> <method name="get_texture" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> </description> </method> <method name="get_texture_pressed" qualifiers="const"> - <return type="Object"> + <return type="Texture"> </return> <description> </description> </method> <method name="get_visibility_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="TouchScreenButton.VisibilityMode"> </return> <description> </description> @@ -47669,55 +53623,73 @@ </description> </method> <method name="set_action"> + <return type="void"> + </return> <argument index="0" name="action" type="String"> </argument> <description> </description> </method> <method name="set_bitmask"> - <argument index="0" name="bitmask" type="Object"> + <return type="void"> + </return> + <argument index="0" name="bitmask" type="BitMap"> </argument> <description> </description> </method> <method name="set_passby_press"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> </description> </method> <method name="set_shape"> - <argument index="0" name="shape" type="Object"> + <return type="void"> + </return> + <argument index="0" name="shape" type="Shape2D"> </argument> <description> </description> </method> <method name="set_shape_centered"> + <return type="void"> + </return> <argument index="0" name="bool" type="bool"> </argument> <description> </description> </method> <method name="set_shape_visible"> + <return type="void"> + </return> <argument index="0" name="bool" type="bool"> </argument> <description> </description> </method> <method name="set_texture"> - <argument index="0" name="texture" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> <method name="set_texture_pressed"> - <argument index="0" name="texture_pressed" type="Object"> + <return type="void"> + </return> + <argument index="0" name="texture_pressed" type="Texture"> </argument> <description> </description> </method> <method name="set_visibility_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="TouchScreenButton.VisibilityMode"> </argument> <description> </description> @@ -47740,7 +53712,7 @@ </member> <member name="shape_visible" type="bool" setter="set_shape_visible" getter="is_shape_visible" brief=""> </member> - <member name="visibility_mode" type="int" setter="set_visibility_mode" getter="get_visibility_mode" brief=""> + <member name="visibility_mode" type="int" setter="set_visibility_mode" getter="get_visibility_mode" brief="" enum="TouchScreenButton.VisibilityMode"> </member> </members> <signals> @@ -47758,10 +53730,10 @@ </class> <class name="Transform" category="Built-In Types"> <brief_description> - 3D Transformation. + 3D Transformation. 3x4 matrix. </brief_description> <description> - Transform is used to store translation, rotation and scaling transformations. It consists of a Basis "basis" and Vector3 "origin". Transform is used to represent transformations of objects in space, and as such, determine their position, orientation and scale. It is similar to a 3x4 matrix. + Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a [Basis] "basis" and an [Vector3] "origin". It is similar to a 3x4 matrix. </description> <methods> <method name="Transform"> @@ -47776,7 +53748,7 @@ <argument index="3" name="origin" type="Vector3"> </argument> <description> - Construct the Transform from four Vector3. Each axis corresponds to local basis vectors (some of which may be scaled). + Construct the Transform from four [Vector3]. Each axis corresponds to local basis vectors (some of which may be scaled). </description> </method> <method name="Transform"> @@ -47787,7 +53759,7 @@ <argument index="1" name="origin" type="Vector3"> </argument> <description> - Construct the Transform from a Basis and Vector3. + Construct the Transform from a [Basis] and [Vector3]. </description> </method> <method name="Transform"> @@ -47796,7 +53768,7 @@ <argument index="0" name="from" type="Transform2D"> </argument> <description> - Construct the Transform from a Transform2D. + Construct the Transform from a [Transform2D]. </description> </method> <method name="Transform"> @@ -47805,7 +53777,7 @@ <argument index="0" name="from" type="Quat"> </argument> <description> - Construct the Transform from a Quat. The origin will be Vector3(0, 0, 0). + Construct the Transform from a [Quat]. The origin will be Vector3(0, 0, 0). </description> </method> <method name="Transform"> @@ -47814,7 +53786,7 @@ <argument index="0" name="from" type="Basis"> </argument> <description> - Construct the Transform from a Basis. The origin will be Vector3(0, 0, 0). + Construct the Transform from a [Basis]. The origin will be Vector3(0, 0, 0). </description> </method> <method name="affine_inverse"> @@ -47824,11 +53796,22 @@ Returns the inverse of the transfrom, under the assumption that the transformation is composed of rotation, scaling and translation. </description> </method> + <method name="interpolate_with"> + <return type="Transform"> + </return> + <argument index="0" name="transform" type="Transform"> + </argument> + <argument index="1" name="weight" type="float"> + </argument> + <description> + Interpolate to other Transform by weight amount (0-1). + </description> + </method> <method name="inverse"> <return type="Transform"> </return> <description> - Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling). + Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling). </description> </method> <method name="looking_at"> @@ -47875,7 +53858,7 @@ <argument index="0" name="ofs" type="Vector3"> </argument> <description> - Translate the transform by the specified displacement. + Translate the transform by the specified offset. </description> </method> <method name="xform"> @@ -47899,10 +53882,10 @@ </methods> <members> <member name="basis" type="Basis" setter="" getter="" brief=""> - The basis is a matrix containing 3 [Vector3] as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system travelling with the object. + The basis is a matrix containing 3 [Vector3] as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object. </member> <member name="origin" type="Vector3" setter="" getter="" brief=""> - The origin of the transform. Which is the translation offset. + The translation offset of the transform. </member> </members> <constants> @@ -47910,10 +53893,10 @@ </class> <class name="Transform2D" category="Built-In Types"> <brief_description> - 3x2 Matrix for 2D transforms. + 2D Transformation. 3x2 matrix. </brief_description> <description> - 3x2 Matrix for 2D transforms. + Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a two [Vector2] x, y and [Vector2] "origin". It is similar to a 3x2 matrix. </description> <methods> <method name="Transform2D"> @@ -47922,6 +53905,7 @@ <argument index="0" name="from" type="Transform"> </argument> <description> + Constructs the [Transform2D] from a 3D [Transform]. </description> </method> <method name="Transform2D"> @@ -47934,6 +53918,7 @@ <argument index="2" name="origin" type="Vector2"> </argument> <description> + Constructs the [Transform2D] from 3 [Vector2] consisting of rows x, y and origin. </description> </method> <method name="Transform2D"> @@ -47944,13 +53929,14 @@ <argument index="1" name="pos" type="Vector2"> </argument> <description> + Constructs the [Transform2D] from rotation angle in radians and position [Vector2]. </description> </method> <method name="affine_inverse"> <return type="Transform2D"> </return> <description> - Return the inverse of the matrix. + Returns the inverse of the matrix. </description> </method> <method name="basis_xform"> @@ -47959,6 +53945,7 @@ <argument index="0" name="v" type="var"> </argument> <description> + Transforms the given vector "v" by this transform basis (no translation). </description> </method> <method name="basis_xform_inv"> @@ -47967,12 +53954,14 @@ <argument index="0" name="v" type="var"> </argument> <description> + Inverse-transforms vector "v" by this transform basis (no translation). </description> </method> <method name="get_origin"> <return type="Vector2"> </return> <description> + Return the origin [Vector2] (translation). </description> </method> <method name="get_rotation"> @@ -47986,28 +53975,32 @@ <return type="Vector2"> </return> <description> + Return the scale. </description> </method> <method name="interpolate_with"> <return type="Transform2D"> </return> - <argument index="0" name="m" type="Transform2D"> + <argument index="0" name="transform" type="Transform2D"> </argument> - <argument index="1" name="c" type="float"> + <argument index="1" name="weight" type="float"> </argument> <description> + Interpolate to other Transform2D by weight amount (0-1). </description> </method> <method name="inverse"> <return type="Transform2D"> </return> <description> + Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling). </description> </method> <method name="orthonormalized"> <return type="Transform2D"> </return> <description> + Returns a transfrom with the basis orthogonal (90 degrees), and normalized axis vectors. </description> </method> <method name="rotated"> @@ -48016,6 +54009,7 @@ <argument index="0" name="phi" type="float"> </argument> <description> + Rotate the transform by phi. </description> </method> <method name="scaled"> @@ -48024,6 +54018,7 @@ <argument index="0" name="scale" type="Vector2"> </argument> <description> + Scale the transform by the specified 2D scaling factors. </description> </method> <method name="translated"> @@ -48032,6 +54027,7 @@ <argument index="0" name="offset" type="Vector2"> </argument> <description> + Translate the transform by the specified offset. </description> </method> <method name="xform"> @@ -48040,6 +54036,7 @@ <argument index="0" name="v" type="var"> </argument> <description> + Transforms the given vector "v" by this transform. </description> </method> <method name="xform_inv"> @@ -48048,15 +54045,19 @@ <argument index="0" name="v" type="var"> </argument> <description> + Inverse-transforms the given vector "v" by this transform. </description> </method> </methods> <members> <member name="origin" type="Vector2" setter="" getter="" brief=""> + The translation offset of the transform. </member> <member name="x" type="Vector2" setter="" getter="" brief=""> + The X axis of 2x2 basis matrix containing 2 [Vector2] as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object. </member> <member name="y" type="Vector2" setter="" getter="" brief=""> + The Y axis of 2x2 basis matrix containing 2 [Vector2] as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object. </member> </members> <constants> @@ -48071,6 +54072,8 @@ </description> <methods> <method name="add_message"> + <return type="void"> + </return> <argument index="0" name="src_message" type="String"> </argument> <argument index="1" name="xlated_message" type="String"> @@ -48080,6 +54083,8 @@ </description> </method> <method name="erase_message"> + <return type="void"> + </return> <argument index="0" name="src_message" type="String"> </argument> <description> @@ -48116,6 +54121,8 @@ </description> </method> <method name="set_locale"> + <return type="void"> + </return> <argument index="0" name="locale" type="String"> </argument> <description> @@ -48140,12 +54147,16 @@ </description> <methods> <method name="add_translation"> + <return type="void"> + </return> <argument index="0" name="translation" type="Translation"> </argument> <description> </description> </method> <method name="clear"> + <return type="void"> + </return> <description> </description> </method> @@ -48156,12 +54167,16 @@ </description> </method> <method name="remove_translation"> + <return type="void"> + </return> <argument index="0" name="translation" type="Translation"> </argument> <description> </description> </method> <method name="set_locale"> + <return type="void"> + </return> <argument index="0" name="locale" type="String"> </argument> <description> @@ -48206,24 +54221,34 @@ </description> </method> <method name="clear"> + <return type="void"> + </return> <description> Clear the tree. This erases all of the items. </description> </method> <method name="create_item"> - <return type="TreeItem"> + <return type="Object"> </return> - <argument index="0" name="parent" type="TreeItem" default="NULL"> + <argument index="0" name="parent" type="Object" default="null"> </argument> <description> Create an item in the tree and add it as the last child of [code]parent[/code]. If parent is not given, it will be added as the last child of the root, or it'll the be the root itself if the tree is empty. </description> </method> <method name="ensure_cursor_is_visible"> + <return type="void"> + </return> <description> Make the current selected item visible. This will scroll the tree to make sure the selected item is in sight. </description> </method> + <method name="get_allow_reselect" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="get_allow_rmb_select" qualifiers="const"> <return type="bool"> </return> @@ -48296,7 +54321,7 @@ <method name="get_item_area_rect" qualifiers="const"> <return type="Rect2"> </return> - <argument index="0" name="item" type="TreeItem"> + <argument index="0" name="item" type="Object"> </argument> <argument index="1" name="column" type="int" default="-1"> </argument> @@ -48316,7 +54341,7 @@ <method name="get_next_selected"> <return type="TreeItem"> </return> - <argument index="0" name="from" type="TreeItem"> + <argument index="0" name="from" type="Object"> </argument> <description> Get the next selected item after the given one. @@ -48357,21 +54382,24 @@ Get the column number of the current selection. </description> </method> - <method name="get_single_select_cell_editing_only_when_already_selected" qualifiers="const"> + <method name="is_folding_hidden" qualifiers="const"> <return type="bool"> </return> <description> - Get whether the editing of a cell should only happen when it is already selected. + Get whether the folding arrow is hidden. </description> </method> - <method name="is_folding_hidden" qualifiers="const"> - <return type="bool"> + <method name="set_allow_reselect"> + <return type="void"> </return> + <argument index="0" name="allow" type="bool"> + </argument> <description> - Get whether the folding arrow is hidden. </description> </method> <method name="set_allow_rmb_select"> + <return type="void"> + </return> <argument index="0" name="allow" type="bool"> </argument> <description> @@ -48379,6 +54407,8 @@ </description> </method> <method name="set_column_expand"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="expand" type="bool"> @@ -48388,6 +54418,8 @@ </description> </method> <method name="set_column_min_width"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="min_width" type="int"> @@ -48397,6 +54429,8 @@ </description> </method> <method name="set_column_title"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="title" type="String"> @@ -48406,6 +54440,8 @@ </description> </method> <method name="set_column_titles_visible"> + <return type="void"> + </return> <argument index="0" name="visible" type="bool"> </argument> <description> @@ -48413,6 +54449,8 @@ </description> </method> <method name="set_columns"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> @@ -48420,6 +54458,8 @@ </description> </method> <method name="set_drop_mode_flags"> + <return type="void"> + </return> <argument index="0" name="flags" type="int"> </argument> <description> @@ -48427,6 +54467,8 @@ </description> </method> <method name="set_hide_folding"> + <return type="void"> + </return> <argument index="0" name="hide" type="bool"> </argument> <description> @@ -48434,6 +54476,8 @@ </description> </method> <method name="set_hide_root"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -48441,19 +54485,14 @@ </description> </method> <method name="set_select_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Tree.SelectMode"> </argument> <description> Set the selection mode. Use one of the [code]SELECT_*[/code] constants. </description> </method> - <method name="set_single_select_cell_editing_only_when_already_selected"> - <argument index="0" name="enable" type="bool"> - </argument> - <description> - Set whether the editing of a cell should only happen when it is already selected. - </description> - </method> </methods> <signals> <signal name="button_pressed"> @@ -48517,6 +54556,10 @@ Emitted when an item is editted. </description> </signal> + <signal name="item_rmb_edited"> + <description> + </description> + </signal> <signal name="item_rmb_selected"> <argument index="0" name="pos" type="Vector2"> </argument> @@ -48640,6 +54683,8 @@ </description> <methods> <method name="add_button"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="button" type="Texture"> @@ -48654,24 +54699,32 @@ </description> </method> <method name="clear_custom_bg_color"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <description> </description> </method> <method name="clear_custom_color"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <description> </description> </method> <method name="deselect"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <description> </description> </method> <method name="erase_button"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="button_idx" type="int"> @@ -48698,7 +54751,7 @@ </description> </method> <method name="get_cell_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="TreeItem.TreeCellMode"> </return> <argument index="0" name="column" type="int"> </argument> @@ -48752,6 +54805,8 @@ </description> </method> <method name="get_metadata" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="column" type="int"> </argument> <description> @@ -48812,7 +54867,7 @@ </description> </method> <method name="get_text_align" qualifiers="const"> - <return type="int"> + <return type="int" enum="TreeItem.TextAlign"> </return> <argument index="0" name="column" type="int"> </argument> @@ -48890,15 +54945,19 @@ </description> </method> <method name="move_to_bottom"> + <return type="void"> + </return> <description> </description> </method> <method name="move_to_top"> + <return type="void"> + </return> <description> </description> </method> <method name="remove_child"> - <return type="TreeItem"> + <return type="void"> </return> <argument index="0" name="child" type="Object"> </argument> @@ -48906,12 +54965,16 @@ </description> </method> <method name="select"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <description> </description> </method> <method name="set_button"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="button_idx" type="int"> @@ -48922,14 +54985,18 @@ </description> </method> <method name="set_cell_mode"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> - <argument index="1" name="mode" type="int"> + <argument index="1" name="mode" type="int" enum="TreeItem.TreeCellMode"> </argument> <description> </description> </method> <method name="set_checked"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="checked" type="bool"> @@ -48938,12 +55005,16 @@ </description> </method> <method name="set_collapsed"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_custom_as_button"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="enable" type="bool"> @@ -48952,6 +55023,8 @@ </description> </method> <method name="set_custom_bg_color"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="color" type="Color"> @@ -48962,6 +55035,8 @@ </description> </method> <method name="set_custom_color"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="color" type="Color"> @@ -48970,6 +55045,8 @@ </description> </method> <method name="set_custom_draw"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="object" type="Object"> @@ -48980,12 +55057,16 @@ </description> </method> <method name="set_disable_folding"> + <return type="void"> + </return> <argument index="0" name="disable" type="bool"> </argument> <description> </description> </method> <method name="set_editable"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="enabled" type="bool"> @@ -48994,6 +55075,8 @@ </description> </method> <method name="set_expand_right"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="enable" type="bool"> @@ -49002,6 +55085,8 @@ </description> </method> <method name="set_icon"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="texture" type="Texture"> @@ -49010,6 +55095,8 @@ </description> </method> <method name="set_icon_max_width"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="width" type="int"> @@ -49018,6 +55105,8 @@ </description> </method> <method name="set_icon_region"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="region" type="Rect2"> @@ -49026,6 +55115,8 @@ </description> </method> <method name="set_metadata"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="meta" type="Variant"> @@ -49034,6 +55125,8 @@ </description> </method> <method name="set_range"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="value" type="float"> @@ -49042,6 +55135,8 @@ </description> </method> <method name="set_range_config"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="min" type="float"> @@ -49056,6 +55151,8 @@ </description> </method> <method name="set_selectable"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="selectable" type="bool"> @@ -49064,6 +55161,8 @@ </description> </method> <method name="set_text"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="text" type="String"> @@ -49072,14 +55171,18 @@ </description> </method> <method name="set_text_align"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> - <argument index="1" name="text_align" type="int"> + <argument index="1" name="text_align" type="int" enum="TreeItem.TextAlign"> </argument> <description> </description> </method> <method name="set_tooltip"> + <return type="void"> + </return> <argument index="0" name="column" type="int"> </argument> <argument index="1" name="tooltip" type="String"> @@ -49144,9 +55247,9 @@ </argument> <argument index="5" name="duration" type="float"> </argument> - <argument index="6" name="trans_type" type="int"> + <argument index="6" name="trans_type" type="int" enum="Tween.TransitionType"> </argument> - <argument index="7" name="ease_type" type="int"> + <argument index="7" name="ease_type" type="int" enum="Tween.EaseType"> </argument> <argument index="8" name="delay" type="float" default="0"> </argument> @@ -49170,9 +55273,9 @@ </argument> <argument index="5" name="duration" type="float"> </argument> - <argument index="6" name="trans_type" type="int"> + <argument index="6" name="trans_type" type="int" enum="Tween.TransitionType"> </argument> - <argument index="7" name="ease_type" type="int"> + <argument index="7" name="ease_type" type="int" enum="Tween.EaseType"> </argument> <argument index="8" name="delay" type="float" default="0"> </argument> @@ -49196,7 +55299,7 @@ </description> </method> <method name="get_tween_process_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Tween.TweenProcessMode"> </return> <description> Returns the process mode that has been set from editor GUI or [method set_tween_process_mode] @@ -49211,15 +55314,15 @@ </argument> <argument index="2" name="callback" type="String"> </argument> - <argument index="3" name="arg1" type="Variant" default="NULL"> + <argument index="3" name="arg1" type="Variant" default="null"> </argument> - <argument index="4" name="arg2" type="Variant" default="NULL"> + <argument index="4" name="arg2" type="Variant" default="null"> </argument> - <argument index="5" name="arg3" type="Variant" default="NULL"> + <argument index="5" name="arg3" type="Variant" default="null"> </argument> - <argument index="6" name="arg4" type="Variant" default="NULL"> + <argument index="6" name="arg4" type="Variant" default="null"> </argument> - <argument index="7" name="arg5" type="Variant" default="NULL"> + <argument index="7" name="arg5" type="Variant" default="null"> </argument> <description> Call [code]callback[/code] of [code]object[/code] after [code]duration[/code]. [code]arg1[/code]-[code]arg5[/code] are arguments to be passed to the callback. @@ -49234,15 +55337,15 @@ </argument> <argument index="2" name="callback" type="String"> </argument> - <argument index="3" name="arg1" type="Variant" default="NULL"> + <argument index="3" name="arg1" type="Variant" default="null"> </argument> - <argument index="4" name="arg2" type="Variant" default="NULL"> + <argument index="4" name="arg2" type="Variant" default="null"> </argument> - <argument index="5" name="arg3" type="Variant" default="NULL"> + <argument index="5" name="arg3" type="Variant" default="null"> </argument> - <argument index="6" name="arg4" type="Variant" default="NULL"> + <argument index="6" name="arg4" type="Variant" default="null"> </argument> - <argument index="7" name="arg5" type="Variant" default="NULL"> + <argument index="7" name="arg5" type="Variant" default="null"> </argument> <description> Call [code]callback[/code] of [code]object[/code] after [code]duration[/code] on the main thread (similar to [methog Object.call_deferred). [code]arg1[/code]-[code]arg5[/code] are arguments to be passed to the callback. @@ -49261,9 +55364,9 @@ </argument> <argument index="4" name="duration" type="float"> </argument> - <argument index="5" name="trans_type" type="int"> + <argument index="5" name="trans_type" type="int" enum="Tween.TransitionType"> </argument> - <argument index="6" name="ease_type" type="int"> + <argument index="6" name="ease_type" type="int" enum="Tween.EaseType"> </argument> <argument index="7" name="delay" type="float" default="0"> </argument> @@ -49285,9 +55388,9 @@ </argument> <argument index="4" name="duration" type="float"> </argument> - <argument index="5" name="trans_type" type="int"> + <argument index="5" name="trans_type" type="int" enum="Tween.TransitionType"> </argument> - <argument index="6" name="ease_type" type="int"> + <argument index="6" name="ease_type" type="int" enum="Tween.EaseType"> </argument> <argument index="7" name="delay" type="float" default="0"> </argument> @@ -49374,6 +55477,8 @@ </description> </method> <method name="set_active"> + <return type="void"> + </return> <argument index="0" name="active" type="bool"> </argument> <description> @@ -49381,6 +55486,8 @@ </description> </method> <method name="set_repeat"> + <return type="void"> + </return> <argument index="0" name="repeat" type="bool"> </argument> <description> @@ -49388,6 +55495,8 @@ </description> </method> <method name="set_speed_scale"> + <return type="void"> + </return> <argument index="0" name="speed" type="float"> </argument> <description> @@ -49395,7 +55504,9 @@ </description> </method> <method name="set_tween_process_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Tween.TweenProcessMode"> </argument> <description> Set whether the Tween uses [code]_process[/code] or [code]_fixed_process[/code] (accepts TWEEN_PROCESS_IDLE and TWEEN_PROCESS_FIXED constants, respectively). @@ -49441,9 +55552,9 @@ </argument> <argument index="5" name="duration" type="float"> </argument> - <argument index="6" name="trans_type" type="int"> + <argument index="6" name="trans_type" type="int" enum="Tween.TransitionType"> </argument> - <argument index="7" name="ease_type" type="int"> + <argument index="7" name="ease_type" type="int" enum="Tween.EaseType"> </argument> <argument index="8" name="delay" type="float" default="0"> </argument> @@ -49467,9 +55578,9 @@ </argument> <argument index="5" name="duration" type="float"> </argument> - <argument index="6" name="trans_type" type="int"> + <argument index="6" name="trans_type" type="int" enum="Tween.TransitionType"> </argument> - <argument index="7" name="ease_type" type="int"> + <argument index="7" name="ease_type" type="int" enum="Tween.EaseType"> </argument> <argument index="8" name="delay" type="float" default="0"> </argument> @@ -49487,7 +55598,7 @@ </method> </methods> <members> - <member name="playback_process_mode" type="int" setter="set_tween_process_mode" getter="get_tween_process_mode" brief=""> + <member name="playback_process_mode" type="int" setter="set_tween_process_mode" getter="get_tween_process_mode" brief="" enum="Tween.TweenProcessMode"> </member> </members> <signals> @@ -49546,7 +55657,7 @@ Means that the animation is interpolated with a quadratic (to the power of 2) function. </constant> <constant name="TRANS_EXPO" value="5"> - Means that the animation is interpolated with a exponential (some number to the power of x) function. + Means that the animation is interpolated with an exponential (some number to the power of x) function. </constant> <constant name="TRANS_ELASTIC" value="6"> Means that the animation is interpolated with elasticity, wiggling around the edges. @@ -49587,6 +55698,8 @@ </description> <methods> <method name="add_do_method" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="object" type="Object"> </argument> <argument index="1" name="method" type="String"> @@ -49595,6 +55708,8 @@ </description> </method> <method name="add_do_property"> + <return type="void"> + </return> <argument index="0" name="object" type="Object"> </argument> <argument index="1" name="property" type="String"> @@ -49606,6 +55721,8 @@ </description> </method> <method name="add_do_reference"> + <return type="void"> + </return> <argument index="0" name="object" type="Object"> </argument> <description> @@ -49613,6 +55730,8 @@ </description> </method> <method name="add_undo_method" qualifiers="vararg"> + <return type="Variant"> + </return> <argument index="0" name="object" type="Object"> </argument> <argument index="1" name="method" type="String"> @@ -49621,6 +55740,8 @@ </description> </method> <method name="add_undo_property"> + <return type="void"> + </return> <argument index="0" name="object" type="Object"> </argument> <argument index="1" name="property" type="String"> @@ -49632,6 +55753,8 @@ </description> </method> <method name="add_undo_reference"> + <return type="void"> + </return> <argument index="0" name="object" type="Object"> </argument> <description> @@ -49639,19 +55762,25 @@ </description> </method> <method name="clear_history"> + <return type="void"> + </return> <description> Clear the undo/redo history and associated references. </description> </method> <method name="commit_action"> + <return type="void"> + </return> <description> Commit the action. All 'do' methods/properties are called/set when this function is called. </description> </method> <method name="create_action"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> - <argument index="1" name="merge_mode" type="int" default="0"> + <argument index="1" name="merge_mode" type="int" enum="UndoRedo.MergeMode" default="0"> </argument> <description> Create a new action. After this is called, do all your calls to [method add_do_method], [method add_undo_method], [method add_do_property] and [method add_undo_property]. @@ -49717,6 +55846,8 @@ </theme_item> <theme_item name="grabber_highlight" type="StyleBox"> </theme_item> + <theme_item name="grabber_pressed" type="StyleBox"> + </theme_item> <theme_item name="increment" type="Texture"> </theme_item> <theme_item name="increment_highlight" type="Texture"> @@ -49757,6 +55888,8 @@ <constants> </constants> <theme_items> + <theme_item name="focus" type="StyleBox"> + </theme_item> <theme_item name="grabber" type="Texture"> </theme_item> <theme_item name="grabber_disabled" type="Texture"> @@ -49797,8 +55930,10 @@ </class> <class name="Variant" category="Core"> <brief_description> + The most important data type in Godot. </brief_description> <description> + A Variant takes up only 20 bytes and can store almost any engine datatype inside of it. Variants are rarely used to hold information for long periods of time, instead they are used mainly for communication, editing, serialization and moving data around. </description> <methods> </methods> @@ -50262,13 +56397,13 @@ </member> </members> <constants> - <constant name="AXIS_X" value="0"> + <constant name="AXIS_X" value="0" enum=""> Enumerated value for the X axis. Returned by functions like max_axis or min_axis. </constant> - <constant name="AXIS_Y" value="1"> + <constant name="AXIS_Y" value="1" enum=""> Enumerated value for the Y axis. </constant> - <constant name="AXIS_Z" value="2"> + <constant name="AXIS_Z" value="2" enum=""> Enumerated value for the Z axis. </constant> </constants> @@ -50322,30 +56457,40 @@ </description> </method> <method name="set_brake"> + <return type="void"> + </return> <argument index="0" name="brake" type="float"> </argument> <description> </description> </method> <method name="set_engine_force"> + <return type="void"> + </return> <argument index="0" name="engine_force" type="float"> </argument> <description> </description> </method> <method name="set_friction"> + <return type="void"> + </return> <argument index="0" name="friction" type="float"> </argument> <description> </description> </method> <method name="set_mass"> + <return type="void"> + </return> <argument index="0" name="mass" type="float"> </argument> <description> </description> </method> <method name="set_steering"> + <return type="void"> + </return> <argument index="0" name="steering" type="float"> </argument> <description> @@ -50447,66 +56592,88 @@ </description> </method> <method name="set_damping_compression"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> </description> </method> <method name="set_damping_relaxation"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> </description> </method> <method name="set_friction_slip"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> </description> </method> <method name="set_radius"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> </description> </method> <method name="set_roll_influence"> + <return type="void"> + </return> <argument index="0" name="roll_influence" type="float"> </argument> <description> </description> </method> <method name="set_suspension_max_force"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> </description> </method> <method name="set_suspension_rest_length"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> </description> </method> <method name="set_suspension_stiffness"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> </description> </method> <method name="set_suspension_travel"> + <return type="void"> + </return> <argument index="0" name="length" type="float"> </argument> <description> </description> </method> <method name="set_use_as_steering"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_use_as_traction"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -50633,11 +56800,15 @@ </description> </method> <method name="play"> + <return type="void"> + </return> <description> Start the video playback. </description> </method> <method name="set_audio_track"> + <return type="void"> + </return> <argument index="0" name="track" type="int"> </argument> <description> @@ -50645,6 +56816,8 @@ </description> </method> <method name="set_autoplay"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -50652,6 +56825,8 @@ </description> </method> <method name="set_buffering_msec"> + <return type="void"> + </return> <argument index="0" name="msec" type="int"> </argument> <description> @@ -50659,6 +56834,8 @@ </description> </method> <method name="set_expand"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -50666,6 +56843,8 @@ </description> </method> <method name="set_paused"> + <return type="void"> + </return> <argument index="0" name="paused" type="bool"> </argument> <description> @@ -50673,6 +56852,8 @@ </description> </method> <method name="set_stream"> + <return type="void"> + </return> <argument index="0" name="stream" type="VideoStream"> </argument> <description> @@ -50680,6 +56861,8 @@ </description> </method> <method name="set_volume"> + <return type="void"> + </return> <argument index="0" name="volume" type="float"> </argument> <description> @@ -50687,6 +56870,8 @@ </description> </method> <method name="set_volume_db"> + <return type="void"> + </return> <argument index="0" name="db" type="float"> </argument> <description> @@ -50694,6 +56879,8 @@ </description> </method> <method name="stop"> + <return type="void"> + </return> <description> Stop the video playback. </description> @@ -50739,11 +56926,6 @@ Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw. </description> <methods> - <method name="clear"> - <description> - Clear the viewport manually. - </description> - </method> <method name="find_world" qualifiers="const"> <return type="World"> </return> @@ -50772,15 +56954,14 @@ Get the canvas transform of the viewport. </description> </method> - <method name="get_clear_on_new_frame" qualifiers="const"> - <return type="bool"> + <method name="get_clear_mode" qualifiers="const"> + <return type="int" enum="Viewport.ClearMode"> </return> <description> - Return whether automatic clearing of the render target on each frame is enabled. </description> </method> <method name="get_debug_draw" qualifiers="const"> - <return type="int"> + <return type="int" enum="Viewport.DebugDraw"> </return> <description> </description> @@ -50814,7 +56995,7 @@ </description> </method> <method name="get_msaa" qualifiers="const"> - <return type="int"> + <return type="int" enum="Viewport.MSAA"> </return> <description> </description> @@ -50829,13 +57010,13 @@ <method name="get_render_info"> <return type="int"> </return> - <argument index="0" name="info" type="int"> + <argument index="0" name="info" type="int" enum="Viewport.RenderInfo"> </argument> <description> </description> </method> <method name="get_shadow_atlas_quadrant_subdiv" qualifiers="const"> - <return type="int"> + <return type="int" enum="Viewport.ShadowAtlasQuadrantSubdiv"> </return> <argument index="0" name="quadrant" type="int"> </argument> @@ -50870,14 +57051,14 @@ </description> </method> <method name="get_update_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="Viewport.UpdateMode"> </return> <description> Get when the viewport would be updated, will be one of the [code]UPDATE_*[/code] constants. </description> </method> <method name="get_usage" qualifiers="const"> - <return type="int"> + <return type="int" enum="Viewport.Usage"> </return> <description> </description> @@ -50939,7 +57120,9 @@ </description> </method> <method name="input"> - <argument index="0" name="local_event" type="Object"> + <return type="void"> + </return> + <argument index="0" name="local_event" type="InputEvent"> </argument> <description> </description> @@ -50993,6 +57176,8 @@ </description> </method> <method name="set_as_audio_listener"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -51000,6 +57185,8 @@ </description> </method> <method name="set_as_audio_listener_2d"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -51007,37 +57194,49 @@ </description> </method> <method name="set_attach_to_screen_rect"> + <return type="void"> + </return> <argument index="0" name="rect" type="Rect2"> </argument> <description> </description> </method> <method name="set_canvas_transform"> + <return type="void"> + </return> <argument index="0" name="xform" type="Transform2D"> </argument> <description> Set the canvas transform of the viewport, useful for changing the on-screen positions of all child [CanvasItem]\ s. This is relative to the global canvas transform of the viewport. </description> </method> - <method name="set_clear_on_new_frame"> - <argument index="0" name="enable" type="bool"> + <method name="set_clear_mode"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Viewport.ClearMode"> </argument> <description> </description> </method> <method name="set_debug_draw"> - <argument index="0" name="debug_draw" type="int"> + <return type="void"> + </return> + <argument index="0" name="debug_draw" type="int" enum="Viewport.DebugDraw"> </argument> <description> </description> </method> <method name="set_disable_3d"> + <return type="void"> + </return> <argument index="0" name="disable" type="bool"> </argument> <description> </description> </method> <method name="set_disable_input"> + <return type="void"> + </return> <argument index="0" name="disable" type="bool"> </argument> <description> @@ -51045,6 +57244,8 @@ </description> </method> <method name="set_global_canvas_transform"> + <return type="void"> + </return> <argument index="0" name="xform" type="Transform2D"> </argument> <description> @@ -51052,18 +57253,24 @@ </description> </method> <method name="set_hdr"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_msaa"> - <argument index="0" name="msaa" type="int"> + <return type="void"> + </return> + <argument index="0" name="msaa" type="int" enum="Viewport.MSAA"> </argument> <description> </description> </method> <method name="set_physics_object_picking"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -51071,20 +57278,26 @@ </description> </method> <method name="set_shadow_atlas_quadrant_subdiv"> + <return type="void"> + </return> <argument index="0" name="quadrant" type="int"> </argument> - <argument index="1" name="subdiv" type="int"> + <argument index="1" name="subdiv" type="int" enum="Viewport.ShadowAtlasQuadrantSubdiv"> </argument> <description> </description> </method> <method name="set_shadow_atlas_size"> + <return type="void"> + </return> <argument index="0" name="size" type="int"> </argument> <description> </description> </method> <method name="set_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> @@ -51092,17 +57305,21 @@ </description> </method> <method name="set_size_override"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> - <argument index="1" name="size" type="Vector2" default="Vector2(-1, -1)"> + <argument index="1" name="size" type="Vector2" default="Vector2( -1, -1 )"> </argument> - <argument index="2" name="margin" type="Vector2" default="Vector2(0, 0)"> + <argument index="2" name="margin" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> Set the size override of the viewport. If the enable parameter is true, it would use the override, otherwise it would use the default size. If the size parameter is equal to [code](-1, -1)[/code], it won't update the size. </description> </method> <method name="set_size_override_stretch"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> @@ -51110,6 +57327,8 @@ </description> </method> <method name="set_transparent_background"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -51117,19 +57336,33 @@ </description> </method> <method name="set_update_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="Viewport.UpdateMode"> </argument> <description> Set when the render target would be updated, using the [code]UPDATE_*[/code] constants </description> </method> <method name="set_usage"> - <argument index="0" name="usage" type="int"> + <return type="void"> + </return> + <argument index="0" name="usage" type="int" enum="Viewport.Usage"> + </argument> + <description> + </description> + </method> + <method name="set_use_arvr"> + <return type="void"> + </return> + <argument index="0" name="use" type="bool"> </argument> <description> </description> </method> <method name="set_use_own_world"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -51137,6 +57370,8 @@ </description> </method> <method name="set_vflip"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -51144,6 +57379,8 @@ </description> </method> <method name="set_world"> + <return type="void"> + </return> <argument index="0" name="world" type="World"> </argument> <description> @@ -51151,23 +57388,37 @@ </description> </method> <method name="set_world_2d"> + <return type="void"> + </return> <argument index="0" name="world_2d" type="World2D"> </argument> <description> </description> </method> <method name="unhandled_input"> - <argument index="0" name="local_event" type="Object"> + <return type="void"> + </return> + <argument index="0" name="local_event" type="InputEvent"> </argument> <description> </description> </method> <method name="update_worlds"> + <return type="void"> + </return> <description> Force update of the 2D and 3D worlds. </description> </method> + <method name="use_arvr"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="warp_mouse"> + <return type="void"> + </return> <argument index="0" name="to_pos" type="Vector2"> </argument> <description> @@ -51176,11 +57427,13 @@ </method> </methods> <members> + <member name="arvr" type="bool" setter="set_use_arvr" getter="use_arvr" brief=""> + </member> <member name="audio_listener_enable_2d" type="bool" setter="set_as_audio_listener_2d" getter="is_audio_listener_2d" brief=""> </member> <member name="audio_listener_enable_3d" type="bool" setter="set_as_audio_listener" getter="is_audio_listener" brief=""> </member> - <member name="debug_draw" type="int" setter="set_debug_draw" getter="get_debug_draw" brief=""> + <member name="debug_draw" type="int" setter="set_debug_draw" getter="get_debug_draw" brief="" enum="Viewport.DebugDraw"> </member> <member name="disable_3d" type="bool" setter="set_disable_3d" getter="is_3d_disabled" brief=""> </member> @@ -51188,33 +57441,33 @@ </member> <member name="hdr" type="bool" setter="set_hdr" getter="get_hdr" brief=""> </member> - <member name="msaa" type="int" setter="set_msaa" getter="get_msaa" brief=""> + <member name="msaa" type="int" setter="set_msaa" getter="get_msaa" brief="" enum="Viewport.MSAA"> </member> <member name="own_world" type="bool" setter="set_use_own_world" getter="is_using_own_world" brief=""> </member> <member name="physics_object_picking" type="bool" setter="set_physics_object_picking" getter="get_physics_object_picking" brief=""> </member> - <member name="render_target_clear_on_new_frame" type="bool" setter="set_clear_on_new_frame" getter="get_clear_on_new_frame" brief=""> + <member name="render_target_clear_mode" type="int" setter="set_clear_mode" getter="get_clear_mode" brief="" enum="Viewport.ClearMode"> </member> - <member name="render_target_update_mode" type="int" setter="set_update_mode" getter="get_update_mode" brief=""> + <member name="render_target_update_mode" type="int" setter="set_update_mode" getter="get_update_mode" brief="" enum="Viewport.UpdateMode"> </member> <member name="render_target_v_flip" type="bool" setter="set_vflip" getter="get_vflip" brief=""> </member> - <member name="shadow_atlas_quad_0" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief=""> + <member name="shadow_atlas_quad_0" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief="" enum="Viewport.ShadowAtlasQuadrantSubdiv"> </member> - <member name="shadow_atlas_quad_1" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief=""> + <member name="shadow_atlas_quad_1" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief="" enum="Viewport.ShadowAtlasQuadrantSubdiv"> </member> - <member name="shadow_atlas_quad_2" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief=""> + <member name="shadow_atlas_quad_2" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief="" enum="Viewport.ShadowAtlasQuadrantSubdiv"> </member> - <member name="shadow_atlas_quad_3" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief=""> + <member name="shadow_atlas_quad_3" type="int" setter="set_shadow_atlas_quadrant_subdiv" getter="get_shadow_atlas_quadrant_subdiv" brief="" enum="Viewport.ShadowAtlasQuadrantSubdiv"> </member> <member name="shadow_atlas_size" type="int" setter="set_shadow_atlas_size" getter="get_shadow_atlas_size" brief=""> </member> - <member name="size" type="Rect2" setter="set_size" getter="get_size" brief=""> + <member name="size" type="Vector2" setter="set_size" getter="get_size" brief=""> </member> <member name="transparent_bg" type="bool" setter="set_transparent_background" getter="has_transparent_background" brief=""> </member> - <member name="usage" type="int" setter="set_usage" getter="get_usage" brief=""> + <member name="usage" type="int" setter="set_usage" getter="get_usage" brief="" enum="Viewport.Usage"> </member> <member name="world" type="World" setter="set_world" getter="get_world" brief=""> </member> @@ -51301,6 +57554,8 @@ </description> </method> <method name="set_stretch"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -51327,6 +57582,8 @@ </description> </method> <method name="set_viewport_path_in_scene"> + <return type="void"> + </return> <argument index="0" name="path" type="NodePath"> </argument> <description> @@ -51351,14 +57608,16 @@ <method name="is_enabler_enabled" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="enabler" type="int"> + <argument index="0" name="enabler" type="int" enum="VisibilityEnabler.Enabler"> </argument> <description> Returns whether the specified enabler was set to true or not. </description> </method> <method name="set_enabler"> - <argument index="0" name="enabler" type="int"> + <return type="void"> + </return> + <argument index="0" name="enabler" type="int" enum="VisibilityEnabler.Enabler"> </argument> <argument index="1" name="enabled" type="bool"> </argument> @@ -51395,14 +57654,16 @@ <method name="is_enabler_enabled" qualifiers="const"> <return type="bool"> </return> - <argument index="0" name="enabler" type="int"> + <argument index="0" name="enabler" type="int" enum="VisibilityEnabler2D.Enabler"> </argument> <description> Returns whether the specified enabler was set to true or not. </description> </method> <method name="set_enabler"> - <argument index="0" name="enabler" type="int"> + <return type="void"> + </return> + <argument index="0" name="enabler" type="int" enum="VisibilityEnabler2D.Enabler"> </argument> <argument index="1" name="enabled" type="bool"> </argument> @@ -51470,6 +57731,8 @@ </description> </method> <method name="set_aabb"> + <return type="void"> + </return> <argument index="0" name="rect" type="Rect3"> </argument> <description> @@ -51533,6 +57796,8 @@ </description> </method> <method name="set_rect"> + <return type="void"> + </return> <argument index="0" name="rect" type="Rect2"> </argument> <description> @@ -51598,12 +57863,16 @@ </description> </method> <method name="set_base"> + <return type="void"> + </return> <argument index="0" name="base" type="RID"> </argument> <description> </description> </method> <method name="set_layer_mask"> + <return type="void"> + </return> <argument index="0" name="mask" type="int"> </argument> <description> @@ -51624,33 +57893,41 @@ </description> <methods> <method name="add_custom_signal"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="add_function"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="add_node"> + <return type="void"> + </return> <argument index="0" name="func" type="String"> </argument> <argument index="1" name="id" type="int"> </argument> - <argument index="2" name="node" type="Object"> + <argument index="2" name="node" type="VisualScriptNode"> </argument> - <argument index="3" name="pos" type="Vector2" default="Vector2(0, 0)"> + <argument index="3" name="pos" type="Vector2" default="Vector2( 0, 0 )"> </argument> <description> </description> </method> <method name="add_variable"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> - <argument index="1" name="default_value" type="Variant" default="NULL"> + <argument index="1" name="default_value" type="Variant" default="null"> </argument> <argument index="2" name="export" type="bool" default="false"> </argument> @@ -51658,9 +57935,11 @@ </description> </method> <method name="custom_signal_add_argument"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> - <argument index="1" name="type" type="int"> + <argument index="1" name="type" type="int" enum="Variant.Type"> </argument> <argument index="2" name="argname" type="String"> </argument> @@ -51688,7 +57967,7 @@ </description> </method> <method name="custom_signal_get_argument_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <argument index="0" name="name" type="String"> </argument> @@ -51698,14 +57977,18 @@ </description> </method> <method name="custom_signal_remove_argument"> - <argument index="0" name="argidx" type="String"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> </argument> - <argument index="1" name="arg1" type="int"> + <argument index="1" name="argidx" type="int"> </argument> <description> </description> </method> <method name="custom_signal_set_argument_name"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="argidx" type="int"> @@ -51716,16 +57999,20 @@ </description> </method> <method name="custom_signal_set_argument_type"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="argidx" type="int"> </argument> - <argument index="2" name="type" type="int"> + <argument index="2" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> </method> <method name="custom_signal_swap_argument"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="argidx" type="int"> @@ -51736,6 +58023,8 @@ </description> </method> <method name="data_connect"> + <return type="void"> + </return> <argument index="0" name="func" type="String"> </argument> <argument index="1" name="from_node" type="int"> @@ -51750,6 +58039,8 @@ </description> </method> <method name="data_disconnect"> + <return type="void"> + </return> <argument index="0" name="func" type="String"> </argument> <argument index="1" name="from_node" type="int"> @@ -51774,13 +58065,13 @@ <method name="get_function_scroll" qualifiers="const"> <return type="Vector2"> </return> - <argument index="0" name="arg0" type="String"> + <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="get_node" qualifiers="const"> - <return type="Object"> + <return type="VisualScriptNode"> </return> <argument index="0" name="func" type="String"> </argument> @@ -51800,6 +58091,8 @@ </description> </method> <method name="get_variable_default_value" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -51886,18 +58179,24 @@ </description> </method> <method name="remove_custom_signal"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="remove_function"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="remove_node"> + <return type="void"> + </return> <argument index="0" name="func" type="String"> </argument> <argument index="1" name="id" type="int"> @@ -51906,12 +58205,16 @@ </description> </method> <method name="remove_variable"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="rename_custom_signal"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="new_name" type="String"> @@ -51920,6 +58223,8 @@ </description> </method> <method name="rename_function"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="new_name" type="String"> @@ -51928,6 +58233,8 @@ </description> </method> <method name="rename_variable"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="new_name" type="String"> @@ -51936,6 +58243,8 @@ </description> </method> <method name="sequence_connect"> + <return type="void"> + </return> <argument index="0" name="func" type="String"> </argument> <argument index="1" name="from_node" type="int"> @@ -51948,6 +58257,8 @@ </description> </method> <method name="sequence_disconnect"> + <return type="void"> + </return> <argument index="0" name="func" type="String"> </argument> <argument index="1" name="from_node" type="int"> @@ -51960,20 +58271,26 @@ </description> </method> <method name="set_function_scroll"> - <argument index="0" name="ofs" type="String"> + <return type="void"> + </return> + <argument index="0" name="name" type="String"> </argument> - <argument index="1" name="arg1" type="Vector2"> + <argument index="1" name="ofs" type="Vector2"> </argument> <description> </description> </method> <method name="set_instance_base_type"> + <return type="void"> + </return> <argument index="0" name="type" type="String"> </argument> <description> </description> </method> <method name="set_node_pos"> + <return type="void"> + </return> <argument index="0" name="func" type="String"> </argument> <argument index="1" name="id" type="int"> @@ -51984,6 +58301,8 @@ </description> </method> <method name="set_variable_default_value"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="value" type="Variant"> @@ -51992,6 +58311,8 @@ </description> </method> <method name="set_variable_export"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="enable" type="bool"> @@ -52000,6 +58321,8 @@ </description> </method> <method name="set_variable_info"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <argument index="1" name="value" type="Dictionary"> @@ -52032,7 +58355,7 @@ </description> <methods> <method name="get_basic_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> @@ -52044,12 +58367,16 @@ </description> </method> <method name="set_basic_type"> - <argument index="0" name="name" type="int"> + <return type="void"> + </return> + <argument index="0" name="name" type="int" enum="Variant.Type"> </argument> <description> </description> </method> <method name="set_basic_type_constant"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -52057,9 +58384,9 @@ </method> </methods> <members> - <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> + <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="" enum="Variant.Type"> </member> - <member name="constant" type="String" setter="set_basic_type_constant" getter="get_basic_type_constant" brief=""> + <member name="constant/constant" type="String" setter="set_basic_type_constant" getter="get_basic_type_constant" brief=""> </member> </members> <constants> @@ -52072,20 +58399,22 @@ </description> <methods> <method name="get_func"> - <return type="int"> + <return type="int" enum="VisualScriptBuiltinFunc.BuiltinFunc"> </return> <description> </description> </method> <method name="set_func"> - <argument index="0" name="which" type="int"> + <return type="void"> + </return> + <argument index="0" name="which" type="int" enum="VisualScriptBuiltinFunc.BuiltinFunc"> </argument> <description> </description> </method> </methods> <members> - <member name="function" type="int" setter="set_func" getter="get_func" brief=""> + <member name="function" type="int" setter="set_func" getter="get_func" brief="" enum="VisualScriptBuiltinFunc.BuiltinFunc"> </member> </members> <constants> @@ -52110,12 +58439,16 @@ </description> </method> <method name="set_base_type"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="set_class_constant"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -52125,7 +58458,7 @@ <members> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> </member> - <member name="constant" type="String" setter="set_class_constant" getter="get_class_constant" brief=""> + <member name="constant/constant" type="String" setter="set_class_constant" getter="get_class_constant" brief=""> </member> </members> <constants> @@ -52156,18 +58489,24 @@ </description> </method> <method name="set_description"> + <return type="void"> + </return> <argument index="0" name="description" type="String"> </argument> <description> </description> </method> <method name="set_size"> + <return type="void"> + </return> <argument index="0" name="size" type="Vector2"> </argument> <description> </description> </method> <method name="set_title"> + <return type="void"> + </return> <argument index="0" name="title" type="String"> </argument> <description> @@ -52202,7 +58541,7 @@ </description> <methods> <method name="get_constant_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> @@ -52214,12 +58553,16 @@ </description> </method> <method name="set_constant_type"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> </method> <method name="set_constant_value"> + <return type="void"> + </return> <argument index="0" name="value" type="Variant"> </argument> <description> @@ -52227,9 +58570,9 @@ </method> </methods> <members> - <member name="type" type="int" setter="set_constant_type" getter="get_constant_type" brief=""> + <member name="type" type="int" setter="set_constant_type" getter="get_constant_type" brief="" enum="Variant.Type"> </member> - <member name="value" type="Nil" setter="set_constant_value" getter="get_constant_value" brief=""> + <member name="value" type="Variant" setter="set_constant_value" getter="get_constant_value" brief=""> </member> </members> <constants> @@ -52248,19 +58591,23 @@ </description> </method> <method name="get_constructor_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> </method> <method name="set_constructor"> + <return type="void"> + </return> <argument index="0" name="constructor" type="Dictionary"> </argument> <description> </description> </method> <method name="set_constructor_type"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> @@ -52269,7 +58616,7 @@ <members> <member name="constructor" type="Dictionary" setter="set_constructor" getter="get_constructor" brief=""> </member> - <member name="type" type="int" setter="set_constructor_type" getter="get_constructor_type" brief=""> + <member name="type" type="int" setter="set_constructor_type" getter="get_constructor_type" brief="" enum="Variant.Type"> </member> </members> <constants> @@ -52391,15 +58738,15 @@ </constant> <constant name="START_MODE_RESUME_YIELD" value="2"> </constant> - <constant name="STEP_PUSH_STACK_BIT" value="16777216"> + <constant name="STEP_PUSH_STACK_BIT" value="16777216" enum=""> </constant> - <constant name="STEP_GO_BACK_BIT" value="33554432"> + <constant name="STEP_GO_BACK_BIT" value="33554432" enum=""> </constant> - <constant name="STEP_NO_ADVANCE_BIT" value="67108864"> + <constant name="STEP_NO_ADVANCE_BIT" value="67108864" enum=""> </constant> - <constant name="STEP_EXIT_FUNCTION_BIT" value="134217728"> + <constant name="STEP_EXIT_FUNCTION_BIT" value="134217728" enum=""> </constant> - <constant name="STEP_YIELD_BIT" value="268435456"> + <constant name="STEP_YIELD_BIT" value="268435456" enum=""> </constant> </constants> </class> @@ -52410,13 +58757,15 @@ </description> <methods> <method name="get_deconstruct_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> </method> <method name="set_deconstruct_type"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> @@ -52425,7 +58774,7 @@ <members> <member name="elem_cache" type="Array" setter="_set_elem_cache" getter="_get_elem_cache" brief=""> </member> - <member name="type" type="int" setter="set_deconstruct_type" getter="get_deconstruct_type" brief=""> + <member name="type" type="int" setter="set_deconstruct_type" getter="get_deconstruct_type" brief="" enum="Variant.Type"> </member> </members> <constants> @@ -52444,6 +58793,8 @@ </description> </method> <method name="set_signal"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -52470,6 +58821,8 @@ </description> </method> <method name="set_singleton"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -52477,7 +58830,7 @@ </method> </methods> <members> - <member name="constant" type="String" setter="set_singleton" getter="get_singleton" brief=""> + <member name="constant/constant" type="String" setter="set_singleton" getter="get_singleton" brief=""> </member> </members> <constants> @@ -52528,13 +58881,13 @@ </description> </method> <method name="get_basic_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> </method> <method name="get_call_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="VisualScriptFunctionCall.CallMode"> </return> <description> </description> @@ -52546,7 +58899,7 @@ </description> </method> <method name="get_rpc_call_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="VisualScriptFunctionCall.RPCCallMode"> </return> <description> </description> @@ -52570,60 +58923,80 @@ </description> </method> <method name="set_base_path"> + <return type="void"> + </return> <argument index="0" name="base_path" type="NodePath"> </argument> <description> </description> </method> <method name="set_base_script"> + <return type="void"> + </return> <argument index="0" name="base_script" type="String"> </argument> <description> </description> </method> <method name="set_base_type"> + <return type="void"> + </return> <argument index="0" name="base_type" type="String"> </argument> <description> </description> </method> <method name="set_basic_type"> - <argument index="0" name="basic_type" type="int"> + <return type="void"> + </return> + <argument index="0" name="basic_type" type="int" enum="Variant.Type"> </argument> <description> </description> </method> <method name="set_call_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="VisualScriptFunctionCall.CallMode"> </argument> <description> </description> </method> <method name="set_function"> + <return type="void"> + </return> <argument index="0" name="function" type="String"> </argument> <description> </description> </method> <method name="set_rpc_call_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="VisualScriptFunctionCall.RPCCallMode"> </argument> <description> </description> </method> <method name="set_singleton"> + <return type="void"> + </return> <argument index="0" name="singleton" type="String"> </argument> <description> </description> </method> <method name="set_use_default_args"> + <return type="void"> + </return> <argument index="0" name="amount" type="int"> </argument> <description> </description> </method> <method name="set_validate"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> @@ -52637,15 +59010,15 @@ </member> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> </member> - <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> + <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="" enum="Variant.Type"> </member> - <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> + <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief="" enum="VisualScriptFunctionCall.CallMode"> </member> <member name="function" type="String" setter="set_function" getter="get_function" brief=""> </member> <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> </member> - <member name="rpc_call_mode" type="int" setter="set_rpc_call_mode" getter="get_rpc_call_mode" brief=""> + <member name="rpc_call_mode" type="int" setter="set_rpc_call_mode" getter="get_rpc_call_mode" brief="" enum="VisualScriptFunctionCall.RPCCallMode"> </member> <member name="singleton" type="String" setter="set_singleton" getter="get_singleton" brief=""> </member> @@ -52672,6 +59045,8 @@ </description> <methods> <method name="connect_to_signal"> + <return type="void"> + </return> <argument index="0" name="obj" type="Object"> </argument> <argument index="1" name="signals" type="String"> @@ -52688,9 +59063,9 @@ </description> </method> <method name="resume"> - <return type="Array"> + <return type="Variant"> </return> - <argument index="0" name="args" type="Array" default="NULL"> + <argument index="0" name="args" type="Array" default="null"> </argument> <description> </description> @@ -52712,6 +59087,8 @@ </description> </method> <method name="set_global_constant"> + <return type="void"> + </return> <argument index="0" name="index" type="int"> </argument> <description> @@ -52719,7 +59096,7 @@ </method> </methods> <members> - <member name="constant" type="int" setter="set_global_constant" getter="get_global_constant" brief=""> + <member name="constant/constant" type="int" setter="set_global_constant" getter="get_global_constant" brief=""> </member> </members> <constants> @@ -52752,7 +59129,7 @@ </description> <methods> <method name="get_action_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="VisualScriptInputAction.Mode"> </return> <description> </description> @@ -52764,12 +59141,16 @@ </description> </method> <method name="set_action_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="VisualScriptInputAction.Mode"> </argument> <description> </description> </method> <method name="set_action_name"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -52779,7 +59160,7 @@ <members> <member name="action" type="String" setter="set_action_name" getter="get_action_name" brief=""> </member> - <member name="mode" type="int" setter="set_action_mode" getter="get_action_mode" brief=""> + <member name="mode" type="int" setter="set_action_mode" getter="get_action_mode" brief="" enum="VisualScriptInputAction.Mode"> </member> </members> <constants> @@ -52808,26 +59189,30 @@ </description> </method> <method name="get_var_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> </method> <method name="set_var_name"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="set_var_type"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> </method> </methods> <members> - <member name="type" type="int" setter="set_var_type" getter="get_var_type" brief=""> + <member name="type" type="int" setter="set_var_type" getter="get_var_type" brief="" enum="Variant.Type"> </member> <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" brief=""> </member> @@ -52848,26 +59233,30 @@ </description> </method> <method name="get_var_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> </method> <method name="set_var_name"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> </description> </method> <method name="set_var_type"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> </method> </methods> <members> - <member name="type" type="int" setter="set_var_type" getter="get_var_type" brief=""> + <member name="type" type="int" setter="set_var_type" getter="get_var_type" brief="" enum="Variant.Type"> </member> <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" brief=""> </member> @@ -52882,20 +59271,22 @@ </description> <methods> <method name="get_math_constant"> - <return type="int"> + <return type="int" enum="VisualScriptMathConstant.MathConstant"> </return> <description> </description> </method> <method name="set_math_constant"> - <argument index="0" name="which" type="int"> + <return type="void"> + </return> + <argument index="0" name="which" type="int" enum="VisualScriptMathConstant.MathConstant"> </argument> <description> </description> </method> </methods> <members> - <member name="constant" type="int" setter="set_math_constant" getter="get_math_constant" brief=""> + <member name="constant/constant" type="int" setter="set_math_constant" getter="get_math_constant" brief="" enum="VisualScriptMathConstant.MathConstant"> </member> </members> <constants> @@ -52922,6 +59313,8 @@ </description> </method> <method name="set_default_input_value"> + <return type="void"> + </return> <argument index="0" name="port_idx" type="int"> </argument> <argument index="1" name="value" type="Variant"> @@ -52950,34 +59343,38 @@ </description> <methods> <method name="get_operator" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Operator"> </return> <description> </description> </method> <method name="get_typed" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> </method> <method name="set_operator"> - <argument index="0" name="op" type="int"> + <return type="void"> + </return> + <argument index="0" name="op" type="int" enum="Variant.Operator"> </argument> <description> </description> </method> <method name="set_typed"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> </method> </methods> <members> - <member name="operator" type="int" setter="set_operator" getter="get_operator" brief=""> + <member name="operator" type="int" setter="set_operator" getter="get_operator" brief="" enum="Variant.Operator"> </member> - <member name="type" type="int" setter="set_typed" getter="get_typed" brief=""> + <member name="type" type="int" setter="set_typed" getter="get_typed" brief="" enum="Variant.Type"> </member> </members> <constants> @@ -52990,13 +59387,15 @@ </description> <methods> <method name="get_preload" qualifiers="const"> - <return type="Object"> + <return type="Resource"> </return> <description> </description> </method> <method name="set_preload"> - <argument index="0" name="resource" type="Object"> + <return type="void"> + </return> + <argument index="0" name="resource" type="Resource"> </argument> <description> </description> @@ -53034,13 +59433,13 @@ </description> </method> <method name="get_basic_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> </method> <method name="get_call_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="VisualScriptPropertyGet.CallMode"> </return> <description> </description> @@ -53058,42 +59457,56 @@ </description> </method> <method name="set_base_path"> + <return type="void"> + </return> <argument index="0" name="base_path" type="NodePath"> </argument> <description> </description> </method> <method name="set_base_script"> + <return type="void"> + </return> <argument index="0" name="base_script" type="String"> </argument> <description> </description> </method> <method name="set_base_type"> + <return type="void"> + </return> <argument index="0" name="base_type" type="String"> </argument> <description> </description> </method> <method name="set_basic_type"> - <argument index="0" name="basic_type" type="int"> + <return type="void"> + </return> + <argument index="0" name="basic_type" type="int" enum="Variant.Type"> </argument> <description> </description> </method> <method name="set_call_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="VisualScriptPropertyGet.CallMode"> </argument> <description> </description> </method> <method name="set_index"> + <return type="void"> + </return> <argument index="0" name="index" type="String"> </argument> <description> </description> </method> <method name="set_property"> + <return type="void"> + </return> <argument index="0" name="property" type="String"> </argument> <description> @@ -53105,7 +59518,7 @@ </member> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> </member> - <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> + <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="" enum="Variant.Type"> </member> <member name="index" type="String" setter="set_index" getter="get_index" brief=""> </member> @@ -53113,9 +59526,9 @@ </member> <member name="property" type="String" setter="set_property" getter="get_property" brief=""> </member> - <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> + <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief="" enum="VisualScriptPropertyGet.CallMode"> </member> - <member name="type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" brief=""> + <member name="type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" brief="" enum="Variant.Type"> </member> </members> <constants> @@ -53134,7 +59547,7 @@ </description> <methods> <method name="get_assign_op" qualifiers="const"> - <return type="int"> + <return type="int" enum="VisualScriptPropertySet.AssignOp"> </return> <description> </description> @@ -53158,13 +59571,13 @@ </description> </method> <method name="get_basic_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> </method> <method name="get_call_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="VisualScriptPropertySet.CallMode"> </return> <description> </description> @@ -53182,48 +59595,64 @@ </description> </method> <method name="set_assign_op"> - <argument index="0" name="assign_op" type="int"> + <return type="void"> + </return> + <argument index="0" name="assign_op" type="int" enum="VisualScriptPropertySet.AssignOp"> </argument> <description> </description> </method> <method name="set_base_path"> + <return type="void"> + </return> <argument index="0" name="base_path" type="NodePath"> </argument> <description> </description> </method> <method name="set_base_script"> + <return type="void"> + </return> <argument index="0" name="base_script" type="String"> </argument> <description> </description> </method> <method name="set_base_type"> + <return type="void"> + </return> <argument index="0" name="base_type" type="String"> </argument> <description> </description> </method> <method name="set_basic_type"> - <argument index="0" name="basic_type" type="int"> + <return type="void"> + </return> + <argument index="0" name="basic_type" type="int" enum="Variant.Type"> </argument> <description> </description> </method> <method name="set_call_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="VisualScriptPropertySet.CallMode"> </argument> <description> </description> </method> <method name="set_index"> + <return type="void"> + </return> <argument index="0" name="index" type="String"> </argument> <description> </description> </method> <method name="set_property"> + <return type="void"> + </return> <argument index="0" name="property" type="String"> </argument> <description> @@ -53231,13 +59660,13 @@ </method> </methods> <members> - <member name="assign_op" type="int" setter="set_assign_op" getter="get_assign_op" brief=""> + <member name="assign_op" type="int" setter="set_assign_op" getter="get_assign_op" brief="" enum="VisualScriptPropertySet.AssignOp"> </member> <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" brief=""> </member> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> </member> - <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> + <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="" enum="Variant.Type"> </member> <member name="index" type="String" setter="set_index" getter="get_index" brief=""> </member> @@ -53245,9 +59674,9 @@ </member> <member name="property" type="String" setter="set_property" getter="get_property" brief=""> </member> - <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> + <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief="" enum="VisualScriptPropertySet.CallMode"> </member> - <member name="type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" brief=""> + <member name="type_cache" type="Dictionary" setter="_set_type_cache" getter="_get_type_cache" brief=""> </member> </members> <constants> @@ -53272,6 +59701,8 @@ </description> </method> <method name="set_resource_path"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> @@ -53292,7 +59723,7 @@ </description> <methods> <method name="get_return_type" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> @@ -53304,13 +59735,17 @@ </description> </method> <method name="set_enable_return_value"> + <return type="void"> + </return> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> <method name="set_return_type"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> @@ -53319,7 +59754,7 @@ <members> <member name="return_enabled" type="bool" setter="set_enable_return_value" getter="is_return_value_enabled" brief=""> </member> - <member name="return_type" type="int" setter="set_return_type" getter="get_return_type" brief=""> + <member name="return_type" type="int" setter="set_return_type" getter="get_return_type" brief="" enum="Variant.Type"> </member> </members> <constants> @@ -53338,6 +59773,8 @@ </description> </method> <method name="set_node_path"> + <return type="void"> + </return> <argument index="0" name="path" type="NodePath"> </argument> <description> @@ -53368,20 +59805,22 @@ </description> <methods> <method name="get_typed" qualifiers="const"> - <return type="int"> + <return type="int" enum="Variant.Type"> </return> <description> </description> </method> <method name="set_typed"> - <argument index="0" name="type" type="int"> + <return type="void"> + </return> + <argument index="0" name="type" type="int" enum="Variant.Type"> </argument> <description> </description> </method> </methods> <members> - <member name="type" type="int" setter="set_typed" getter="get_typed" brief=""> + <member name="type" type="int" setter="set_typed" getter="get_typed" brief="" enum="Variant.Type"> </member> </members> <constants> @@ -53410,6 +59849,8 @@ </description> </method> <method name="set_steps"> + <return type="void"> + </return> <argument index="0" name="steps" type="int"> </argument> <description> @@ -53430,6 +59871,8 @@ </description> <methods> <method name="_subcall" qualifiers="virtual"> + <return type="Variant"> + </return> <argument index="0" name="arguments" type="Variant"> </argument> <description> @@ -53468,12 +59911,16 @@ </description> </method> <method name="set_base_script"> + <return type="void"> + </return> <argument index="0" name="path" type="String"> </argument> <description> </description> </method> <method name="set_base_type"> + <return type="void"> + </return> <argument index="0" name="type" type="String"> </argument> <description> @@ -53502,6 +59949,8 @@ </description> </method> <method name="set_variable"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -53528,6 +59977,8 @@ </description> </method> <method name="set_variable"> + <return type="void"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -53564,26 +60015,30 @@ </description> </method> <method name="get_yield_mode"> - <return type="int"> + <return type="int" enum="VisualScriptYield.YieldMode"> </return> <description> </description> </method> <method name="set_wait_time"> + <return type="void"> + </return> <argument index="0" name="sec" type="float"> </argument> <description> </description> </method> <method name="set_yield_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="VisualScriptYield.YieldMode"> </argument> <description> </description> </method> </methods> <members> - <member name="mode" type="int" setter="set_yield_mode" getter="get_yield_mode" brief=""> + <member name="mode" type="int" setter="set_yield_mode" getter="get_yield_mode" brief="" enum="VisualScriptYield.YieldMode"> </member> <member name="wait_time" type="float" setter="set_wait_time" getter="get_wait_time" brief=""> </member> @@ -53616,7 +60071,7 @@ </description> </method> <method name="get_call_mode" qualifiers="const"> - <return type="int"> + <return type="int" enum="VisualScriptYieldSignal.CallMode"> </return> <description> </description> @@ -53628,24 +60083,32 @@ </description> </method> <method name="set_base_path"> + <return type="void"> + </return> <argument index="0" name="base_path" type="NodePath"> </argument> <description> </description> </method> <method name="set_base_type"> + <return type="void"> + </return> <argument index="0" name="base_type" type="String"> </argument> <description> </description> </method> <method name="set_call_mode"> - <argument index="0" name="mode" type="int"> + <return type="void"> + </return> + <argument index="0" name="mode" type="int" enum="VisualScriptYieldSignal.CallMode"> </argument> <description> </description> </method> <method name="set_signal"> + <return type="void"> + </return> <argument index="0" name="signal" type="String"> </argument> <description> @@ -53655,7 +60118,7 @@ <members> <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> </member> - <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> + <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief="" enum="VisualScriptYieldSignal.CallMode"> </member> <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> </member> @@ -53680,6 +60143,12 @@ The visual server is completely opaque, the internals are entirely implementation specific and cannot be accessed. </description> <methods> + <method name="force_draw"> + <return type="void"> + </return> + <description> + </description> + </method> <method name="texture_create"> <return type="RID"> </return> @@ -53689,9 +60158,9 @@ <method name="texture_create_from_image"> <return type="RID"> </return> - <argument index="0" name="arg0" type="Object"> + <argument index="0" name="image" type="Image"> </argument> - <argument index="1" name="arg1" type="int" default="7"> + <argument index="1" name="flags" type="int" default="7"> </argument> <description> </description> @@ -53699,7 +60168,7 @@ <method name="texture_get_flags" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="arg0" type="RID"> + <argument index="0" name="texture" type="RID"> </argument> <description> </description> @@ -53707,7 +60176,7 @@ <method name="texture_get_height" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="arg0" type="RID"> + <argument index="0" name="texture" type="RID"> </argument> <description> </description> @@ -53715,20 +60184,24 @@ <method name="texture_get_width" qualifiers="const"> <return type="int"> </return> - <argument index="0" name="arg0" type="RID"> + <argument index="0" name="texture" type="RID"> </argument> <description> </description> </method> <method name="texture_set_flags"> - <argument index="0" name="arg0" type="RID"> + <return type="void"> + </return> + <argument index="0" name="texture" type="RID"> </argument> - <argument index="1" name="arg1" type="int"> + <argument index="1" name="flags" type="int"> </argument> <description> </description> </method> <method name="texture_set_shrink_all_x2_on_set_data"> + <return type="void"> + </return> <argument index="0" name="shrink" type="bool"> </argument> <description> @@ -53747,7 +60220,7 @@ </description> <methods> <method name="get_ref" qualifiers="const"> - <return type="Object"> + <return type="Variant"> </return> <description> Returns the [Object] this weakref is referring to. @@ -53786,12 +60259,16 @@ </description> </method> <method name="set_resizable"> + <return type="void"> + </return> <argument index="0" name="resizable" type="bool"> </argument> <description> </description> </method> <method name="set_title"> + <return type="void"> + </return> <argument index="0" name="title" type="String"> </argument> <description> @@ -53867,12 +60344,16 @@ </description> </method> <method name="set_environment"> + <return type="void"> + </return> <argument index="0" name="env" type="Environment"> </argument> <description> </description> </method> <method name="set_fallback_environment"> + <return type="void"> + </return> <argument index="0" name="env" type="Environment"> </argument> <description> @@ -53937,6 +60418,8 @@ </description> </method> <method name="set_environment"> + <return type="void"> + </return> <argument index="0" name="env" type="Environment"> </argument> <description> @@ -54031,7 +60514,7 @@ </description> </method> <method name="get_node_type"> - <return type="int"> + <return type="int" enum="XMLParser.NodeType"> </return> <description> Get the type of the current node. Compare with [code]NODE_*[/code] constants. @@ -54054,7 +60537,7 @@ </description> </method> <method name="open"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="file" type="String"> </argument> @@ -54063,7 +60546,7 @@ </description> </method> <method name="open_buffer"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="buffer" type="PoolByteArray"> </argument> @@ -54072,14 +60555,14 @@ </description> </method> <method name="read"> - <return type="int"> + <return type="int" enum="Error"> </return> <description> Read the next node of the file. This returns an error code. </description> </method> <method name="seek"> - <return type="int"> + <return type="int" enum="Error"> </return> <argument index="0" name="pos" type="int"> </argument> @@ -54088,6 +60571,8 @@ </description> </method> <method name="skip_section"> + <return type="void"> + </return> <description> Skips the current section. If the node contains other elements, they will be ignored and the cursor will go to the closing of the current element. </description> @@ -54133,6 +60618,8 @@ </description> </method> <method name="set_sort_enabled"> + <return type="void"> + </return> <argument index="0" name="enabled" type="bool"> </argument> <description> diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp index 40c66b0bc5..216100bac6 100644 --- a/drivers/alsa/audio_driver_alsa.cpp +++ b/drivers/alsa/audio_driver_alsa.cpp @@ -31,6 +31,7 @@ #ifdef ALSA_ENABLED +#include "os/os.h" #include "project_settings.h" #include <errno.h> @@ -44,7 +45,7 @@ Error AudioDriverALSA::init() { samples_in = NULL; samples_out = NULL; - mix_rate = GLOBAL_DEF("audio/mix_rate", 44100); + mix_rate = GLOBAL_DEF("audio/mix_rate", DEFAULT_MIX_RATE); speaker_mode = SPEAKER_MODE_STEREO; channels = 2; @@ -86,19 +87,25 @@ Error AudioDriverALSA::init() { status = snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &mix_rate, NULL); CHECK_FAIL(status < 0); - int latency = GLOBAL_DEF("audio/output_latency", 25); - buffer_size = closest_power_of_2(latency * mix_rate / 1000); + // In ALSA the period size seems to be the one that will determine the actual latency + // Ref: https://www.alsa-project.org/main/index.php/FramesPeriods + unsigned int periods = 2; + int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY); + buffer_frames = closest_power_of_2(latency * mix_rate / 1000); + buffer_size = buffer_frames * periods; + period_size = buffer_frames; // set buffer size from project settings status = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size); CHECK_FAIL(status < 0); - // make period size 1/8 - period_size = buffer_size >> 3; status = snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, &period_size, NULL); CHECK_FAIL(status < 0); - unsigned int periods = 2; + if (OS::get_singleton()->is_stdout_verbose()) { + print_line("audio buffer frames: " + itos(period_size) + " calculated latency: " + itos(period_size * 1000 / mix_rate) + "ms"); + } + status = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &periods, NULL); CHECK_FAIL(status < 0); diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h index 83601be41b..c76ec0da61 100644 --- a/drivers/alsa/audio_driver_alsa.h +++ b/drivers/alsa/audio_driver_alsa.h @@ -51,6 +51,7 @@ class AudioDriverALSA : public AudioDriver { unsigned int mix_rate; SpeakerMode speaker_mode; + snd_pcm_uframes_t buffer_frames; snd_pcm_uframes_t buffer_size; snd_pcm_uframes_t period_size; int channels; diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 09f35f097a..84f29facf4 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1115,6 +1115,10 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons _copy_texscreen(Rect2()); } + if (shader_ptr->canvas_item.uses_time) { + VisualServerRaster::redraw_request(); + } + state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id); state.canvas_shader.bind(); @@ -1284,6 +1288,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons case VS::CANVAS_LIGHT_FILTER_NONE: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_NEAREST, true); break; case VS::CANVAS_LIGHT_FILTER_PCF3: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF3, true); break; case VS::CANVAS_LIGHT_FILTER_PCF5: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF5, true); break; + case VS::CANVAS_LIGHT_FILTER_PCF7: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF7, true); break; case VS::CANVAS_LIGHT_FILTER_PCF9: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF9, true); break; case VS::CANVAS_LIGHT_FILTER_PCF13: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF13, true); break; } @@ -1334,6 +1339,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_NEAREST, false); state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF3, false); state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF5, false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF7, false); state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF9, false); state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF13, false); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index cbb05befb6..146a2359b6 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -32,6 +32,7 @@ #include "os/os.h" #include "project_settings.h" #include "rasterizer_canvas_gles3.h" +#include "servers/visual/visual_server_raster.h" #ifndef GLES_OVER_GL #define glClearDepth glClearDepthf @@ -247,7 +248,7 @@ bool RasterizerSceneGLES3::_shadow_atlas_find_shadow(ShadowAtlas *shadow_atlas, int qidx = p_in_quadrants[i]; - if (shadow_atlas->quadrants[qidx].subdivision == p_current_subdiv) { + if (shadow_atlas->quadrants[qidx].subdivision == (uint32_t)p_current_subdiv) { return false; } @@ -257,7 +258,7 @@ bool RasterizerSceneGLES3::_shadow_atlas_find_shadow(ShadowAtlas *shadow_atlas, int found_free_idx = -1; //found a free one int found_used_idx = -1; //found existing one, must steal it - uint64_t min_pass; // pass of the existing one, try to use the least recently used one (LRU fashion) + uint64_t min_pass = 0; // pass of the existing one, try to use the least recently used one (LRU fashion) for (int j = 0; j < sc; j++) { if (!sarr[j].owner.is_valid()) { @@ -349,7 +350,7 @@ bool RasterizerSceneGLES3::shadow_atlas_update_light(RID p_atlas, RID p_light_in uint32_t q = (key >> ShadowAtlas::QUADRANT_SHIFT) & 0x3; uint32_t s = key & ShadowAtlas::SHADOW_INDEX_MASK; - bool should_realloc = shadow_atlas->quadrants[q].subdivision != best_subdiv && (shadow_atlas->quadrants[q].shadows[s].alloc_tick - tick > shadow_atlas_realloc_tolerance_msec); + bool should_realloc = shadow_atlas->quadrants[q].subdivision != (uint32_t)best_subdiv && (shadow_atlas->quadrants[q].shadows[s].alloc_tick - tick > shadow_atlas_realloc_tolerance_msec); bool should_redraw = shadow_atlas->quadrants[q].shadows[s].version != p_light_version; if (!should_realloc) { @@ -554,7 +555,7 @@ void RasterizerSceneGLES3::reflection_atlas_set_subdivision(RID p_ref_atlas, int ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(p_ref_atlas); ERR_FAIL_COND(!reflection_atlas); - uint32_t subdiv = next_power_of_2(p_subdiv); + int subdiv = next_power_of_2(p_subdiv); if (subdiv & 0xaaaaaaaa) { //sqrt(subdiv) must be integer subdiv <<= 1; } @@ -1939,6 +1940,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_ bool prev_use_instancing = false; storage->info.render.draw_call_count += p_element_count; + bool prev_opaque_prepass = false; for (int i = 0; i < p_element_count; i++) { @@ -2072,6 +2074,13 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_ } } + bool use_opaque_prepass = e->sort_key & RenderList::SORT_KEY_OPAQUE_PRE_PASS; + + if (use_opaque_prepass != prev_opaque_prepass) { + state.scene_shader.set_conditional(SceneShaderGLES3::USE_OPAQUE_PREPASS, use_opaque_prepass); + rebind = true; + } + bool use_instancing = e->instance->base_type == VS::INSTANCE_MULTIMESH || e->instance->base_type == VS::INSTANCE_PARTICLES; if (use_instancing != prev_use_instancing) { @@ -2127,6 +2136,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_ prev_shading = shading; prev_skeleton = skeleton; prev_use_instancing = use_instancing; + prev_opaque_prepass = use_opaque_prepass; first = false; } @@ -2148,9 +2158,10 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_ state.scene_shader.set_conditional(SceneShaderGLES3::USE_GI_PROBES, false); state.scene_shader.set_conditional(SceneShaderGLES3::USE_CONTACT_SHADOWS, false); state.scene_shader.set_conditional(SceneShaderGLES3::USE_VERTEX_LIGHTING, false); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_OPAQUE_PREPASS, false); } -void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_shadow) { +void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_depth_pass) { RasterizerStorageGLES3::Material *m = NULL; RID m_src = p_instance->material_override.is_valid() ? p_instance->material_override : (p_material >= 0 ? p_instance->materials[p_material] : p_geometry->material); @@ -2182,22 +2193,21 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo ERR_FAIL_COND(!m); - _add_geometry_with_material(p_geometry, p_instance, p_owner, m, p_shadow); + _add_geometry_with_material(p_geometry, p_instance, p_owner, m, p_depth_pass); while (m->next_pass.is_valid()) { m = storage->material_owner.getornull(m->next_pass); if (!m || !m->shader || !m->shader->valid) break; - _add_geometry_with_material(p_geometry, p_instance, p_owner, m, p_shadow); + _add_geometry_with_material(p_geometry, p_instance, p_owner, m, p_depth_pass); } } -void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, RasterizerStorageGLES3::Material *p_material, bool p_shadow) { +void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, RasterizerStorageGLES3::Material *p_material, bool p_depth_pass) { bool has_base_alpha = (p_material->shader->spatial.uses_alpha && !p_material->shader->spatial.uses_alpha_scissor) || p_material->shader->spatial.uses_screen_texture; bool has_blend_alpha = p_material->shader->spatial.blend_mode != RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX; bool has_alpha = has_base_alpha || has_blend_alpha; - bool shadow = false; bool mirror = p_instance->mirror; bool no_cull = false; @@ -2217,7 +2227,7 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G state.used_screen_texture = true; } - if (p_shadow) { + if (p_depth_pass) { if (has_blend_alpha || (has_base_alpha && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS)) return; //bye @@ -2252,14 +2262,14 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G e->geometry->index = current_geometry_index++; } - if (!p_shadow && directional_light && (directional_light->light_ptr->cull_mask & e->instance->layer_mask) == 0) { + if (!p_depth_pass && directional_light && (directional_light->light_ptr->cull_mask & e->instance->layer_mask) == 0) { e->sort_key |= SORT_KEY_NO_DIRECTIONAL_FLAG; } e->sort_key |= uint64_t(e->geometry->index) << RenderList::SORT_KEY_GEOMETRY_INDEX_SHIFT; e->sort_key |= uint64_t(e->instance->base_type) << RenderList::SORT_KEY_GEOMETRY_TYPE_SHIFT; - if (!p_shadow) { + if (!p_depth_pass) { if (e->material->last_pass != render_pass) { e->material->last_pass = render_pass; @@ -2269,17 +2279,6 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G e->sort_key |= uint64_t(e->material->index) << RenderList::SORT_KEY_MATERIAL_INDEX_SHIFT; e->sort_key |= uint64_t(e->instance->depth_layer) << RenderList::SORT_KEY_OPAQUE_DEPTH_LAYER_SHIFT; - if (!has_blend_alpha && has_alpha && p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { - - //if nothing exists, add this element as opaque too - RenderList::Element *oe = render_list.add_element(); - - if (!oe) - return; - - copymem(oe, e, sizeof(RenderList::Element)); - } - if (e->instance->gi_probe_instances.size()) { e->sort_key |= SORT_KEY_GI_PROBES_FLAG; } @@ -2302,24 +2301,21 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G //e->light_type=0xFF; // no lights! - if (shadow || p_material->shader->spatial.unshaded || state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_UNSHADED) { - + if (p_depth_pass || p_material->shader->spatial.unshaded || state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_UNSHADED) { e->sort_key |= SORT_KEY_UNSHADED_FLAG; } - if (!shadow && (p_material->shader->spatial.uses_vertex_lighting || storage->config.force_vertex_shading)) { + if (p_depth_pass && p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { + e->sort_key |= RenderList::SORT_KEY_OPAQUE_PRE_PASS; + } + + if (!p_depth_pass && (p_material->shader->spatial.uses_vertex_lighting || storage->config.force_vertex_shading)) { e->sort_key |= SORT_KEY_VERTEX_LIT_FLAG; } - if (!shadow && has_alpha && p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { - //depth prepass for alpha - RenderList::Element *eo = render_list.add_element(); - - eo->instance = e->instance; - eo->geometry = e->geometry; - eo->material = e->material; - eo->sort_key = e->sort_key; + if (p_material->shader->spatial.uses_time) { + VisualServerRaster::redraw_request(); } } @@ -2603,7 +2599,7 @@ void RasterizerSceneGLES3::_setup_directional_light(int p_index, const Transform } } - ubo_data.shadow_split_offsets[j] = 1.0 / li->shadow_transform[j].split; + ubo_data.shadow_split_offsets[j] = li->shadow_transform[j].split; Transform modelview = (p_camera_inverse_transform * li->shadow_transform[j].transform).inverse(); @@ -2702,7 +2698,7 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_c uint32_t quadrant = (key >> ShadowAtlas::QUADRANT_SHIFT) & 0x3; uint32_t shadow = key & ShadowAtlas::SHADOW_INDEX_MASK; - ERR_CONTINUE(shadow >= shadow_atlas->quadrants[quadrant].shadows.size()); + ERR_CONTINUE(shadow >= (uint32_t)shadow_atlas->quadrants[quadrant].shadows.size()); uint32_t atlas_size = shadow_atlas->size; uint32_t quadrant_size = atlas_size >> 1; @@ -2789,7 +2785,7 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_c uint32_t quadrant = (key >> ShadowAtlas::QUADRANT_SHIFT) & 0x3; uint32_t shadow = key & ShadowAtlas::SHADOW_INDEX_MASK; - ERR_CONTINUE(shadow >= shadow_atlas->quadrants[quadrant].shadows.size()); + ERR_CONTINUE(shadow >= (uint32_t)shadow_atlas->quadrants[quadrant].shadows.size()); uint32_t atlas_size = shadow_atlas->size; uint32_t quadrant_size = atlas_size >> 1; @@ -3032,7 +3028,7 @@ void RasterizerSceneGLES3::_copy_texture_to_front_buffer(GLuint p_texture) { storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA, false); } -void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p_cull_count, bool p_shadow) { +void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p_cull_count, bool p_depth_pass) { current_geometry_index = 0; current_material_index = 0; @@ -3057,7 +3053,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p int mat_idx = inst->materials[i].is_valid() ? i : -1; RasterizerStorageGLES3::Surface *s = mesh->surfaces[i]; - _add_geometry(s, inst, NULL, mat_idx, p_shadow); + _add_geometry(s, inst, NULL, mat_idx, p_depth_pass); } //mesh->last_pass=frame; @@ -3080,7 +3076,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p for (int i = 0; i < ssize; i++) { RasterizerStorageGLES3::Surface *s = mesh->surfaces[i]; - _add_geometry(s, inst, multi_mesh, -1, p_shadow); + _add_geometry(s, inst, multi_mesh, -1, p_depth_pass); } } break; @@ -3089,7 +3085,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p RasterizerStorageGLES3::Immediate *immediate = storage->immediate_owner.getptr(inst->base); ERR_CONTINUE(!immediate); - _add_geometry(immediate, inst, NULL, -1, p_shadow); + _add_geometry(immediate, inst, NULL, -1, p_depth_pass); } break; case VS::INSTANCE_PARTICLES: { @@ -3111,7 +3107,7 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p for (int j = 0; j < ssize; j++) { RasterizerStorageGLES3::Surface *s = mesh->surfaces[j]; - _add_geometry(s, inst, particles, -1, p_shadow); + _add_geometry(s, inst, particles, -1, p_depth_pass); } } @@ -3178,6 +3174,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_ for (int i = 0; i < storage->frame.current_rt->effects.ssao.depth_mipmap_fbos.size(); i++) { state.ssao_minify_shader.set_conditional(SsaoMinifyShaderGLES3::MINIFY_START, i == 0); + state.ssao_minify_shader.set_conditional(SsaoMinifyShaderGLES3::USE_ORTHOGONAL_PROJECTION, p_cam_projection.is_orthogonal()); state.ssao_minify_shader.bind(); state.ssao_minify_shader.set_uniform(SsaoMinifyShaderGLES3::CAMERA_Z_FAR, p_cam_projection.get_z_far()); state.ssao_minify_shader.set_uniform(SsaoMinifyShaderGLES3::CAMERA_Z_NEAR, p_cam_projection.get_z_near()); @@ -3207,6 +3204,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_ glDepthFunc(GL_GREATER); // do SSAO! state.ssao_shader.set_conditional(SsaoShaderGLES3::ENABLE_RADIUS2, env->ssao_radius2 > 0.001); + state.ssao_shader.set_conditional(SsaoShaderGLES3::USE_ORTHOGONAL_PROJECTION, p_cam_projection.is_orthogonal()); state.ssao_shader.bind(); state.ssao_shader.set_uniform(SsaoShaderGLES3::CAMERA_Z_FAR, p_cam_projection.get_z_far()); state.ssao_shader.set_uniform(SsaoShaderGLES3::CAMERA_Z_NEAR, p_cam_projection.get_z_near()); @@ -3316,6 +3314,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.ssao.blur_fbo[0]); glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_LINEAR); + state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::USE_ORTHOGONAL_PROJECTION, p_cam_projection.is_orthogonal()); state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::USE_11_SAMPLES, subsurface_scatter_quality == SSS_QUALITY_LOW); state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::USE_17_SAMPLES, subsurface_scatter_quality == SSS_QUALITY_MEDIUM); state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::USE_25_SAMPLES, subsurface_scatter_quality == SSS_QUALITY_HIGH); @@ -3370,6 +3369,7 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_ //perform SSR state.ssr_shader.set_conditional(ScreenSpaceReflectionShaderGLES3::REFLECT_ROUGHNESS, env->ssr_roughness); + state.ssr_shader.set_conditional(ScreenSpaceReflectionShaderGLES3::USE_ORTHOGONAL_PROJECTION, p_cam_projection.is_orthogonal()); state.ssr_shader.bind(); @@ -3523,6 +3523,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p int vp_h = storage->frame.current_rt->height; int vp_w = storage->frame.current_rt->width; + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::USE_ORTHOGONAL_PROJECTION, p_cam_projection.is_orthogonal()); state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_FAR_BLUR, true); state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_LOW, env->dof_blur_far_quality == VS::ENV_DOF_BLUR_QUALITY_LOW); state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_MEDIUM, env->dof_blur_far_quality == VS::ENV_DOF_BLUR_QUALITY_MEDIUM); @@ -3565,6 +3566,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_LOW, false); state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_MEDIUM, false); state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_HIGH, false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::USE_ORTHOGONAL_PROJECTION, false); composite_from = storage->frame.current_rt->effects.mip_maps[0].color; } @@ -3577,6 +3579,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p int vp_h = storage->frame.current_rt->height; int vp_w = storage->frame.current_rt->width; + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::USE_ORTHOGONAL_PROJECTION, p_cam_projection.is_orthogonal()); state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_NEAR_BLUR, true); state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_NEAR_FIRST_TAP, true); @@ -3652,6 +3655,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_LOW, false); state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_MEDIUM, false); state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_HIGH, false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::USE_ORTHOGONAL_PROJECTION, false); composite_from = storage->frame.current_rt->effects.mip_maps[0].color; } @@ -3743,6 +3747,8 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p SWAP(exposure_shrink[exposure_shrink.size() - 1].color, storage->frame.current_rt->exposure.color); glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height); + + VisualServerRaster::redraw_request(); //if using auto exposure, redraw must happen } int max_glow_level = -1; @@ -4159,7 +4165,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const clear_color = env->bg_color.to_linear(); storage->frame.clear_request = false; - } else if (env->bg_mode == VS::ENV_BG_SKY) { + } else if (env->bg_mode == VS::ENV_BG_SKY || env->bg_mode == VS::ENV_BG_COLOR_SKY) { sky = storage->sky_owner.getornull(env->sky); @@ -4167,6 +4173,9 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const env_radiance_tex = sky->radiance; } storage->frame.clear_request = false; + if (env->bg_mode == VS::ENV_BG_COLOR_SKY) { + clear_color = env->bg_color.to_linear(); + } } else { storage->frame.clear_request = false; @@ -4469,7 +4478,7 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_ uint32_t quadrant = (key >> ShadowAtlas::QUADRANT_SHIFT) & 0x3; uint32_t shadow = key & ShadowAtlas::SHADOW_INDEX_MASK; - ERR_FAIL_INDEX(shadow, shadow_atlas->quadrants[quadrant].shadows.size()); + ERR_FAIL_INDEX((int)shadow, shadow_atlas->quadrants[quadrant].shadows.size()); uint32_t quadrant_size = shadow_atlas->size >> 1; diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index b6291b03fd..b3fd6fa2a0 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -244,7 +244,7 @@ public: GLuint fbo_id[6]; GLuint cubemap; - int size; + uint32_t size; }; Vector<ShadowCubeMap> shadow_cubemaps; @@ -531,7 +531,7 @@ public: virtual void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture); virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_in, float p_fade_out, float p_depth_tolerance, bool p_roughness); - virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_radius2, float p_intensity2, float p_intensity, float p_bias, float p_light_affect, const Color &p_color, bool p_blur); + virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, const Color &p_color, bool p_blur); virtual void environment_set_tonemap(RID p_env, VS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale); @@ -664,6 +664,7 @@ public: //bits 12-8 geometry type SORT_KEY_GEOMETRY_TYPE_SHIFT = 8, //bits 0-7 for flags + SORT_KEY_OPAQUE_PRE_PASS = 8, SORT_KEY_CULL_DISABLED_FLAG = 4, SORT_KEY_SKELETON_FLAG = 2, SORT_KEY_MIRROR_FLAG = 1 @@ -805,9 +806,9 @@ public: void _render_list(RenderList::Element **p_elements, int p_element_count, const Transform &p_view_transform, const CameraMatrix &p_projection, GLuint p_base_env, bool p_reverse_cull, bool p_alpha_pass, bool p_shadow, bool p_directional_add, bool p_directional_shadows); - _FORCE_INLINE_ void _add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_shadow); + _FORCE_INLINE_ void _add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_depth_passs); - _FORCE_INLINE_ void _add_geometry_with_material(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, RasterizerStorageGLES3::Material *p_material, bool p_shadow); + _FORCE_INLINE_ void _add_geometry_with_material(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, RasterizerStorageGLES3::Material *p_material, bool p_depth_pass); void _draw_sky(RasterizerStorageGLES3::Sky *p_sky, const CameraMatrix &p_projection, const Transform &p_transform, bool p_vflip, float p_scale, float p_energy); @@ -820,7 +821,7 @@ public: void _copy_to_front_buffer(Environment *env); void _copy_texture_to_front_buffer(GLuint p_texture); //used for debug - void _fill_render_list(InstanceBase **p_cull_result, int p_cull_count, bool p_shadow); + void _fill_render_list(InstanceBase **p_cull_result, int p_cull_count, bool p_depth_pass); void _blur_effect_buffer(); void _render_mrts(Environment *env, const CameraMatrix &p_cam_projection); diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 91ba3aa702..b99817fb12 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -165,7 +165,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ } break; case Image::FORMAT_RGB8: { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? GL_SRGB8 : GL_RGB8; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? GL_SRGB8 : GL_RGB8; r_gl_format = GL_RGB; r_gl_type = GL_UNSIGNED_BYTE; srgb = true; @@ -174,7 +174,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ case Image::FORMAT_RGBA8: { r_gl_format = GL_RGBA; - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? GL_SRGB8_ALPHA8 : GL_RGBA8; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? GL_SRGB8_ALPHA8 : GL_RGBA8; r_gl_type = GL_UNSIGNED_BYTE; srgb = true; @@ -254,7 +254,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.s3tc_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV : _EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV : _EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -270,7 +270,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.s3tc_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV : _EXT_COMPRESSED_RGBA_S3TC_DXT3_EXT; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV : _EXT_COMPRESSED_RGBA_S3TC_DXT3_EXT; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -286,7 +286,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.s3tc_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV : _EXT_COMPRESSED_RGBA_S3TC_DXT5_EXT; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV : _EXT_COMPRESSED_RGBA_S3TC_DXT5_EXT; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -331,7 +331,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.bptc_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM : _EXT_COMPRESSED_RGBA_BPTC_UNORM; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM : _EXT_COMPRESSED_RGBA_BPTC_UNORM; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -371,7 +371,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.pvrtc_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT : _EXT_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT : _EXT_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -386,7 +386,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.pvrtc_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT : _EXT_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT : _EXT_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -402,7 +402,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.pvrtc_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT : _EXT_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT : _EXT_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -418,7 +418,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.pvrtc_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT : _EXT_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT : _EXT_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -503,7 +503,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.etc2_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB8_ETC2 : _EXT_COMPRESSED_RGB8_ETC2; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB8_ETC2 : _EXT_COMPRESSED_RGB8_ETC2; r_gl_format = GL_RGB; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -518,7 +518,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.etc2_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : _EXT_COMPRESSED_RGBA8_ETC2_EAC; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : _EXT_COMPRESSED_RGBA8_ETC2_EAC; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -533,7 +533,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ if (config.etc2_supported) { - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? _EXT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 : _EXT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? _EXT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 : _EXT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; r_gl_format = GL_RGBA; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = true; @@ -560,7 +560,7 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_ } r_gl_format = GL_RGBA; - r_gl_internal_format = (config.srgb_decode_supported || p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) ? GL_SRGB8_ALPHA8 : GL_RGBA8; + r_gl_internal_format = (config.srgb_decode_supported || (p_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) ? GL_SRGB8_ALPHA8 : GL_RGBA8; r_gl_type = GL_UNSIGNED_BYTE; r_compressed = false; srgb = true; @@ -595,7 +595,6 @@ RID RasterizerStorageGLES3::texture_create() { void RasterizerStorageGLES3::texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags) { - int components; GLenum format; GLenum internal_format; GLenum type; @@ -686,7 +685,7 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p texture->ignore_mipmaps = compressed && !img->has_mipmaps(); - if (texture->flags & VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps) + if ((texture->flags & VS::TEXTURE_FLAG_MIPMAPS) && !texture->ignore_mipmaps) glTexParameteri(texture->target, GL_TEXTURE_MIN_FILTER, config.use_fast_texture_filter ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR_MIPMAP_LINEAR); else { if (texture->flags & VS::TEXTURE_FLAG_FILTER) { @@ -717,7 +716,7 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // raw Filtering } - if ((texture->flags & VS::TEXTURE_FLAG_REPEAT || texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT) && texture->target != GL_TEXTURE_CUBE_MAP) { + if (((texture->flags & VS::TEXTURE_FLAG_REPEAT) || (texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT)) && texture->target != GL_TEXTURE_CUBE_MAP) { if (texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT) { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT); @@ -770,15 +769,13 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p } } - int mipmaps = (texture->flags & VS::TEXTURE_FLAG_MIPMAPS && img->has_mipmaps()) ? img->get_mipmap_count() + 1 : 1; + int mipmaps = ((texture->flags & VS::TEXTURE_FLAG_MIPMAPS) && img->has_mipmaps()) ? img->get_mipmap_count() + 1 : 1; int w = img->get_width(); int h = img->get_height(); int tsize = 0; - int block = Image::get_format_block_size(img->get_format()); - for (int i = 0; i < mipmaps; i++) { int size, ofs; @@ -789,10 +786,6 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p if (texture->compressed) { glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - //this is not needed, as compressed takes the regular size, even if blocks extend it - //int bw = (w % block != 0) ? w + (block - w % block) : w; - //int bh = (h % block != 0) ? h + (block - h % block) : h; - int bw = w; int bh = h; @@ -820,7 +813,7 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p texture->stored_cube_sides |= (1 << p_cube_side); - if (texture->flags & VS::TEXTURE_FLAG_MIPMAPS && mipmaps == 1 && !texture->ignore_mipmaps && (!(texture->flags & VS::TEXTURE_FLAG_CUBEMAP) || texture->stored_cube_sides == (1 << 6) - 1)) { + if ((texture->flags & VS::TEXTURE_FLAG_MIPMAPS) && mipmaps == 1 && !texture->ignore_mipmaps && (!(texture->flags & VS::TEXTURE_FLAG_CUBEMAP) || texture->stored_cube_sides == (1 << 6) - 1)) { //generate mipmaps if they were requested and the image does not contain them glGenerateMipmap(texture->target); } else if (mipmaps > 1) { @@ -912,7 +905,7 @@ void RasterizerStorageGLES3::texture_set_flags(RID p_texture, uint32_t p_flags) uint32_t cube = texture->flags & VS::TEXTURE_FLAG_CUBEMAP; texture->flags = p_flags | cube; // can't remove a cube from being a cube - if ((texture->flags & VS::TEXTURE_FLAG_REPEAT || texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT) && texture->target != GL_TEXTURE_CUBE_MAP) { + if (((texture->flags & VS::TEXTURE_FLAG_REPEAT) || (texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT)) && texture->target != GL_TEXTURE_CUBE_MAP) { if (texture->flags & VS::TEXTURE_FLAG_MIRRORED_REPEAT) { glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT); @@ -937,7 +930,7 @@ void RasterizerStorageGLES3::texture_set_flags(RID p_texture, uint32_t p_flags) } } - if (texture->flags & VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps) { + if ((texture->flags & VS::TEXTURE_FLAG_MIPMAPS) && !texture->ignore_mipmaps) { if (!had_mipmaps && texture->mipmaps == 1) { glGenerateMipmap(texture->target); } @@ -1584,6 +1577,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const { shaders.actions_canvas.usage_flag_pointers["SCREEN_UV"] = &p_shader->canvas_item.uses_screen_uv; shaders.actions_canvas.usage_flag_pointers["SCREEN_PIXEL_SIZE"] = &p_shader->canvas_item.uses_screen_uv; shaders.actions_canvas.usage_flag_pointers["SCREEN_TEXTURE"] = &p_shader->canvas_item.uses_screen_texture; + shaders.actions_canvas.usage_flag_pointers["TIME"] = &p_shader->canvas_item.uses_time; actions = &shaders.actions_canvas; actions->uniforms = &p_shader->uniforms; @@ -1632,6 +1626,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const { shaders.actions_scene.usage_flag_pointers["SSS_STRENGTH"] = &p_shader->spatial.uses_sss; shaders.actions_scene.usage_flag_pointers["DISCARD"] = &p_shader->spatial.uses_discard; shaders.actions_scene.usage_flag_pointers["SCREEN_TEXTURE"] = &p_shader->spatial.uses_screen_texture; + shaders.actions_scene.usage_flag_pointers["TIME"] = &p_shader->spatial.uses_time; shaders.actions_scene.write_flag_pointers["MODELVIEW_MATRIX"] = &p_shader->spatial.writes_modelview_or_projection; shaders.actions_scene.write_flag_pointers["PROJECTION_MATRIX"] = &p_shader->spatial.writes_modelview_or_projection; @@ -3358,7 +3353,7 @@ Rect3 RasterizerStorageGLES3::mesh_get_aabb(RID p_mesh, RID p_skeleton) const { for (int i = 0; i < mesh->surfaces.size(); i++) { Rect3 laabb; - if (mesh->surfaces[i]->format & VS::ARRAY_FORMAT_BONES && mesh->surfaces[i]->skeleton_bone_aabb.size()) { + if ((mesh->surfaces[i]->format & VS::ARRAY_FORMAT_BONES) && mesh->surfaces[i]->skeleton_bone_aabb.size()) { int bs = mesh->surfaces[i]->skeleton_bone_aabb.size(); const Rect3 *skbones = mesh->surfaces[i]->skeleton_bone_aabb.ptr(); @@ -4471,6 +4466,7 @@ RID RasterizerStorageGLES3::light_create(VS::LightType p_type) { light->omni_shadow_mode = VS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID; light->omni_shadow_detail = VS::LIGHT_OMNI_SHADOW_DETAIL_VERTICAL; light->directional_blend_splits = false; + light->directional_range_mode = VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE; light->reverse_cull = false; light->version = 0; @@ -4623,6 +4619,22 @@ VS::LightDirectionalShadowMode RasterizerStorageGLES3::light_directional_get_sha return light->directional_shadow_mode; } +void RasterizerStorageGLES3::light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode) { + + Light *light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + + light->directional_range_mode = p_range_mode; +} + +VS::LightDirectionalShadowDepthRangeMode RasterizerStorageGLES3::light_directional_get_shadow_depth_range_mode(RID p_light) const { + + const Light *light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light, VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE); + + return light->directional_range_mode; +} + VS::LightType RasterizerStorageGLES3::light_get_type(RID p_light) const { const Light *light = light_owner.getornull(p_light); @@ -6845,42 +6857,28 @@ int RasterizerStorageGLES3::get_captured_render_info(VS::RenderInfo p_info) { int RasterizerStorageGLES3::get_render_info(VS::RenderInfo p_info) { switch (p_info) { - case VS::INFO_OBJECTS_IN_FRAME: { - + case VS::INFO_OBJECTS_IN_FRAME: return info.render_final.object_count; - } break; - case VS::INFO_VERTICES_IN_FRAME: { - + case VS::INFO_VERTICES_IN_FRAME: return info.render_final.vertices_count; - } break; - case VS::INFO_MATERIAL_CHANGES_IN_FRAME: { + case VS::INFO_MATERIAL_CHANGES_IN_FRAME: return info.render_final.material_switch_count; - } break; - case VS::INFO_SHADER_CHANGES_IN_FRAME: { + case VS::INFO_SHADER_CHANGES_IN_FRAME: return info.render_final.shader_rebind_count; - } break; - case VS::INFO_SURFACE_CHANGES_IN_FRAME: { + case VS::INFO_SURFACE_CHANGES_IN_FRAME: return info.render_final.surface_switch_count; - } break; - case VS::INFO_DRAW_CALLS_IN_FRAME: { + case VS::INFO_DRAW_CALLS_IN_FRAME: return info.render_final.draw_call_count; - } break; - case VS::INFO_USAGE_VIDEO_MEM_TOTAL: { - + case VS::INFO_USAGE_VIDEO_MEM_TOTAL: return 0; //no idea - } break; - case VS::INFO_VIDEO_MEM_USED: { - + case VS::INFO_VIDEO_MEM_USED: return info.vertex_mem + info.texture_mem; - } break; - case VS::INFO_TEXTURE_MEM_USED: { - + case VS::INFO_TEXTURE_MEM_USED: return info.texture_mem; - } break; - case VS::INFO_VERTEX_MEM_USED: { - + case VS::INFO_VERTEX_MEM_USED: return info.vertex_mem; - } break; + default: + return 0; //no idea either } } diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index f75b77aabe..6abc22b643 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -410,6 +410,7 @@ public: int light_mode; bool uses_screen_texture; bool uses_screen_uv; + bool uses_time; } canvas_item; @@ -449,6 +450,7 @@ public: bool uses_discard; bool uses_sss; bool uses_screen_texture; + bool uses_time; bool writes_modelview_or_projection; bool uses_vertex_lighting; @@ -877,6 +879,7 @@ public: VS::LightOmniShadowMode omni_shadow_mode; VS::LightOmniShadowDetail omni_shadow_detail; VS::LightDirectionalShadowMode directional_shadow_mode; + VS::LightDirectionalShadowDepthRangeMode directional_range_mode; bool directional_blend_splits; uint64_t version; }; @@ -904,6 +907,9 @@ public: virtual VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light); virtual VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light); + virtual void light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode); + virtual VS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const; + virtual bool light_has_shadow(RID p_light) const; virtual VS::LightType light_get_type(RID p_light) const; diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp index c308e9eddb..419decce29 100644 --- a/drivers/gles3/shader_compiler_gles3.cpp +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -438,26 +438,44 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener SL::BlockNode *bnode = (SL::BlockNode *)p_node; //variables - code += _mktab(p_level - 1) + "{\n"; - for (Map<StringName, SL::BlockNode::Variable>::Element *E = bnode->variables.front(); E; E = E->next()) { - - code += _mktab(p_level) + _prestr(E->get().precision) + _typestr(E->get().type) + " " + _mkid(E->key()) + ";\n"; + if (!bnode->single_statement) { + code += _mktab(p_level - 1) + "{\n"; } - + for (int i = 0; i < bnode->statements.size(); i++) { String scode = _dump_node_code(bnode->statements[i], p_level, r_gen_code, p_actions, p_default_actions); - if (bnode->statements[i]->type == SL::Node::TYPE_CONTROL_FLOW || bnode->statements[i]->type == SL::Node::TYPE_CONTROL_FLOW) { - // FIXME: if (A || A) ? I am hesitant to delete one of them, could be copy-paste error. + if (bnode->statements[i]->type == SL::Node::TYPE_CONTROL_FLOW || bnode->single_statement ) { code += scode; //use directly } else { code += _mktab(p_level) + scode + ";\n"; } } - code += _mktab(p_level - 1) + "}\n"; + if (!bnode->single_statement) { + code += _mktab(p_level - 1) + "}\n"; + } } break; + case SL::Node::TYPE_VARIABLE_DECLARATION: { + SL::VariableDeclarationNode *vdnode = (SL::VariableDeclarationNode *)p_node; + + String declaration = _prestr(vdnode->precision) + _typestr(vdnode->datatype); + for(int i=0;i<vdnode->declarations.size();i++) { + if (i>0) { + declaration+=","; + } else { + declaration+=" "; + } + declaration += _mkid(vdnode->declarations[i].name); + if (vdnode->declarations[i].initializer) { + declaration+="="; + declaration+=_dump_node_code(vdnode->declarations[i].initializer, p_level, r_gen_code, p_actions, p_default_actions); + } + } + + code+=declaration; + } break; case SL::Node::TYPE_VARIABLE: { SL::VariableNode *vnode = (SL::VariableNode *)p_node; @@ -600,6 +618,13 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener code += _mktab(p_level) + "while (" + _dump_node_code(cfnode->expressions[0], p_level, r_gen_code, p_actions, p_default_actions) + ")\n"; code += _dump_node_code(cfnode->blocks[0], p_level + 1, r_gen_code, p_actions, p_default_actions); + } else if (cfnode->flow_op == SL::FLOW_OP_FOR) { + + String left = _dump_node_code(cfnode->blocks[0], p_level, r_gen_code, p_actions, p_default_actions); + String middle = _dump_node_code(cfnode->expressions[0], p_level, r_gen_code, p_actions, p_default_actions); + String right = _dump_node_code(cfnode->expressions[1], p_level, r_gen_code, p_actions, p_default_actions); + code += _mktab(p_level) + "for (" +left+";"+middle+";"+right+")\n"; + code += _dump_node_code(cfnode->blocks[1], p_level + 1, r_gen_code, p_actions, p_default_actions); } else if (cfnode->flow_op == SL::FLOW_OP_RETURN) { @@ -611,6 +636,12 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener } else if (cfnode->flow_op == SL::FLOW_OP_DISCARD) { code = "discard;"; + } else if (cfnode->flow_op == SL::FLOW_OP_CONTINUE) { + + code = "continue;"; + } else if (cfnode->flow_op == SL::FLOW_OP_BREAK) { + + code = "break;"; } } break; @@ -751,8 +782,9 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].renames["CLEARCOAT_GLOSS"] = "clearcoat_gloss"; actions[VS::SHADER_SPATIAL].renames["ANISOTROPY"] = "anisotropy"; actions[VS::SHADER_SPATIAL].renames["ANISOTROPY_FLOW"] = "anisotropy_flow"; - actions[VS::SHADER_SPATIAL].renames["SSS_SPREAD"] = "sss_spread"; + //actions[VS::SHADER_SPATIAL].renames["SSS_SPREAD"] = "sss_spread"; actions[VS::SHADER_SPATIAL].renames["SSS_STRENGTH"] = "sss_strength"; + actions[VS::SHADER_SPATIAL].renames["TRANSMISSION"] = "transmission"; actions[VS::SHADER_SPATIAL].renames["AO"] = "ao"; actions[VS::SHADER_SPATIAL].renames["EMISSION"] = "emission"; //actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2; @@ -782,6 +814,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].usage_defines["ALPHA_SCISSOR"] = "#define ALPHA_SCISSOR_USED\n"; actions[VS::SHADER_SPATIAL].usage_defines["SSS_STRENGTH"] = "#define ENABLE_SSS\n"; + actions[VS::SHADER_SPATIAL].usage_defines["TRANSMISSION"] = "#define TRANSMISSION_USED\n"; actions[VS::SHADER_SPATIAL].usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n"; actions[VS::SHADER_SPATIAL].usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n"; @@ -792,7 +825,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() { actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_oren_nayar"] = "#define DIFFUSE_OREN_NAYAR\n"; - actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_half_lambert"] = "#define DIFFUSE_HALF_LAMBERT\n"; + actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n"; actions[VS::SHADER_SPATIAL].render_mode_defines["specular_blinn"] = "#define SPECULAR_BLINN\n"; diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index 37187a86cc..bf8eaf601d 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -116,7 +116,7 @@ void main() { #ifdef USE_TEXTURE_RECT - if (dst_rect.z < 0) { // Transpose is encoded as negative dst_rect.z + if (dst_rect.z < 0.0) { // Transpose is encoded as negative dst_rect.z uv_interp = src_rect.xy + abs(src_rect.zw) * vertex.yx; } else { uv_interp = src_rect.xy + abs(src_rect.zw) * vertex; @@ -139,7 +139,7 @@ void main() { float frame_w = 1.0/float(h_frames); float frame_h = 1.0/float(v_frames); uv_interp.x = uv_interp.x * frame_w + frame_w * float(frame % h_frames); - uv_interp.y = uv_interp.y * frame_h + frame_h * float(frame / v_frames); + uv_interp.y = uv_interp.y * frame_h + frame_h * float(frame / h_frames); #endif @@ -585,6 +585,20 @@ FRAGMENT_SHADER_CODE #endif +#ifdef SHADOW_FILTER_PCF7 + + SHADOW_TEST(su+shadowpixel_size*3.0); + SHADOW_TEST(su+shadowpixel_size*2.0); + SHADOW_TEST(su+shadowpixel_size); + SHADOW_TEST(su); + SHADOW_TEST(su-shadowpixel_size); + SHADOW_TEST(su-shadowpixel_size*2.0); + SHADOW_TEST(su-shadowpixel_size*3.0); + shadow_attenuation/=7.0; + +#endif + + #ifdef SHADOW_FILTER_PCF9 SHADOW_TEST(su+shadowpixel_size*4.0); diff --git a/drivers/gles3/shaders/effect_blur.glsl b/drivers/gles3/shaders/effect_blur.glsl index 09e522866c..b5f98a1244 100644 --- a/drivers/gles3/shaders/effect_blur.glsl +++ b/drivers/gles3/shaders/effect_blur.glsl @@ -168,7 +168,11 @@ void main() { float depth = textureLod( dof_source_depth, uv_interp, 0.0).r; depth = depth * 2.0 - 1.0; +#ifdef USE_ORTHOGONAL_PROJECTION + depth = ((depth + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; +#else depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth * (camera_z_far - camera_z_near)); +#endif float amount = smoothstep(dof_begin,dof_end,depth); float k_accum=0.0; @@ -182,8 +186,11 @@ void main() { float tap_depth = texture( dof_source_depth, tap_uv, 0.0).r; tap_depth = tap_depth * 2.0 - 1.0; +#ifdef USE_ORTHOGONAL_PROJECTION + tap_depth = ((tap_depth + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; +#else tap_depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - tap_depth * (camera_z_far - camera_z_near)); - +#endif float tap_amount = mix(smoothstep(dof_begin,dof_end,tap_depth),1.0,int_ofs==0); tap_amount*=tap_amount*tap_amount; //prevent undesired glow effect @@ -221,7 +228,11 @@ void main() { float tap_depth = texture( dof_source_depth, tap_uv, 0.0).r; tap_depth = tap_depth * 2.0 - 1.0; +#ifdef USE_ORTHOGONAL_PROJECTION + tap_depth = ((tap_depth + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; +#else tap_depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - tap_depth * (camera_z_far - camera_z_near)); +#endif float tap_amount = 1.0-smoothstep(dof_end,dof_begin,tap_depth); tap_amount*=tap_amount*tap_amount; //prevent undesired glow effect diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index ef4925895c..5f83033293 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -484,7 +484,7 @@ VERTEX_SHADER_CODE vec3 directional_diffuse = vec3(0.0); vec3 directional_specular = vec3(0.0); - light_compute(normal_interp,-light_direction_attenuation.xyz,-normalize( vertex_interp ),normal_interp,roughness,directional_diffuse,directional_specular); + light_compute(normal_interp,-light_direction_attenuation.xyz,-normalize( vertex_interp ),light_color_energy.rgb,roughness,directional_diffuse,directional_specular); float diff_avg = dot(diffuse_light_interp.rgb,vec3(0.33333)); float diff_dir_avg = dot(directional_diffuse,vec3(0.33333)); @@ -887,7 +887,7 @@ float GTR1(float NdotH, float a) -void light_compute(vec3 N, vec3 L,vec3 V,vec3 B, vec3 T,vec3 light_color,vec3 diffuse_color, float specular_blob_intensity, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,inout vec3 diffuse, inout vec3 specular) { +void light_compute(vec3 N, vec3 L,vec3 V,vec3 B, vec3 T,vec3 light_color,vec3 diffuse_color, vec3 transmission, float specular_blob_intensity, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,inout vec3 diffuse, inout vec3 specular) { #if defined(USE_LIGHT_SHADER_CODE) //light is written by the light shader @@ -900,10 +900,16 @@ LIGHT_SHADER_CODE float dotNL = max(dot(N,L), 0.0 ); -#if defined(DIFFUSE_HALF_LAMBERT) +#if defined(DIFFUSE_OREN_NAYAR) + vec3 light_amount; +#else + float light_amount; +#endif + - float hl = dot(N,L) * 0.5 + 0.5; - diffuse += hl * light_color * diffuse_color; +#if defined(DIFFUSE_LAMBERT_WRAP) + //energy conserving lambert wrap shader + light_amount = max(0.0,(dot(N,L) + roughness) / ((1.0 + roughness) * (1.0 + roughness))); #elif defined(DIFFUSE_OREN_NAYAR) @@ -919,31 +925,46 @@ LIGHT_SHADER_CODE vec3 A = 1.0 + sigma2 * (diffuse_color / (sigma2 + 0.13) + 0.5 / (sigma2 + 0.33)); float B = 0.45 * sigma2 / (sigma2 + 0.09); - diffuse += diffuse_color * max(0.0, NdotL) * (A + vec3(B) * s / t) / M_PI; + light_amount = max(0.0, NdotL) * (A + vec3(B) * s / t) / M_PI; } #elif defined(DIFFUSE_TOON) - diffuse += smoothstep(-roughness,max(roughness,0.01),dot(N,L)) * light_color * diffuse_color; + light_amount = smoothstep(-roughness,max(roughness,0.01),dot(N,L)); #elif defined(DIFFUSE_BURLEY) { - float NdotL = dot(L, N); - float NdotV = dot(N, V); - float VdotH = dot(N, normalize(L+V)); + + + vec3 H = normalize(V + L); + float NoL = max(0.0,dot(N, L)); + float VoH = max(0.0,dot(L, H)); + float NoV = max(0.0,dot(N, V)); + + float FD90 = 0.5 + 2.0 * VoH * VoH * roughness; + float FdV = 1.0 + (FD90 - 1.0) * pow( 1.0 - NoV, 5.0 ); + float FdL = 1.0 + (FD90 - 1.0) * pow( 1.0 - NoL, 5.0 ); + light_amount = ( (1.0 / M_PI) * FdV * FdL ); +/* float energyBias = mix(roughness, 0.0, 0.5); float energyFactor = mix(roughness, 1.0, 1.0 / 1.51); - float fd90 = energyBias + 2.0 * VdotH * VdotH * roughness; + float fd90 = energyBias + 2.0 * VoH * VoH * roughness; float f0 = 1.0; - float lightScatter = f0 + (fd90 - f0) * pow(1.0 - NdotL, 5.0); - float viewScatter = f0 + (fd90 - f0) * pow(1.0 - NdotV, 5.0); + float lightScatter = f0 + (fd90 - f0) * pow(1.0 - NoL, 5.0); + float viewScatter = f0 + (fd90 - f0) * pow(1.0 - NoV, 5.0); - diffuse+= light_color * diffuse_color * lightScatter * viewScatter * energyFactor; + light_amount = lightScatter * viewScatter * energyFactor;*/ } #else //lambert - diffuse += dotNL * light_color * diffuse_color; + light_amount = dotNL; +#endif + +#if defined(TRANSMISSION_USED) + diffuse += light_color * diffuse_color * mix(vec3(light_amount),vec3(1.0),transmission); +#else + diffuse += light_color * diffuse_color * light_amount; #endif @@ -1116,7 +1137,7 @@ vec3 light_transmittance(float translucency,vec3 light_vec, vec3 normal, vec3 po } #endif -void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 binormal, vec3 tangent, vec3 albedo, float roughness, float rim, float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,float p_blob_intensity,inout vec3 diffuse_light, inout vec3 specular_light) { +void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 binormal, vec3 tangent, vec3 albedo, vec3 transmission, float roughness, float rim, float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,float p_blob_intensity,inout vec3 diffuse_light, inout vec3 specular_light) { vec3 light_rel_vec = omni_lights[idx].light_pos_inv_radius.xyz-vertex; float light_length = length( light_rel_vec ); @@ -1170,11 +1191,11 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 bino light_attenuation*=mix(omni_lights[idx].shadow_color_contact.rgb,vec3(1.0),shadow); } - light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,omni_lights[idx].light_color_energy.rgb*light_attenuation,albedo,omni_lights[idx].light_params.z*p_blob_intensity,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); + light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,omni_lights[idx].light_color_energy.rgb*light_attenuation,albedo,transmission,omni_lights[idx].light_params.z*p_blob_intensity,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); } -void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 binormal, vec3 tangent,vec3 albedo, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,float p_blob_intensity, inout vec3 diffuse_light, inout vec3 specular_light) { +void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 binormal, vec3 tangent,vec3 albedo, vec3 transmission,float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,float p_blob_intensity, inout vec3 diffuse_light, inout vec3 specular_light) { vec3 light_rel_vec = spot_lights[idx].light_pos_inv_radius.xyz-vertex; float light_length = length( light_rel_vec ); @@ -1204,7 +1225,7 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi light_attenuation*=mix(spot_lights[idx].shadow_color_contact.rgb,vec3(1.0),shadow); } - light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,spot_lights[idx].light_color_energy.rgb*light_attenuation,albedo,spot_lights[idx].light_params.z*p_blob_intensity,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); + light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,spot_lights[idx].light_color_energy.rgb*light_attenuation,albedo,transmission,spot_lights[idx].light_params.z*p_blob_intensity,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); } @@ -1499,6 +1520,7 @@ void main() { //lay out everything, whathever is unused is optimized away anyway highp vec3 vertex = vertex_interp; vec3 albedo = vec3(0.8,0.8,0.8); + vec3 transmission = vec3(0.0); float metallic = 0.0; float specular = 0.5; vec3 emission = vec3(0.0,0.0,0.0); @@ -1577,6 +1599,12 @@ FRAGMENT_SHADER_CODE } #endif +#ifdef USE_OPAQUE_PREPASS + + if (alpha<0.99) { + discard; + } +#endif #if defined(ENABLE_NORMALMAP) @@ -1678,9 +1706,16 @@ FRAGMENT_SHADER_CODE vec3 light_attenuation=vec3(1.0); + float depth_z = -vertex.z; #ifdef LIGHT_DIRECTIONAL_SHADOW - if (gl_FragCoord.w > shadow_split_offsets.w) { +#ifdef LIGHT_USE_PSSM4 + if (depth_z < shadow_split_offsets.w) { +#elif defined(LIGHT_USE_PSSM2) + if (depth_z < shadow_split_offsets.y) { +#else + if (depth_z < shadow_split_offsets.x) { +#endif //LIGHT_USE_PSSM4 vec3 pssm_coord; float pssm_fade=0.0; @@ -1689,17 +1724,15 @@ FRAGMENT_SHADER_CODE float pssm_blend; vec3 pssm_coord2; bool use_blend=true; - vec3 light_pssm_split_inv = 1.0/shadow_split_offsets.xyz; - float w_inv = 1.0/gl_FragCoord.w; #endif #ifdef LIGHT_USE_PSSM4 - if (gl_FragCoord.w > shadow_split_offsets.y) { + if (depth_z < shadow_split_offsets.y) { - if (gl_FragCoord.w > shadow_split_offsets.x) { + if (depth_z < shadow_split_offsets.x) { highp vec4 splane=(shadow_matrix1 * vec4(vertex,1.0)); pssm_coord=splane.xyz/splane.w; @@ -1709,7 +1742,7 @@ FRAGMENT_SHADER_CODE splane=(shadow_matrix2 * vec4(vertex,1.0)); pssm_coord2=splane.xyz/splane.w; - pssm_blend=smoothstep(0.0,light_pssm_split_inv.x,w_inv); + pssm_blend=smoothstep(0.0,shadow_split_offsets.x,depth_z); #endif } else { @@ -1720,14 +1753,14 @@ FRAGMENT_SHADER_CODE #if defined(LIGHT_USE_PSSM_BLEND) splane=(shadow_matrix3 * vec4(vertex,1.0)); pssm_coord2=splane.xyz/splane.w; - pssm_blend=smoothstep(light_pssm_split_inv.x,light_pssm_split_inv.y,w_inv); + pssm_blend=smoothstep(shadow_split_offsets.x,shadow_split_offsets.y,depth_z); #endif } } else { - if (gl_FragCoord.w > shadow_split_offsets.z) { + if (depth_z < shadow_split_offsets.z) { highp vec4 splane=(shadow_matrix3 * vec4(vertex,1.0)); pssm_coord=splane.xyz/splane.w; @@ -1735,13 +1768,14 @@ FRAGMENT_SHADER_CODE #if defined(LIGHT_USE_PSSM_BLEND) splane=(shadow_matrix4 * vec4(vertex,1.0)); pssm_coord2=splane.xyz/splane.w; - pssm_blend=smoothstep(light_pssm_split_inv.y,light_pssm_split_inv.z,w_inv); + pssm_blend=smoothstep(shadow_split_offsets.y,shadow_split_offsets.z,depth_z); #endif } else { + highp vec4 splane=(shadow_matrix4 * vec4(vertex,1.0)); pssm_coord=splane.xyz/splane.w; - pssm_fade = smoothstep(shadow_split_offsets.z,shadow_split_offsets.w,gl_FragCoord.w); + pssm_fade = smoothstep(shadow_split_offsets.z,shadow_split_offsets.w,depth_z); #if defined(LIGHT_USE_PSSM_BLEND) use_blend=false; @@ -1757,7 +1791,7 @@ FRAGMENT_SHADER_CODE #ifdef LIGHT_USE_PSSM2 - if (gl_FragCoord.w > shadow_split_offsets.x) { + if (depth_z < shadow_split_offsets.x) { highp vec4 splane=(shadow_matrix1 * vec4(vertex,1.0)); pssm_coord=splane.xyz/splane.w; @@ -1767,13 +1801,13 @@ FRAGMENT_SHADER_CODE splane=(shadow_matrix2 * vec4(vertex,1.0)); pssm_coord2=splane.xyz/splane.w; - pssm_blend=smoothstep(0.0,light_pssm_split_inv.x,w_inv); + pssm_blend=smoothstep(0.0,shadow_split_offsets.x,depth_z); #endif } else { highp vec4 splane=(shadow_matrix2 * vec4(vertex,1.0)); pssm_coord=splane.xyz/splane.w; - pssm_fade = smoothstep(shadow_split_offsets.x,shadow_split_offsets.y,gl_FragCoord.w); + pssm_fade = smoothstep(shadow_split_offsets.x,shadow_split_offsets.y,depth_z); #if defined(LIGHT_USE_PSSM_BLEND) use_blend=false; @@ -1815,6 +1849,7 @@ FRAGMENT_SHADER_CODE } + #endif //LIGHT_DIRECTIONAL_SHADOW #ifdef USE_VERTEX_LIGHTING @@ -1822,7 +1857,7 @@ FRAGMENT_SHADER_CODE specular_light*=mix(vec3(1.0),light_attenuation,specular_light_interp.a); #else - light_compute(normal,-light_direction_attenuation.xyz,eye_vec,binormal,tangent,light_color_energy.rgb*light_attenuation,albedo,light_params.z*specular_blob_intensity,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); + light_compute(normal,-light_direction_attenuation.xyz,eye_vec,binormal,tangent,light_color_energy.rgb*light_attenuation,albedo,transmission,light_params.z*specular_blob_intensity,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); #endif @@ -1860,11 +1895,11 @@ FRAGMENT_SHADER_CODE #else for(int i=0;i<omni_light_count;i++) { - light_process_omni(omni_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,specular_blob_intensity,diffuse_light,specular_light); + light_process_omni(omni_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,transmission,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,specular_blob_intensity,diffuse_light,specular_light); } for(int i=0;i<spot_light_count;i++) { - light_process_spot(spot_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,specular_blob_intensity,diffuse_light,specular_light); + light_process_spot(spot_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,transmission,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,specular_blob_intensity,diffuse_light,specular_light); } #endif //USE_VERTEX_LIGHTING diff --git a/drivers/gles3/shaders/screen_space_reflection.glsl b/drivers/gles3/shaders/screen_space_reflection.glsl index cc41d36c37..b2e6f7a736 100644 --- a/drivers/gles3/shaders/screen_space_reflection.glsl +++ b/drivers/gles3/shaders/screen_space_reflection.glsl @@ -56,7 +56,6 @@ vec2 view_to_screen(vec3 view_pos,out float w) { #define M_PI 3.14159265359 - void main() { @@ -158,8 +157,13 @@ void main() { w+=w_advance; //convert to linear depth + depth = texture(source_depth, pos*pixel_size).r * 2.0 - 1.0; +#ifdef USE_ORTHOGONAL_PROJECTION + depth = ((depth + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; +#else depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth * (camera_z_far - camera_z_near)); +#endif depth=-depth; z_from = z_to; diff --git a/drivers/gles3/shaders/ssao.glsl b/drivers/gles3/shaders/ssao.glsl index 0e8fc89d6c..c668e63745 100644 --- a/drivers/gles3/shaders/ssao.glsl +++ b/drivers/gles3/shaders/ssao.glsl @@ -65,7 +65,12 @@ layout(location = 0) out float visibility; uniform vec4 proj_info; vec3 reconstructCSPosition(vec2 S, float z) { - return vec3((S.xy * proj_info.xy + proj_info.zw) * z, z); +#ifdef USE_ORTHOGONAL_PROJECTION + return vec3((S.xy * proj_info.xy + proj_info.zw), z); +#else + return vec3((S.xy * proj_info.xy + proj_info.zw) * z, z); + +#endif } vec3 getPosition(ivec2 ssP) { @@ -73,7 +78,11 @@ vec3 getPosition(ivec2 ssP) { P.z = texelFetch(source_depth, ssP, 0).r; P.z = P.z * 2.0 - 1.0; +#ifdef USE_ORTHOGONAL_PROJECTION + P.z = ((P.z + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; +#else P.z = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - P.z * (camera_z_far - camera_z_near)); +#endif P.z = -P.z; // Offset to pixel center @@ -118,7 +127,12 @@ vec3 getOffsetPosition(ivec2 ssC, vec2 unitOffset, float ssR) { //read from depth buffer P.z = texelFetch(source_depth, mipP, 0).r; P.z = P.z * 2.0 - 1.0; +#ifdef USE_ORTHOGONAL_PROJECTION + P.z = ((P.z + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; +#else P.z = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - P.z * (camera_z_far - camera_z_near)); + +#endif P.z = -P.z; } else { @@ -214,8 +228,11 @@ void main() { // Choose the screen-space sample radius // proportional to the projected area of the sphere +#ifdef USE_ORTHOGONAL_PROJECTION + float ssDiskRadius = -proj_scale * radius; +#else float ssDiskRadius = -proj_scale * radius / C.z; - +#endif float sum = 0.0; for (int i = 0; i < NUM_SAMPLES; ++i) { sum += sampleAO(ssC, C, n_C, ssDiskRadius, radius,i, randomPatternRotationAngle); diff --git a/drivers/gles3/shaders/ssao_minify.glsl b/drivers/gles3/shaders/ssao_minify.glsl index 6e46a1842c..647c762438 100644 --- a/drivers/gles3/shaders/ssao_minify.glsl +++ b/drivers/gles3/shaders/ssao_minify.glsl @@ -41,7 +41,11 @@ void main() { #ifdef MINIFY_START float fdepth = texelFetch(source_depth, clamp(ssP * 2 + ivec2(ssP.y & 1, ssP.x & 1), ivec2(0), from_size - ivec2(1)), source_mipmap).r; fdepth = fdepth * 2.0 - 1.0; +#ifdef USE_ORTHOGONAL_PROJECTION + fdepth = ((fdepth + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; +#else fdepth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - fdepth * (camera_z_far - camera_z_near)); +#endif fdepth /= camera_z_far; depth = uint(clamp(fdepth*65535.0,0.0,65535.0)); diff --git a/drivers/gles3/shaders/subsurf_scattering.glsl b/drivers/gles3/shaders/subsurf_scattering.glsl index 8873443727..20c3b7473f 100644 --- a/drivers/gles3/shaders/subsurf_scattering.glsl +++ b/drivers/gles3/shaders/subsurf_scattering.glsl @@ -17,36 +17,36 @@ void main() { //#define QUALIFIER uniform // some guy on the interweb says it may be faster with this #define QUALIFIER const + #ifdef USE_25_SAMPLES const int kernel_size=25; - QUALIFIER vec2 kernel[25] = vec2[] ( -vec2(0.099654,0.0), -vec2(0.001133,-3.0), -vec2(0.002316,-2.52083), -vec2(0.00445,-2.08333), -vec2(0.008033,-1.6875), -vec2(0.013627,-1.33333), -vec2(0.021724,-1.02083), -vec2(0.032542,-0.75), -vec2(0.04581,-0.520833), -vec2(0.0606,-0.333333), -vec2(0.075333,-0.1875), -vec2(0.088001,-0.0833333), -vec2(0.096603,-0.0208333), -vec2(0.096603,0.0208333), -vec2(0.088001,0.0833333), -vec2(0.075333,0.1875), -vec2(0.0606,0.333333), -vec2(0.04581,0.520833), -vec2(0.032542,0.75), -vec2(0.021724,1.02083), -vec2(0.013627,1.33333), -vec2(0.008033,1.6875), -vec2(0.00445,2.08333), -vec2(0.002316,2.52), -vec2(0.001133,3.0) + vec2(0.530605, 0.0), + vec2(0.000973794, -3.0), + vec2(0.00333804, -2.52083), + vec2(0.00500364, -2.08333), + vec2(0.00700976, -1.6875), + vec2(0.0094389, -1.33333), + vec2(0.0128496, -1.02083), + vec2(0.017924, -0.75), + vec2(0.0263642, -0.520833), + vec2(0.0410172, -0.333333), + vec2(0.0493588, -0.1875), + vec2(0.0402784, -0.0833333), + vec2(0.0211412, -0.0208333), + vec2(0.0211412, 0.0208333), + vec2(0.0402784, 0.0833333), + vec2(0.0493588, 0.1875), + vec2(0.0410172, 0.333333), + vec2(0.0263642, 0.520833), + vec2(0.017924, 0.75), + vec2(0.0128496, 1.02083), + vec2(0.0094389, 1.33333), + vec2(0.00700976, 1.6875), + vec2(0.00500364, 2.08333), + vec2(0.00333804, 2.52083), + vec2(0.000973794, 3.0) ); #endif //USE_25_SAMPLES @@ -56,23 +56,23 @@ vec2(0.001133,3.0) const int kernel_size=17; QUALIFIER vec2 kernel[17] = vec2[]( -vec2(0.197417,0.0), -vec2(0.000078,-2.0), -vec2(0.000489,-1.53125), -vec2(0.002403,-1.125), -vec2(0.009245,-0.78125), -vec2(0.027835,-0.5), -vec2(0.065592,-0.28125), -vec2(0.12098,-0.125), -vec2(0.17467,-0.03125), -vec2(0.17467,0.03125), -vec2(0.12098,0.125), -vec2(0.065592,0.28125), -vec2(0.027835,0.5), -vec2(0.009245,0.78125), -vec2(0.002403,1.125), -vec2(0.000489,1.53125), -vec2(0.000078,2.0) + vec2(0.536343, 0.0), + vec2(0.00317394, -2.0), + vec2(0.0100386, -1.53125), + vec2(0.0144609, -1.125), + vec2(0.0216301, -0.78125), + vec2(0.0347317, -0.5), + vec2(0.0571056, -0.28125), + vec2(0.0582416, -0.125), + vec2(0.0324462, -0.03125), + vec2(0.0324462, 0.03125), + vec2(0.0582416, 0.125), + vec2(0.0571056, 0.28125), + vec2(0.0347317, 0.5), + vec2(0.0216301, 0.78125), + vec2(0.0144609, 1.125), + vec2(0.0100386, 1.53125), + vec2(0.00317394,2.0) ); #endif //USE_17_SAMPLES @@ -82,23 +82,24 @@ vec2(0.000078,2.0) const int kernel_size=11; -QUALIFIER vec2 kernel[kernel_size] = vec2[]( -vec2(0.198596,0.0), -vec2(0.0093,-2.0), -vec2(0.028002,-1.28), -vec2(0.065984,-0.72), -vec2(0.121703,-0.32), -vec2(0.175713,-0.08), -vec2(0.175713,0.08), -vec2(0.121703,0.32), -vec2(0.065984,0.72), -vec2(0.028002,1.28), -vec2(0.0093,2.0) +QUALIFIER vec4 kernel[11] = vec4[]( + vec4(0.560479, 0.0), + vec4(0.00471691, -2.0), + vec4(0.0192831, -1.28), + vec4(0.03639, -0.72), + vec4(0.0821904, -0.32), + vec4(0.0771802, -0.08), + vec4(0.0771802, 0.08), + vec4(0.0821904, 0.32), + vec4(0.03639, 0.72), + vec4(0.0192831, 1.28), + vec4(0.00471691,2.0) ); #endif //USE_11_SAMPLES + uniform float max_radius; uniform float camera_z_far; uniform float camera_z_near; @@ -126,12 +127,16 @@ void main() { // Fetch linear depth of current pixel: float depth = texture(source_depth, uv_interp).r * 2.0 - 1.0; +#ifdef USE_ORTHOGONAL_PROJECTION + depth = ((depth + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; + float scale = unit_size; //remember depth is negative by default in OpenGL +#else depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth * (camera_z_far - camera_z_near)); + float scale = unit_size / depth; //remember depth is negative by default in OpenGL +#endif - float scale = unit_size / depth; //remember depth is negative by default in OpenGL - // Calculate the final step to fetch the surrounding pixels: vec2 step = max_radius * scale * dir; step *= strength; // Modulate it using the alpha channel. @@ -153,9 +158,14 @@ void main() { #ifdef ENABLE_FOLLOW_SURFACE // If the difference in depth is huge, we lerp color back to "colorM": float depth_cmp = texture(source_depth, offset).r *2.0 - 1.0; + +#ifdef USE_ORTHOGONAL_PROJECTION + depth_cmp = ((depth_cmp + (camera_z_far + camera_z_near)/(camera_z_far - camera_z_near)) * (camera_z_far - camera_z_near))/2.0; +#else depth_cmp = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth_cmp * (camera_z_far - camera_z_near)); +#endif - float s = clamp(300.0f * distance * + float s = clamp(300.0f * scale * max_radius * abs(depth - depth_cmp),0.0,1.0); color = mix(color, base_color.rgb, s); #endif diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp index 46c9442ffc..246d4d7650 100644 --- a/drivers/png/image_loader_png.cpp +++ b/drivers/png/image_loader_png.cpp @@ -216,8 +216,8 @@ void ImageLoaderPNG::get_recognized_extensions(List<String> *p_extensions) const struct PNGReadStatus { - int offset; - int size; + uint32_t offset; + uint32_t size; const unsigned char *image; }; diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 356b1ad958..1798c84d85 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -33,6 +33,7 @@ #include <pulse/error.h> +#include "os/os.h" #include "project_settings.h" Error AudioDriverPulseAudio::init() { @@ -44,7 +45,7 @@ Error AudioDriverPulseAudio::init() { samples_in = NULL; samples_out = NULL; - mix_rate = GLOBAL_DEF("audio/mix_rate", 44100); + mix_rate = GLOBAL_DEF("audio/mix_rate", DEFAULT_MIX_RATE); speaker_mode = SPEAKER_MODE_STEREO; channels = 2; @@ -53,12 +54,17 @@ Error AudioDriverPulseAudio::init() { spec.channels = channels; spec.rate = mix_rate; - int latency = GLOBAL_DEF("audio/output_latency", 25); - buffer_size = closest_power_of_2(latency * mix_rate / 1000); + int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY); + buffer_frames = closest_power_of_2(latency * mix_rate / 1000); + buffer_size = buffer_frames * channels; + + if (OS::get_singleton()->is_stdout_verbose()) { + print_line("audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms"); + } pa_buffer_attr attr; - // set to appropriate buffer size from global settings - attr.tlength = buffer_size; + // set to appropriate buffer length (in bytes) from global settings + attr.tlength = buffer_size * sizeof(int16_t); // set them to be automatically chosen attr.prebuf = (uint32_t)-1; attr.maxlength = (uint32_t)-1; @@ -80,8 +86,8 @@ Error AudioDriverPulseAudio::init() { ERR_FAIL_COND_V(pulse == NULL, ERR_CANT_OPEN); } - samples_in = memnew_arr(int32_t, buffer_size * channels); - samples_out = memnew_arr(int16_t, buffer_size * channels); + samples_in = memnew_arr(int32_t, buffer_size); + samples_out = memnew_arr(int16_t, buffer_size); mutex = Mutex::create(); thread = Thread::create(AudioDriverPulseAudio::thread_func, this); @@ -106,18 +112,18 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) { while (!ad->exit_thread) { if (!ad->active) { - for (unsigned int i = 0; i < ad->buffer_size * ad->channels; i++) { + for (unsigned int i = 0; i < ad->buffer_size; i++) { ad->samples_out[i] = 0; } } else { ad->lock(); - ad->audio_server_process(ad->buffer_size, ad->samples_in); + ad->audio_server_process(ad->buffer_frames, ad->samples_in); ad->unlock(); - for (unsigned int i = 0; i < ad->buffer_size * ad->channels; i++) { + for (unsigned int i = 0; i < ad->buffer_size; i++) { ad->samples_out[i] = ad->samples_in[i] >> 16; } } @@ -125,7 +131,7 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) { // pa_simple_write always consumes the entire buffer int error_code; - int byte_size = ad->buffer_size * sizeof(int16_t) * ad->channels; + int byte_size = ad->buffer_size * sizeof(int16_t); if (pa_simple_write(ad->pulse, ad->samples_out, byte_size, &error_code) < 0) { // can't recover here fprintf(stderr, "PulseAudio failed and can't recover: %s\n", pa_strerror(error_code)); @@ -175,13 +181,20 @@ void AudioDriverPulseAudio::finish() { exit_thread = true; Thread::wait_to_finish(thread); - if (pulse) + if (pulse) { pa_simple_free(pulse); + pulse = NULL; + } if (samples_in) { memdelete_arr(samples_in); + samples_in = NULL; + } + + if (samples_out) { memdelete_arr(samples_out); - }; + samples_out = NULL; + } memdelete(thread); if (mutex) { @@ -194,10 +207,15 @@ void AudioDriverPulseAudio::finish() { AudioDriverPulseAudio::AudioDriverPulseAudio() { + samples_in = NULL; + samples_out = NULL; mutex = NULL; thread = NULL; pulse = NULL; latency = 0; + buffer_frames = 0; + buffer_size = 0; + channels = 0; } AudioDriverPulseAudio::~AudioDriverPulseAudio() { diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.h b/drivers/pulseaudio/audio_driver_pulseaudio.h index 2f56726617..9ae0b7e50c 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.h +++ b/drivers/pulseaudio/audio_driver_pulseaudio.h @@ -51,6 +51,7 @@ class AudioDriverPulseAudio : public AudioDriver { unsigned int mix_rate; SpeakerMode speaker_mode; + unsigned int buffer_frames; unsigned int buffer_size; int channels; diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp index 7de3ff192e..ae5fdd28b6 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.cpp +++ b/drivers/rtaudio/audio_driver_rtaudio.cpp @@ -107,14 +107,13 @@ Error AudioDriverRtAudio::init() { options.numberOfBuffers = 4; parameters.firstChannel = 0; - mix_rate = GLOBAL_DEF("audio/mix_rate", 44100); + mix_rate = GLOBAL_DEF("audio/mix_rate", DEFAULT_MIX_RATE); - int latency = GLOBAL_DEF("audio/output_latency", 25); - // calculate desired buffer_size - unsigned int buffer_size = closest_power_of_2(latency * mix_rate / 1000); + int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY); + unsigned int buffer_frames = closest_power_of_2(latency * mix_rate / 1000); if (OS::get_singleton()->is_stdout_verbose()) { - print_line("audio buffer size: " + itos(buffer_size)); + print_line("audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms"); } short int tries = 2; @@ -127,7 +126,7 @@ Error AudioDriverRtAudio::init() { }; try { - dac->openStream(¶meters, NULL, RTAUDIO_SINT32, mix_rate, &buffer_size, &callback, this, &options); + dac->openStream(¶meters, NULL, RTAUDIO_SINT32, mix_rate, &buffer_frames, &callback, this, &options); active = true; break; @@ -199,7 +198,7 @@ AudioDriverRtAudio::AudioDriverRtAudio() { active = false; mutex = NULL; dac = NULL; - mix_rate = 44100; + mix_rate = DEFAULT_MIX_RATE; speaker_mode = SPEAKER_MODE_STEREO; } diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index ddc3b2ed33..6b8038c3ef 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -211,36 +211,35 @@ Error DirAccessUnix::make_dir(String p_dir) { Error DirAccessUnix::change_dir(String p_dir) { GLOBAL_LOCK_FUNCTION + p_dir = fix_path(p_dir); + // prev_dir is the directory we are changing out of + String prev_dir; char real_current_dir_name[2048]; getcwd(real_current_dir_name, 2048); - String prev_dir; if (prev_dir.parse_utf8(real_current_dir_name)) prev_dir = real_current_dir_name; //no utf8, maybe latin? - chdir(current_dir.utf8().get_data()); //ascii since this may be unicode or wathever the host os wants - bool worked = (chdir(p_dir.utf8().get_data()) == 0); // we can only give this utf8 - - String base = _get_root_path(); - if (base != "") { - - getcwd(real_current_dir_name, 2048); - String new_dir; - new_dir.parse_utf8(real_current_dir_name); - if (!new_dir.begins_with(base)) - worked = false; + // try_dir is the directory we are trying to change into + String try_dir = ""; + if (p_dir.is_rel_path()) { + String next_dir = current_dir + "/" + p_dir; + next_dir = next_dir.simplify_path(); + try_dir = next_dir; + } else { + try_dir = p_dir; } - if (worked) { - - getcwd(real_current_dir_name, 2048); - if (current_dir.parse_utf8(real_current_dir_name)) - current_dir = real_current_dir_name; //no utf8, maybe latin? + bool worked = (chdir(try_dir.utf8().get_data()) == 0); // we can only give this utf8 + if (!worked) { + return ERR_INVALID_PARAMETER; } + // the directory exists, so set current_dir to try_dir + current_dir = try_dir; chdir(prev_dir.utf8().get_data()); - return worked ? OK : ERR_INVALID_PARAMETER; + return OK; } String DirAccessUnix::get_current_dir() { @@ -307,11 +306,16 @@ size_t DirAccessUnix::get_space_left() { DirAccessUnix::DirAccessUnix() { dir_stream = 0; - current_dir = "."; _cisdir = false; /* determine drive count */ + // set current directory to an absolute path of the current directory + char real_current_dir_name[2048]; + getcwd(real_current_dir_name, 2048); + if (current_dir.parse_utf8(real_current_dir_name)) + current_dir = real_current_dir_name; + change_dir(current_dir); } diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index d5a66d9a1c..80565c5b02 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -36,12 +36,17 @@ #include <sys/stat.h> #include <sys/types.h> +#if defined(UNIX_ENABLED) +#include <unistd.h> +#endif + #ifndef ANDROID_ENABLED #include <sys/statvfs.h> #endif #ifdef MSVC #define S_ISREG(m) ((m)&_S_IFREG) +#include <io.h> #endif #ifndef S_ISREG #define S_ISREG(m) ((m)&S_IFREG) @@ -85,13 +90,18 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) { //printf("opening %s as %s\n", p_path.utf8().get_data(), path.utf8().get_data()); struct stat st; - if (stat(path.utf8().get_data(), &st) == 0) { - - if (!S_ISREG(st.st_mode)) - return ERR_FILE_CANT_OPEN; - }; + int err = stat(path.utf8().get_data(), &st); + if (!err) { + switch (st.st_mode & S_IFMT) { + case S_IFLNK: + case S_IFREG: + break; + default: + return ERR_FILE_CANT_OPEN; + } + } - if (is_backup_save_enabled() && p_mode_flags & WRITE && !(p_mode_flags & READ)) { + if (is_backup_save_enabled() && (p_mode_flags & WRITE) && !(p_mode_flags & READ)) { save_path = path; path = path + ".tmp"; //print_line("saving instead to "+path); @@ -108,15 +118,19 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) { return OK; } } + void FileAccessUnix::close() { if (!f) return; + fclose(f); f = NULL; + if (close_notification_func) { close_notification_func(path, flags); } + if (save_path != "") { //unlink(save_path.utf8().get_data()); @@ -131,10 +145,12 @@ void FileAccessUnix::close() { ERR_FAIL_COND(rename_error != 0); } } + bool FileAccessUnix::is_open() const { return (f != NULL); } + void FileAccessUnix::seek(size_t p_position) { ERR_FAIL_COND(!f); @@ -143,29 +159,37 @@ void FileAccessUnix::seek(size_t p_position) { if (fseek(f, p_position, SEEK_SET)) check_errors(); } + void FileAccessUnix::seek_end(int64_t p_position) { ERR_FAIL_COND(!f); + if (fseek(f, p_position, SEEK_END)) check_errors(); } + size_t FileAccessUnix::get_pos() const { - size_t aux_position = 0; - if (!(aux_position = ftell(f))) { + ERR_FAIL_COND_V(!f, 0); + + int pos = ftell(f); + if (pos < 0) { check_errors(); - }; - return aux_position; + ERR_FAIL_V(0); + } + return pos; } + size_t FileAccessUnix::get_len() const { ERR_FAIL_COND_V(!f, 0); - FileAccessUnix *fau = const_cast<FileAccessUnix *>(this); - int pos = fau->get_pos(); - fau->seek_end(); - int size = fau->get_pos(); - fau->seek(pos); + int pos = ftell(f); + ERR_FAIL_COND_V(pos < 0, 0); + ERR_FAIL_COND_V(fseek(f, 0, SEEK_END), 0); + int size = ftell(f); + ERR_FAIL_COND_V(size < 0, 0); + ERR_FAIL_COND_V(fseek(f, pos, SEEK_SET), 0); return size; } @@ -181,8 +205,8 @@ uint8_t FileAccessUnix::get_8() const { uint8_t b; if (fread(&b, 1, 1, f) == 0) { check_errors(); - }; - + b = '\0'; + } return b; } @@ -202,22 +226,36 @@ Error FileAccessUnix::get_error() const { void FileAccessUnix::store_8(uint8_t p_dest) { ERR_FAIL_COND(!f); - fwrite(&p_dest, 1, 1, f); + ERR_FAIL_COND(fwrite(&p_dest, 1, 1, f) != 1); } bool FileAccessUnix::file_exists(const String &p_path) { - FILE *g; - //printf("opening file %s\n", p_fname.c_str()); + int err; + struct stat st; String filename = fix_path(p_path); - g = fopen(filename.utf8().get_data(), "rb"); - if (g == NULL) { + // Does the name exist at all? + err = stat(filename.utf8().get_data(), &st); + if (err) return false; - } else { - fclose(g); - return true; +#ifdef UNIX_ENABLED + // See if we have access to the file + if (access(filename.utf8().get_data(), F_OK)) + return false; +#else + if (_access(filename.utf8().get_data(), 4) == -1) + return false; +#endif + + // See if this is a regular file + switch (st.st_mode & S_IFMT) { + case S_IFLNK: + case S_IFREG: + return true; + default: + return false; } } @@ -225,9 +263,9 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) { String file = fix_path(p_file); struct stat flags; - bool success = (stat(file.utf8().get_data(), &flags) == 0); + int err = stat(file.utf8().get_data(), &flags); - if (success) { + if (!err) { return flags.st_mtime; } else { print_line("ERROR IN: " + p_file); @@ -249,6 +287,7 @@ FileAccessUnix::FileAccessUnix() { flags = 0; last_error = OK; } + FileAccessUnix::~FileAccessUnix() { close(); diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index b743990b92..61d2737555 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -73,8 +73,8 @@ Error PacketPeerUDPPosix::get_packet(const uint8_t **r_buffer, int &r_buffer_siz if (queue_count == 0) return ERR_UNAVAILABLE; - uint32_t size; - uint8_t type; + uint32_t size = 0; + uint8_t type = IP::TYPE_NONE; rb.read(&type, 1, true); if (type == IP::TYPE_IPV4) { uint8_t ip[4]; diff --git a/drivers/unix/socket_helpers.h b/drivers/unix/socket_helpers.h index 3fc0144294..0995e5236f 100644 --- a/drivers/unix/socket_helpers.h +++ b/drivers/unix/socket_helpers.h @@ -64,7 +64,6 @@ static size_t _set_sockaddr(struct sockaddr_storage *p_addr, const IP_Address &p // IPv4 socket with IPv6 address ERR_FAIL_COND_V(!p_ip.is_ipv4(), 0); - uint32_t ipv4 = *((uint32_t *)p_ip.get_ipv4()); struct sockaddr_in *addr4 = (struct sockaddr_in *)p_addr; addr4->sin_family = AF_INET; addr4->sin_port = htons(p_port); // short, network byte order diff --git a/drivers/unix/tcp_server_posix.cpp b/drivers/unix/tcp_server_posix.cpp index f3f9ab82f1..5062a74b63 100644 --- a/drivers/unix/tcp_server_posix.cpp +++ b/drivers/unix/tcp_server_posix.cpp @@ -165,7 +165,7 @@ Ref<StreamPeerTCP> TCPServerPosix::take_connection() { Ref<StreamPeerTCPPosix> conn = memnew(StreamPeerTCPPosix); IP_Address ip; - int port; + int port = 0; _set_ip_addr_port(ip, port, &their_addr); conn->set_socket(fd, ip, port, sock_type); diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index 5bea8cf20c..29d1e5deed 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -65,6 +65,18 @@ Error AudioDriverWASAPI::init_device() { format_tag = pwfex->wFormatTag; bits_per_sample = pwfex->wBitsPerSample; + switch (channels) { + case 2: // Stereo + case 6: // Surround 5.1 + case 8: // Surround 7.1 + break; + + default: + ERR_PRINT("WASAPI: Unsupported number of channels"); + ERR_FAIL_V(ERR_CANT_OPEN); + break; + } + if (format_tag == WAVE_FORMAT_EXTENSIBLE) { WAVEFORMATEXTENSIBLE *wfex = (WAVEFORMATEXTENSIBLE *)pwfex; @@ -83,13 +95,6 @@ Error AudioDriverWASAPI::init_device() { } } - int latency = GLOBAL_DEF("audio/output_latency", 25); - buffer_size = closest_power_of_2(latency * mix_rate / 1000); - - if (OS::get_singleton()->is_stdout_verbose()) { - print_line("audio buffer size: " + itos(buffer_size)); - } - hr = audio_client->Initialize(AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 0, 0, pwfex, NULL); ERR_FAIL_COND_V(hr != S_OK, ERR_CANT_OPEN); @@ -102,11 +107,20 @@ Error AudioDriverWASAPI::init_device() { hr = audio_client->GetService(IID_IAudioRenderClient, (void **)&render_client); ERR_FAIL_COND_V(hr != S_OK, ERR_CANT_OPEN); + UINT32 max_frames; hr = audio_client->GetBufferSize(&max_frames); ERR_FAIL_COND_V(hr != S_OK, ERR_CANT_OPEN); + // Due to WASAPI Shared Mode we have no control of the buffer size + buffer_frames = max_frames; + + // Sample rate is independent of channels (ref: https://stackoverflow.com/questions/11048825/audio-sample-frequency-rely-on-channels) + buffer_size = buffer_frames * channels; samples_in.resize(buffer_size); - buffer_frames = buffer_size / channels; + + if (OS::get_singleton()->is_stdout_verbose()) { + print_line("audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms"); + } return OK; } @@ -200,7 +214,7 @@ void AudioDriverWASAPI::thread_func(void *p_udata) { HRESULT hr = ad->audio_client->GetCurrentPadding(&cur_frames); if (hr == S_OK) { // Check how much frames are available on the WASAPI buffer - UINT32 avail_frames = ad->max_frames - cur_frames; + UINT32 avail_frames = ad->buffer_frames - cur_frames; UINT32 write_frames = avail_frames > left_frames ? left_frames : avail_frames; BYTE *buffer = NULL; @@ -332,7 +346,6 @@ AudioDriverWASAPI::AudioDriverWASAPI() { mutex = NULL; thread = NULL; - max_frames = 0; format_tag = 0; bits_per_sample = 0; diff --git a/drivers/wasapi/audio_driver_wasapi.h b/drivers/wasapi/audio_driver_wasapi.h index c18b49e75e..fab8ab3250 100644 --- a/drivers/wasapi/audio_driver_wasapi.h +++ b/drivers/wasapi/audio_driver_wasapi.h @@ -48,7 +48,6 @@ class AudioDriverWASAPI : public AudioDriver { Mutex *mutex; Thread *thread; - UINT32 max_frames; WORD format_tag; WORD bits_per_sample; diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 30c8332fa3..fe2069089c 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -159,7 +159,8 @@ void FileAccessWindows::seek_end(int64_t p_position) { size_t FileAccessWindows::get_pos() const { size_t aux_position = 0; - if (!(aux_position = ftell(f))) { + aux_position = ftell(f); + if (!aux_position) { check_errors(); }; return aux_position; diff --git a/editor/SCsub b/editor/SCsub index 172447147c..0e690cf465 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -155,31 +155,71 @@ def make_authors_header(target, source, env): g.write("#define _EDITOR_AUTHORS_H\n") current_section = "" - name_count = -1 + reading = False def close_section(): g.write("\t0\n") g.write("};\n") - g.write("#define " + current_section.upper() + "_COUNT " + str(name_count) + "\n") for line in f: - if name_count >= 0: + if reading: if line.startswith(" "): g.write("\t\"" + line.strip() + "\",\n") - name_count += 1 continue if line.startswith("## "): - if name_count >= 0: + if reading: close_section() - name_count = -1 + reading = False for i in range(len(sections)): if line.strip().endswith(sections[i]): current_section = sections_id[i] - name_count = 0 + reading = True g.write("static const char *" + current_section + "[] = {\n") break - if name_count >= 0: + if reading: + close_section() + + g.write("#endif\n") + +def make_donors_header(target, source, env): + + sections = ["Platinum sponsors", "Gold sponsors", "Mini sponsors", "Gold donors", "Silver donors", "Bronze donors"] + sections_id = ["donor_s_plat", "donor_s_gold", "donor_s_mini", "donor_gold", "donor_silver", "donor_bronze"] + + src = source[0].srcnode().abspath + dst = target[0].srcnode().abspath + f = open_utf8(src, "r") + g = open_utf8(dst, "w") + + g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") + g.write("#ifndef _EDITOR_DONORS_H\n") + g.write("#define _EDITOR_DONORS_H\n") + + current_section = "" + reading = False + + def close_section(): + g.write("\t0\n") + g.write("};\n") + + for line in f: + if reading >= 0: + if line.startswith(" "): + g.write("\t\"" + line.strip() + "\",\n") + continue + if line.startswith("## "): + if reading: + close_section() + reading = False + for i in range(len(sections)): + if line.strip().endswith(sections[i]): + current_section = sections_id[i] + reading = True + g.write("static const char *" + current_section + "[] = {\n") + break + + if reading: close_section() g.write("#endif\n") @@ -393,6 +433,10 @@ if (env["tools"] == "yes"): env.Depends('#editor/authors.gen.h', "../AUTHORS.md") env.Command('#editor/authors.gen.h', "../AUTHORS.md", make_authors_header) + # Donors + env.Depends('#editor/donors.gen.h', "../DONORS.md") + env.Command('#editor/donors.gen.h', "../DONORS.md", make_donors_header) + # License env.Depends('#editor/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"]) env.Command('#editor/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"], make_license_header) diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp index 890c3d8091..54bf31cd62 100644 --- a/editor/dependency_editor.cpp +++ b/editor/dependency_editor.cpp @@ -489,6 +489,7 @@ DependencyErrorDialog::DependencyErrorDialog() { vb->add_margin_child(TTR("Scene failed to load due to missing dependencies:"), files, true); files->set_v_size_flags(SIZE_EXPAND_FILL); get_ok()->set_text(TTR("Open Anyway")); + get_cancel()->set_text(TTR("Done")); text = memnew(Label); vb->add_child(text); diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 5975e54356..6848c43b68 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -634,6 +634,9 @@ static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> & ERR_FAIL_COND_V(!parser->has_attribute("type"), ERR_FILE_CORRUPT); method.return_type = parser->get_attribute_value("type"); + if (parser->has_attribute("enum")) { + method.return_enum = parser->get_attribute_value("enum"); + } } else if (name == "argument") { DocData::ArgumentDoc argument; @@ -916,7 +919,11 @@ Error DocData::save(const String &p_path) { if (m.return_type != "") { - _write_string(f, 3, "<return type=\"" + m.return_type + "\">"); + String enum_text; + if (m.return_enum != String()) { + enum_text = " enum=\"" + m.return_enum + "\""; + } + _write_string(f, 3, "<return type=\"" + m.return_type + "\"" + enum_text + ">"); _write_string(f, 3, "</return>"); } diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index 8bd7bfb4bd..a48e6c9057 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -30,6 +30,7 @@ #include "editor_about.h" #include "authors.gen.h" +#include "donors.gen.h" #include "license.gen.h" #include "version.h" #include "version_hash.gen.h" @@ -51,6 +52,47 @@ TextureRect *EditorAbout::get_logo() const { return _logo; } +ScrollContainer *EditorAbout::_populate_list(const String &p_name, const List<String> &p_sections, const char **p_src[]) { + + ScrollContainer *sc = memnew(ScrollContainer); + sc->set_name(p_name); + sc->set_v_size_flags(Control::SIZE_EXPAND); + + VBoxContainer *vbc = memnew(VBoxContainer); + vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); + sc->add_child(vbc); + + for (int i = 0; i < p_sections.size(); i++) { + + const char **names_ptr = p_src[i]; + if (*names_ptr) { + + Label *lbl = memnew(Label); + lbl->set_text(p_sections[i]); + vbc->add_child(lbl); + + ItemList *il = memnew(ItemList); + il->set_max_columns(16); + il->set_h_size_flags(Control::SIZE_EXPAND_FILL); + il->set_same_column_width(true); + il->set_auto_height(true); + while (*names_ptr) { + il->add_item(String::utf8(*names_ptr++), NULL, false); + } + vbc->add_child(il); + if (il->get_item_count() == 2) { + il->set_fixed_column_width(200 * EDSCALE); + } + + HSeparator *hs = memnew(HSeparator); + hs->set_modulate(Color(0, 0, 0, 0)); + vbc->add_child(hs); + } + } + + return sc; +} + EditorAbout::EditorAbout() { set_title(TTR("Thanks from the Godot community!")); @@ -84,43 +126,29 @@ EditorAbout::EditorAbout() { tc->set_v_size_flags(Control::SIZE_EXPAND_FILL); vbc->add_child(tc); - ScrollContainer *dev_base = memnew(ScrollContainer); - dev_base->set_name(TTR("Authors")); - dev_base->set_v_size_flags(Control::SIZE_EXPAND); - tc->add_child(dev_base); - - VBoxContainer *dev_vbc = memnew(VBoxContainer); - dev_vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); - dev_base->add_child(dev_vbc); + // Authors List<String> dev_sections; dev_sections.push_back(TTR("Project Founders")); dev_sections.push_back(TTR("Lead Developer")); dev_sections.push_back(TTR("Project Manager")); dev_sections.push_back(TTR("Developers")); - const char **dev_src[] = { dev_founders, dev_lead, dev_manager, dev_names }; + tc->add_child(_populate_list(TTR("Authors"), dev_sections, dev_src)); - for (int i = 0; i < dev_sections.size(); i++) { - - Label *lbl = memnew(Label); - lbl->set_text(dev_sections[i]); - dev_vbc->add_child(lbl); - - ItemList *il = memnew(ItemList); - il->set_max_columns(16); - il->set_h_size_flags(Control::SIZE_EXPAND_FILL); - il->set_fixed_column_width(230 * EDSCALE); - il->set_auto_height(true); - const char **dev_names_ptr = dev_src[i]; - while (*dev_names_ptr) - il->add_item(String::utf8(*dev_names_ptr++), NULL, false); - dev_vbc->add_child(il); - - HSeparator *hs = memnew(HSeparator); - hs->set_modulate(Color(0, 0, 0, 0)); - dev_vbc->add_child(hs); - } + // Donors + + List<String> donor_sections; + donor_sections.push_back(TTR("Platinum Sponsors")); + donor_sections.push_back(TTR("Gold Sponsors")); + donor_sections.push_back(TTR("Mini Sponsors")); + donor_sections.push_back(TTR("Gold Donors")); + donor_sections.push_back(TTR("Silver Donors")); + donor_sections.push_back(TTR("Bronze Donors")); + const char **donor_src[] = { donor_s_plat, donor_s_gold, donor_s_mini, donor_gold, donor_silver, donor_bronze }; + tc->add_child(_populate_list(TTR("Donors"), donor_sections, donor_src)); + + // License TextEdit *license = memnew(TextEdit); license->set_name(TTR("License")); @@ -131,6 +159,8 @@ EditorAbout::EditorAbout() { license->set_text(String::utf8(about_license)); tc->add_child(license); + // Thirdparty License + VBoxContainer *license_thirdparty = memnew(VBoxContainer); license_thirdparty->set_name(TTR("Thirdparty License")); license_thirdparty->set_h_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/editor_about.h b/editor/editor_about.h index d7047c03a3..d455b1f074 100644 --- a/editor/editor_about.h +++ b/editor/editor_about.h @@ -52,6 +52,7 @@ class EditorAbout : public AcceptDialog { private: void _license_tree_selected(); + ScrollContainer *_populate_list(const String &p_name, const List<String> &p_sections, const char **p_src[]); Tree *_tpl_tree; TextEdit *_tpl_text; diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index b3eb3e23a9..29159c7ad5 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -70,11 +70,14 @@ void EditorAudioBus::_notification(int p_what) { float real_peak[2] = { -100, -100 }; bool activity_found = false; - int cc; + int cc = 0; switch (AudioServer::get_singleton()->get_speaker_mode()) { case AudioServer::SPEAKER_MODE_STEREO: cc = 1; break; case AudioServer::SPEAKER_SURROUND_51: cc = 4; break; case AudioServer::SPEAKER_SURROUND_71: cc = 5; break; + default: + ERR_PRINT("Unknown speaker_mode"); + break; } for (int i = 0; i < cc; i++) { @@ -411,7 +414,10 @@ void EditorAudioBus::_gui_input(const Ref<InputEvent> &p_event) { void EditorAudioBus::_bus_popup_pressed(int p_option) { - if (p_option == 1) { + if (p_option == 2) { + // Reset volume + emit_signal("vol_reset_request"); + } else if (p_option == 1) { emit_signal("delete_request"); } else if (p_option == 0) { //duplicate @@ -614,6 +620,7 @@ void EditorAudioBus::_bind_methods() { ADD_SIGNAL(MethodInfo("duplicate_request")); ADD_SIGNAL(MethodInfo("delete_request")); + ADD_SIGNAL(MethodInfo("vol_reset_request")); ADD_SIGNAL(MethodInfo("drop_end_request")); ADD_SIGNAL(MethodInfo("dropped")); } @@ -739,6 +746,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { bus_popup = bus_options->get_popup(); bus_popup->add_item(TTR("Duplicate")); bus_popup->add_item(TTR("Delete")); + bus_popup->add_item(TTR("Reset Volume")); bus_popup->connect("index_pressed", this, "_bus_popup_pressed"); delete_effect_popup = memnew(PopupMenu); @@ -787,6 +795,7 @@ void EditorAudioBuses::_update_buses() { bus_hb->add_child(audio_bus); audio_bus->connect("delete_request", this, "_delete_bus", varray(audio_bus), CONNECT_DEFERRED); audio_bus->connect("duplicate_request", this, "_duplicate_bus", varray(), CONNECT_DEFERRED); + audio_bus->connect("vol_reset_request", this, "_reset_bus_volume", varray(audio_bus), CONNECT_DEFERRED); audio_bus->connect("drop_end_request", this, "_request_drop_end"); audio_bus->connect("dropped", this, "_drop_at_index", varray(), CONNECT_DEFERRED); } @@ -916,6 +925,20 @@ void EditorAudioBuses::_duplicate_bus(int p_which) { ur->commit_action(); } +void EditorAudioBuses::_reset_bus_volume(Object *p_which) { + + EditorAudioBus *bus = Object::cast_to<EditorAudioBus>(p_which); + int index = bus->get_index(); + + UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); + ur->create_action(TTR("Reset Bus Volume")); + ur->add_do_method(AudioServer::get_singleton(), "set_bus_volume_db", index, 0.f); + ur->add_undo_method(AudioServer::get_singleton(), "set_bus_volume_db", index, AudioServer::get_singleton()->get_bus_volume_db(index)); + ur->add_do_method(this, "_update_buses"); + ur->add_undo_method(this, "_update_buses"); + ur->commit_action(); +} + void EditorAudioBuses::_request_drop_end() { if (!drop_end && bus_hb->get_child_count()) { @@ -1060,6 +1083,7 @@ void EditorAudioBuses::_bind_methods() { ClassDB::bind_method("_load_default_layout", &EditorAudioBuses::_load_default_layout); ClassDB::bind_method("_new_layout", &EditorAudioBuses::_new_layout); ClassDB::bind_method("_duplicate_bus", &EditorAudioBuses::_duplicate_bus); + ClassDB::bind_method("_reset_bus_volume", &EditorAudioBuses::_reset_bus_volume); ClassDB::bind_method("_file_dialog_callback", &EditorAudioBuses::_file_dialog_callback); } diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index e04ba7b89d..2c61228bde 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -158,6 +158,7 @@ class EditorAudioBuses : public VBoxContainer { void _delete_bus(Object *p_which); void _duplicate_bus(int p_which); + void _reset_bus_volume(Object *p_which); void _request_drop_end(); void _drop_at_index(int p_bus, int p_index); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index cb74a7b852..2cb5340b8b 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -141,7 +141,7 @@ ObjectID EditorHistory::get_history_obj(int p_obj) const { return history[p_obj].path[history[p_obj].level].object; } -bool EditorHistory::is_at_begining() const { +bool EditorHistory::is_at_beginning() const { return current <= 0; } bool EditorHistory::is_at_end() const { diff --git a/editor/editor_data.h b/editor/editor_data.h index cbba4d60ad..33a4091a65 100644 --- a/editor/editor_data.h +++ b/editor/editor_data.h @@ -74,7 +74,7 @@ class EditorHistory { void _add_object(ObjectID p_object, const String &p_property, int p_level_change); public: - bool is_at_begining() const; + bool is_at_beginning() const; bool is_at_end() const; void add_object(ObjectID p_object); diff --git a/editor/editor_dir_dialog.cpp b/editor/editor_dir_dialog.cpp index 1b213501aa..cfb3abfd1d 100644 --- a/editor/editor_dir_dialog.cpp +++ b/editor/editor_dir_dialog.cpp @@ -31,50 +31,40 @@ #include "editor/editor_file_system.h" #include "editor/editor_settings.h" +#include "editor_scale.h" #include "os/keyboard.h" #include "os/os.h" - -void EditorDirDialog::_update_dir(TreeItem *p_item) { +void EditorDirDialog::_update_dir(TreeItem *p_item, EditorFileSystemDirectory *p_dir, const String &p_select_path) { updating = true; - p_item->clear_children(); - DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); - String cdir = p_item->get_metadata(0); - - da->change_dir(cdir); - da->list_dir_begin(); - String p = da->get_next(); - List<String> dirs; - bool ishidden; - bool show_hidden = EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"); + String path = p_dir->get_path(); - while (p != "") { + p_item->set_metadata(0, p_dir->get_path()); + p_item->set_icon(0, get_icon("Folder", "EditorIcons")); - ishidden = da->current_is_hidden(); + if (!p_item->get_parent()) { + p_item->set_text(0, "res://"); + } else { - if (show_hidden || !ishidden) { - if (da->current_is_dir() && !p.begins_with(".")) { - dirs.push_back(p); - } + if (!opened_paths.has(path) && (p_select_path == String() || !p_select_path.begins_with(path))) { + p_item->set_collapsed(true); } - p = da->get_next(); + + p_item->set_text(0, p_dir->get_name()); } - dirs.sort(); + //this should be handled by EditorFileSystem already + //bool show_hidden = EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"); + updating = false; + for (int i = 0; i < p_dir->get_subdir_count(); i++) { - for (List<String>::Element *E = dirs.front(); E; E = E->next()) { TreeItem *ti = tree->create_item(p_item); - ti->set_text(0, E->get()); - ti->set_icon(0, get_icon("Folder", "EditorIcons")); - ti->set_collapsed(true); + _update_dir(ti, p_dir->get_subdir(i)); } - - memdelete(da); - updating = false; } -void EditorDirDialog::reload() { +void EditorDirDialog::reload(const String &p_with_path) { if (!is_visible_in_tree()) { must_reload = true; @@ -83,10 +73,7 @@ void EditorDirDialog::reload() { tree->clear(); TreeItem *root = tree->create_item(); - root->set_metadata(0, "res://"); - root->set_icon(0, get_icon("Folder", "EditorIcons")); - root->set_text(0, "/"); - _update_dir(root); + _update_dir(root, EditorFileSystem::get_singleton()->get_filesystem(), p_with_path); _item_collapsed(root); must_reload = false; } @@ -94,6 +81,7 @@ void EditorDirDialog::reload() { void EditorDirDialog::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { + EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "reload"); reload(); if (!tree->is_connected("item_collapsed", this, "_item_collapsed")) { @@ -105,6 +93,10 @@ void EditorDirDialog::_notification(int p_what) { } } + if (p_what == NOTIFICATION_EXIT_TREE) { + EditorFileSystem::get_singleton()->disconnect("filesystem_changed", this, "reload"); + } + if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { if (must_reload && is_visible_in_tree()) { reload(); @@ -116,57 +108,13 @@ void EditorDirDialog::_item_collapsed(Object *p_item) { TreeItem *item = Object::cast_to<TreeItem>(p_item); - if (updating || item->is_collapsed()) + if (updating) return; - TreeItem *ci = item->get_children(); - while (ci) { - - String p = ci->get_metadata(0); - if (p == "") { - String pp = item->get_metadata(0); - ci->set_metadata(0, pp.plus_file(ci->get_text(0))); - _update_dir(ci); - } - ci = ci->get_next(); - } -} - -void EditorDirDialog::set_current_path(const String &p_path) { - - reload(); - String p = p_path; - if (p.begins_with("res://")) - p = p.replace_first("res://", ""); - - Vector<String> dirs = p.split("/", false); - - TreeItem *r = tree->get_root(); - for (int i = 0; i < dirs.size(); i++) { - - String d = dirs[i]; - TreeItem *p = r->get_children(); - while (p) { - - if (p->get_text(0) == d) - break; - p = p->get_next(); - } - - ERR_FAIL_COND(!p); - String pp = p->get_metadata(0); - if (pp == "") { - p->set_metadata(0, String(r->get_metadata(0)).plus_file(d)); - _update_dir(p); - } - updating = true; - p->set_collapsed(false); - updating = false; - _item_collapsed(p); - r = p; - } - - r->select(0); + if (item->is_collapsed()) + opened_paths.erase(item->get_metadata(0)); + else + opened_paths.insert(item->get_metadata(0)); } void EditorDirDialog::ok_pressed() { @@ -201,14 +149,16 @@ void EditorDirDialog::_make_dir_confirm() { String dir = ti->get_metadata(0); - DirAccess *d = DirAccess::open(dir); + DirAccessRef d = DirAccess::open(dir); ERR_FAIL_COND(!d); Error err = d->make_dir(makedirname->get_text()); if (err != OK) { - mkdirerr->popup_centered_minsize(Size2(250, 80)); + mkdirerr->popup_centered_minsize(Size2(250, 80) * EDSCALE); } else { - set_current_path(dir.plus_file(makedirname->get_text())); + opened_paths.insert(dir); + //reload(dir.plus_file(makedirname->get_text())); + EditorFileSystem::get_singleton()->scan_changes(); //we created a dir, so rescan changes } makedirname->set_text(""); // reset label } @@ -218,7 +168,7 @@ void EditorDirDialog::_bind_methods() { ClassDB::bind_method(D_METHOD("_item_collapsed"), &EditorDirDialog::_item_collapsed); ClassDB::bind_method(D_METHOD("_make_dir"), &EditorDirDialog::_make_dir); ClassDB::bind_method(D_METHOD("_make_dir_confirm"), &EditorDirDialog::_make_dir_confirm); - ClassDB::bind_method(D_METHOD("reload"), &EditorDirDialog::reload); + ClassDB::bind_method(D_METHOD("reload"), &EditorDirDialog::reload, DEFVAL("")); ADD_SIGNAL(MethodInfo("dir_selected", PropertyInfo(Variant::STRING, "dir"))); } diff --git a/editor/editor_dir_dialog.h b/editor/editor_dir_dialog.h index b8347f75fb..8aa685947b 100644 --- a/editor/editor_dir_dialog.h +++ b/editor/editor_dir_dialog.h @@ -30,6 +30,7 @@ #ifndef EDITOR_DIR_DIALOG_H #define EDITOR_DIR_DIALOG_H +#include "editor/editor_file_system.h" #include "os/dir_access.h" #include "scene/gui/dialogs.h" #include "scene/gui/tree.h" @@ -42,12 +43,13 @@ class EditorDirDialog : public ConfirmationDialog { AcceptDialog *mkdirerr; Button *makedir; + Set<String> opened_paths; Tree *tree; bool updating; void _item_collapsed(Object *p_item); - void _update_dir(TreeItem *p_item); + void _update_dir(TreeItem *p_item, EditorFileSystemDirectory *p_dir, const String &p_select_path = String()); void _make_dir(); void _make_dir_confirm(); @@ -61,8 +63,7 @@ protected: static void _bind_methods(); public: - void set_current_path(const String &p_path); - void reload(); + void reload(const String &p_path = ""); EditorDirDialog(); }; diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 915fb7e5db..8623b9acdb 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -697,6 +697,8 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co zd.zip = zip; Error err = export_project_files(p_preset, _save_zip_file, &zd); + if (err != OK) + ERR_PRINT("Failed to export project files"); zipClose(zip, NULL); diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 22a9c84d21..3ab3f05906 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -72,11 +72,14 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_valign, int p m_name->add_fallback(FontJapanese); \ m_name->add_fallback(FontFallback); -#define MAKE_DEFAULT_FONT(m_name, m_size) \ - Ref<DynamicFont> m_name; \ - m_name.instance(); \ - m_name->set_size(m_size); \ - m_name->set_font_data(DefaultFont); \ +// the custom spacings might only work with Noto Sans +#define MAKE_DEFAULT_FONT(m_name, m_size) \ + Ref<DynamicFont> m_name; \ + m_name.instance(); \ + m_name->set_size(m_size); \ + m_name->set_font_data(DefaultFont); \ + m_name->set_spacing(DynamicFont::SPACING_TOP, -1); \ + m_name->set_spacing(DynamicFont::SPACING_BOTTOM, -1); \ MAKE_FALLBACKS(m_name); void editor_register_fonts(Ref<Theme> p_theme) { diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 0e22f0d386..7fa2c53275 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1712,9 +1712,8 @@ void EditorHelp::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - Ref<StyleBoxFlat> style(memnew(StyleBoxFlat)); - style->set_bg_color(EditorSettings::get_singleton()->get("text_editor/highlighting/background_color")); - background_panel->add_style_override("panel", style); + + class_desc->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); } break; default: break; @@ -1786,14 +1785,12 @@ EditorHelp::EditorHelp() { { background_panel = memnew(Panel); - Ref<StyleBoxFlat> style(memnew(StyleBoxFlat)); - style->set_bg_color(EditorSettings::get_singleton()->get("text_editor/highlighting/background_color")); background_panel->set_v_size_flags(SIZE_EXPAND_FILL); - background_panel->add_style_override("panel", style); //get_stylebox("normal","TextEdit")); vbc->add_child(background_panel); class_desc = memnew(RichTextLabel); background_panel->add_child(class_desc); - class_desc->set_area_as_parent_rect(8); + class_desc->set_area_as_parent_rect(); + class_desc->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); class_desc->connect("meta_clicked", this, "_class_desc_select"); class_desc->connect("gui_input", this, "_class_desc_input"); } @@ -1882,8 +1879,13 @@ void EditorHelpBit::_bind_methods() { void EditorHelpBit::_notification(int p_what) { - if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - add_style_override("panel", get_stylebox("ScriptPanel", "EditorStyles")); + switch (p_what) { + case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { + + rich_text->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); + } break; + + default: break; } } @@ -1897,8 +1899,8 @@ EditorHelpBit::EditorHelpBit() { rich_text = memnew(RichTextLabel); add_child(rich_text); - rich_text->set_area_as_parent_rect(8 * EDSCALE); + rich_text->set_area_as_parent_rect(); rich_text->connect("meta_clicked", this, "_meta_clicked"); + rich_text->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1))); set_custom_minimum_size(Size2(0, 70 * EDSCALE)); - add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles")); } diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index a1f416a17c..35291f8f9e 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -59,7 +59,6 @@ void EditorLog::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - log->add_color_override("default_color", get_color("font_color", "Tree")); //button->set_icon(get_icon("Console","EditorIcons")); } if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { @@ -91,7 +90,7 @@ void EditorLog::add_message(const String &p_msg, bool p_error) { log->add_newline(); if (p_error) { - log->push_color(get_color("fg_error", "Editor")); + log->push_color(get_color("error_color", "Editor")); Ref<Texture> icon = get_icon("Error", "EditorIcons"); log->add_image(icon); //button->set_icon(icon); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 8575cd164f..b4412014e7 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -283,13 +283,22 @@ void EditorNode::_notification(int p_what) { scene_tabs->set_tab_close_display_policy((bool(EDITOR_DEF("interface/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY)); property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/capitalize_properties", true))); Ref<Theme> theme = create_editor_theme(theme_base->get_theme()); + theme_base->set_theme(theme); + gui_base->add_style_override("panel", gui_base->get_stylebox("Background", "EditorStyles")); play_button_panel->add_style_override("panel", gui_base->get_stylebox("PlayButtonPanel", "EditorStyles")); scene_root_parent->add_style_override("panel", gui_base->get_stylebox("Content", "EditorStyles")); bottom_panel->add_style_override("panel", gui_base->get_stylebox("panel", "TabContainer")); scene_tabs->add_style_override("tab_fg", gui_base->get_stylebox("SceneTabFG", "EditorStyles")); scene_tabs->add_style_override("tab_bg", gui_base->get_stylebox("SceneTabBG", "EditorStyles")); + + file_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + project_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + if (bool(EDITOR_DEF("interface/scene_tabs/resize_if_many_tabs", true))) { scene_tabs->set_min_width(int(EDITOR_DEF("interface/scene_tabs/minimum_width", 50)) * EDSCALE); } else { @@ -403,7 +412,6 @@ void EditorNode::_fs_changed() { } if (changed.size()) { - int idx = 0; for (List<Ref<Resource> >::Element *E = changed.front(); E; E = E->next()) { E->get()->reload_from_file(); } @@ -1368,12 +1376,22 @@ void EditorNode::_set_editing_top_editors(Object *p_current_object) { editor_plugins_over->edit(p_current_object); } +static bool overrides_external_editor(Object *p_object) { + + Script *script = Object::cast_to<Script>(p_object); + + if (!script) + return false; + + return script->get_language()->overrides_external_editor(); +} + void EditorNode::_edit_current() { uint32_t current = editor_history.get_current(); Object *current_obj = current > 0 ? ObjectDB::get_instance(current) : NULL; - property_back->set_disabled(editor_history.is_at_begining()); + property_back->set_disabled(editor_history.is_at_beginning()); property_forward->set_disabled(editor_history.is_at_end()); this->current = current_obj; @@ -1434,7 +1452,7 @@ void EditorNode::_edit_current() { if (main_plugin) { // special case if use of external editor is true - if (main_plugin->get_name() == "Script" && bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) { + if (main_plugin->get_name() == "Script" && (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")) || overrides_external_editor(current_obj))) { main_plugin->edit(current_obj); } @@ -1442,6 +1460,7 @@ void EditorNode::_edit_current() { // update screen main_plugin if (!changing_scene) { + if (editor_plugin_screen) editor_plugin_screen->make_visible(false); editor_plugin_screen = main_plugin; @@ -1977,6 +1996,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { int cur_idx = editor_data.get_edited_scene(); _remove_edited_scene(); Error err = load_scene(filename); + if (err != OK) + ERR_PRINT("Failed to load scene"); editor_data.move_edited_scene_to_index(cur_idx); get_undo_redo()->clear_history(); scene_tabs->set_current_tab(cur_idx); @@ -2721,6 +2742,14 @@ Dictionary EditorNode::_get_main_scene_state() { state["property_edit_offset"] = get_property_editor()->get_scene_tree()->get_vscroll_bar()->get_value(); state["saved_version"] = saved_version; state["node_filter"] = scene_tree_dock->get_filter(); + int current = -1; + for (int i = 0; i < editor_table.size(); i++) { + if (editor_plugin_screen == editor_table[i]) { + current = i; + break; + } + } + state["editor_index"] = current; return state; } @@ -2731,8 +2760,9 @@ void EditorNode::_set_main_scene_state(Dictionary p_state, Node *p_for_scene) { changing_scene = false; - if (get_edited_scene()) { + if (p_state.has("editor_index")) { + int index = p_state["editor_index"]; int current = -1; for (int i = 0; i < editor_table.size(); i++) { if (editor_plugin_screen == editor_table[i]) { @@ -2741,15 +2771,18 @@ void EditorNode::_set_main_scene_state(Dictionary p_state, Node *p_for_scene) { } } - if (current < 2) { - //use heuristic instead - - int n2d = 0, n3d = 0; - _find_node_types(get_edited_scene(), n2d, n3d); - if (n2d > n3d) { - _editor_select(EDITOR_2D); - } else if (n3d > n2d) { - _editor_select(EDITOR_3D); + if (current < 2) { //if currently in spatial/2d, only switch to spatial/2d. if curently in script, stay there + if (index < 2 || !get_edited_scene()) { + _editor_select(index); + } else { + //use heuristic instead + int n2d = 0, n3d = 0; + _find_node_types(get_edited_scene(), n2d, n3d); + if (n2d > n3d) { + _editor_select(EDITOR_2D); + } else if (n3d > n2d) { + _editor_select(EDITOR_3D); + } } } } @@ -3575,13 +3608,6 @@ void EditorNode::_update_dock_slots_visibility() { right_r_vsplit, }; - HSplitContainer *h_splits[4] = { - left_l_hsplit, - left_r_hsplit, - main_hsplit, - right_hsplit, - }; - if (!docks_visible) { for (int i = 0; i < DOCK_SLOT_MAX; i++) { @@ -4818,9 +4844,10 @@ EditorNode::EditorNode() { } file_menu = memnew(MenuButton); + file_menu->set_flat(false); file_menu->set_text(TTR("Scene")); - left_menu_hb->add_child(file_menu); file_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + left_menu_hb->add_child(file_menu); prev_scene = memnew(ToolButton); prev_scene->set_icon(gui_base->get_icon("PrevScene", "EditorIcons")); @@ -4889,7 +4916,6 @@ EditorNode::EditorNode() { pm_export->set_name("Export"); p->add_child(pm_export); p->add_submenu_item(TTR("Convert To.."), "Export"); - pm_export->add_separator(); pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_MeshLibrary", TTR("MeshLibrary..")), FILE_EXPORT_MESH_LIBRARY); pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_TileSet", TTR("TileSet..")), FILE_EXPORT_TILESET); pm_export->connect("id_pressed", this, "_menu_option"); @@ -4909,6 +4935,7 @@ EditorNode::EditorNode() { p->add_item(TTR("Quit"), FILE_QUIT, KEY_MASK_CMD + KEY_Q); project_menu = memnew(MenuButton); + project_menu->set_flat(false); project_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools.")); project_menu->set_text(TTR("Project")); project_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); @@ -4942,9 +4969,11 @@ EditorNode::EditorNode() { menu_hb->add_child(editor_region); debug_menu = memnew(MenuButton); + debug_menu->set_flat(false); debug_menu->set_text(TTR("Debug")); debug_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); left_menu_hb->add_child(debug_menu); + p = debug_menu->get_popup(); p->set_hide_on_item_selection(false); p->add_check_item(TTR("Deploy with Remote Debug"), RUN_DEPLOY_REMOTE_DEBUG); @@ -4966,9 +4995,10 @@ EditorNode::EditorNode() { menu_hb->add_spacer(); settings_menu = memnew(MenuButton); - left_menu_hb->add_child(settings_menu); + settings_menu->set_flat(false); settings_menu->set_text(TTR("Editor")); settings_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + left_menu_hb->add_child(settings_menu); p = settings_menu->get_popup(); p->add_item(TTR("Editor Settings"), SETTINGS_PREFERENCES); @@ -4983,10 +5013,12 @@ EditorNode::EditorNode() { p->add_item(TTR("Manage Export Templates"), SETTINGS_MANAGE_EXPORT_TEMPLATES); // Help Menu - MenuButton *help_menu = memnew(MenuButton); - left_menu_hb->add_child(help_menu); + help_menu = memnew(MenuButton); + help_menu->set_flat(false); help_menu->set_text(TTR("Help")); help_menu->add_style_override("hover", gui_base->get_stylebox("MenuHover", "EditorStyles")); + left_menu_hb->add_child(help_menu); + p = help_menu->get_popup(); p->connect("id_pressed", this, "_menu_option"); p->add_icon_item(gui_base->get_icon("ClassList", "EditorIcons"), TTR("Classes"), HELP_CLASSES); diff --git a/editor/editor_node.h b/editor/editor_node.h index c3ceee350a..ea74bcbd9d 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -236,11 +236,12 @@ private: MenuButton *file_menu; MenuButton *project_menu; MenuButton *debug_menu; + MenuButton *settings_menu; + MenuButton *help_menu; PopupMenu *tool_menu; ToolButton *export_button; ToolButton *prev_scene; MenuButton *object_menu; - MenuButton *settings_menu; ToolButton *play_button; MenuButton *native_play_button; ToolButton *pause_button; diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 9c9eef848a..db76a27f5f 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -603,7 +603,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["text_editor/theme/color_theme"] = PropertyInfo(Variant::STRING, "text_editor/theme/color_theme", PROPERTY_HINT_ENUM, "Default"); set("text_editor/theme/line_spacing", 4); - set("text_editor/theme/adapted_code_editor_background_color", true); _load_default_text_editor_theme(); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 8943d5f0dc..19356aad3a 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -198,6 +198,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { bool highlight_tabs = EDITOR_DEF("interface/theme/highlight_tabs", false); int border_size = EDITOR_DEF("interface/theme/border_size", 1); + Color script_bg_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0)); + switch (preset) { case 0: { // Default highlight_color = Color::html("#699ce8"); @@ -235,8 +237,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { Color dark_color_2 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 1.5); Color dark_color_3 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 2); - Color contrast_color_1 = base_color.linear_interpolate((dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)), 0.3); - Color contrast_color_2 = base_color.linear_interpolate((dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)), 0.5); + Color contrast_color_1 = base_color.linear_interpolate((dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)), MAX(contrast, default_contrast)); + Color contrast_color_2 = base_color.linear_interpolate((dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)), MAX(contrast * 1.5, default_contrast * 1.5)); Color font_color = dark_theme ? Color(1, 1, 1) : Color(0, 0, 0); Color font_color_disabled = dark_theme ? Color(0.6, 0.6, 0.6) : Color(0.45, 0.45, 0.45); @@ -279,8 +281,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { editor_register_fonts(theme); // Editor background - Ref<StyleBoxFlat> style_panel = make_flat_stylebox(dark_color_2, 4, 4, 4, 4); - theme->set_stylebox("Background", "EditorStyles", style_panel); + theme->set_stylebox("Background", "EditorStyles", make_flat_stylebox(dark_color_2, 4, 4, 4, 4)); // Focus Ref<StyleBoxFlat> focus_sbt = make_flat_stylebox(contrast_color_1, 4, 4, 4, 4); @@ -302,12 +303,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { Ref<StyleBoxFlat> style_menu_hover_bg = make_flat_stylebox(dark_color_2, 4, 4, 4, 4); style_menu_hover_border->set_draw_center(false); - style_menu_hover_border->set_border_width(MARGIN_BOTTOM, border_width); + style_menu_hover_border->set_border_width(MARGIN_BOTTOM, 2 * EDSCALE); style_menu_hover_border->set_border_color_all(highlight_color); - style_menu_hover_border->set_expand_margin_size(MARGIN_BOTTOM, border_width); theme->set_stylebox("normal", "MenuButton", style_menu); - theme->set_stylebox("hover", "MenuButton", style_menu_hover_border); + theme->set_stylebox("hover", "MenuButton", style_menu); theme->set_stylebox("pressed", "MenuButton", style_menu); theme->set_stylebox("focus", "MenuButton", style_menu); theme->set_stylebox("disabled", "MenuButton", style_menu); @@ -333,10 +333,10 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("MenuHover", "EditorStyles", style_menu_hover_border); // Content of each tab - Ref<StyleBoxFlat> style_content_panel = make_flat_stylebox(base_color, 4, 5, 4, 4); + Ref<StyleBoxFlat> style_content_panel = make_flat_stylebox(base_color, 4, 4, 4, 4); style_content_panel->set_border_color_all(base_color); style_content_panel->set_border_width_all(border_width); - Ref<StyleBoxFlat> style_content_panel_vp = make_flat_stylebox(base_color, border_width, 5, border_width, border_width); + Ref<StyleBoxFlat> style_content_panel_vp = make_flat_stylebox(base_color, border_width, 4, border_width, border_width); style_content_panel_vp->set_border_color_all(base_color); style_content_panel_vp->set_border_width_all(border_width); theme->set_stylebox("panel", "TabContainer", style_content_panel); @@ -357,6 +357,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("pressed", "Button", change_border_color(style_button_type, highlight_color)); theme->set_stylebox("focus", "Button", change_border_color(style_button_type, highlight_color)); theme->set_stylebox("disabled", "Button", style_button_type_disabled); + theme->set_color("font_color", "Button", button_font_color); theme->set_color("font_color_hover", "Button", HIGHLIGHT_COLOR_FONT); theme->set_color("font_color_pressed", "Button", highlight_color); @@ -366,13 +367,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("icon_color_pressed", "Button", Color(highlight_color.r * 1.15, highlight_color.g * 1.15, highlight_color.b * 1.15, highlight_color.a)); // OptionButton - Ref<StyleBoxFlat> style_option_button = make_flat_stylebox(dark_color_1, 4, 4, 4, 4); - style_option_button->set_border_width_all(border_width); + theme->set_stylebox("normal", "OptionButton", style_button_type); theme->set_stylebox("hover", "OptionButton", change_border_color(style_button_type, contrast_color_1)); theme->set_stylebox("pressed", "OptionButton", change_border_color(style_button_type, HIGHLIGHT_COLOR_FONT)); theme->set_stylebox("focus", "OptionButton", change_border_color(style_button_type, highlight_color)); theme->set_stylebox("disabled", "OptionButton", style_button_type_disabled); - theme->set_stylebox("normal", "OptionButton", style_button_type); + theme->set_color("font_color", "OptionButton", button_font_color); theme->set_color("font_color_hover", "OptionButton", HIGHLIGHT_COLOR_FONT); theme->set_color("font_color_pressed", "OptionButton", highlight_color); @@ -385,6 +385,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // CheckButton theme->set_icon("on", "CheckButton", theme->get_icon("GuiToggleOn", "EditorIcons")); theme->set_icon("off", "CheckButton", theme->get_icon("GuiToggleOff", "EditorIcons")); + theme->set_color("font_color", "CheckButton", button_font_color); theme->set_color("font_color_hover", "CheckButton", HIGHLIGHT_COLOR_FONT); theme->set_color("font_color_pressed", "CheckButton", highlight_color); @@ -424,12 +425,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { style_tree_bg->set_border_color_all(dark_color_3); theme->set_stylebox("bg", "Tree", style_tree_bg); - // Script background - Ref<StyleBoxFlat> style_script_bg = make_flat_stylebox(dark_color_1, 0, 0, 0, 0); - style_script_bg->set_border_width_all(border_width); - style_script_bg->set_border_color_all(dark_color_3); - theme->set_stylebox("ScriptPanel", "EditorStyles", style_script_bg); - // Tree theme->set_icon("checked", "Tree", theme->get_icon("GuiChecked", "EditorIcons")); theme->set_icon("unchecked", "Tree", theme->get_icon("GuiUnchecked", "EditorIcons")); @@ -441,7 +436,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("custom_button_pressed", "Tree", make_empty_stylebox()); theme->set_stylebox("custom_button_hover", "Tree", style_button_type); theme->set_color("custom_button_font_highlight", "Tree", HIGHLIGHT_COLOR_FONT); - theme->set_color("font_color", "Tree", font_color_disabled); + theme->set_color("font_color", "Tree", font_color); theme->set_color("font_color_selected", "Tree", font_color); Ref<StyleBox> style_tree_btn = make_flat_stylebox(contrast_color_1, 2, 4, 2, 4); @@ -471,8 +466,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("prop_category", "Editor", prop_category_color); theme->set_color("prop_section", "Editor", prop_section_color); theme->set_color("prop_subsection", "Editor", prop_subsection_color); - theme->set_color("fg_selected", "Editor", HIGHLIGHT_COLOR_BG); - theme->set_color("fg_error", "Editor", error_color); theme->set_color("drop_position_color", "Tree", highlight_color); // ItemList @@ -531,6 +524,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // LineEdit Ref<StyleBoxFlat> style_line_edit = make_flat_stylebox(dark_color_1, 6, 4, 6, 4); + style_line_edit->set_border_width_all(border_width); style_line_edit = change_border_color(style_line_edit, contrast_color_1); Ref<StyleBoxFlat> style_line_edit_disabled = change_border_color(style_line_edit, dark_color_1); style_line_edit_disabled->set_bg_color(Color(0, 0, 0, .1)); @@ -614,11 +608,14 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_icon("grabber_highlight", "VSlider", theme->get_icon("GuiSliderGrabberHl", "EditorIcons")); //RichTextLabel - theme->set_color("font_color", "RichTextLabel", font_color); + Color rtl_combined_bg_color = dark_color_1.linear_interpolate(script_bg_color, script_bg_color.a); + Color rtl_font_color = (rtl_combined_bg_color.r + rtl_combined_bg_color.g + rtl_combined_bg_color.b > 0.5 * 3) ? Color(0, 0, 0) : Color(1, 1, 1); + theme->set_color("default_color", "RichTextLabel", rtl_font_color); theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox()); + theme->set_stylebox("normal", "RichTextLabel", make_flat_stylebox(script_bg_color, 6, 6, 6, 6)); // Panel - theme->set_stylebox("panel", "Panel", style_panel); + theme->set_stylebox("panel", "Panel", make_flat_stylebox(dark_color_1, 6, 4, 6, 4)); // Label theme->set_color("font_color", "Label", font_color); diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index ba90beee22..fccf7c323c 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -34,7 +34,7 @@ #include "io/marshalls.h" //#define DEBUG_PRINT(m_p) print_line(m_p) -#define DEBUG_TIME(m_what) printf("MS: %s - %lli\n", m_what, OS::get_singleton()->get_ticks_usec()); +#define DEBUG_TIME(m_what) printf("MS: %s - %lu\n", m_what, OS::get_singleton()->get_ticks_usec()); //#define DEBUG_TIME(m_what) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 0ad7b25e4a..a66d1724a1 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -828,7 +828,12 @@ void FileSystemDock::_move_operation(const String &p_to_path) { //make list of remaps Map<String, String> renames; String repfrom = path == "res://" ? path : String(path + "/"); - String repto = p_to_path == "res://" ? p_to_path : String(p_to_path + "/"); + String repto = p_to_path; + if (!repto.ends_with("/")) { + repto += "/"; + } + + print_line("reprfrom: " + repfrom + " repto " + repto); for (int i = 0; i < move_files.size(); i++) { renames[move_files[i]] = move_files[i].replace_first(repfrom, repto); @@ -868,6 +873,13 @@ void FileSystemDock::_move_operation(const String &p_to_path) { if (err != OK) { EditorNode::get_singleton()->add_io_error(TTR("Error moving file:\n") + move_files[i] + "\n"); } + if (FileAccess::exists(move_files[i] + ".import")) { //move imported files too + //@todo should remove the files in .import folder + err = da->rename(move_files[i] + ".import", to + ".import"); + if (err != OK) { + EditorNode::get_singleton()->add_io_error(TTR("Error moving file:\n") + move_files[i] + ".import\n"); + } + } } for (int i = 0; i < move_dirs.size(); i++) { @@ -1827,7 +1839,7 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { path = "res://"; - add_constant_override("separation", 3); + add_constant_override("separation", 4); } FileSystemDock::~FileSystemDock() { diff --git a/editor/icons/icon_class_list.svg b/editor/icons/icon_class_list.svg index 1f2b37bd25..87a20743c7 100644 --- a/editor/icons/icon_class_list.svg +++ b/editor/icons/icon_class_list.svg @@ -1,11 +1,5 @@ <svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> -<g transform="translate(0 -1036.4)" fill="#e0e0e0"> -<rect x="1" y="1038.4" width="5" height=".99998"/> -<rect x="6" y="1037.4" width="6" height="3"/> -<rect x="3" y="1038.4" width="1" height="11"/> -<rect x="4" y="1043.4" width="5" height="1"/> -<rect x="9" y="1042.4" width="6" height="3"/> -<rect x="4" y="1048.4" width="5" height="1"/> -<rect x="9" y="1047.4" width="6" height="3"/> +<g transform="translate(0 -1036.4)"> +<path transform="translate(0 1036.4)" d="m6 1v1h-5v1h2v10h1 5v1h6v-3h-6v1h-5v-4h5v1h6v-3h-6v1h-5v-4h2v1h6v-3h-6z" fill="#e0e0e0"/> </g> </svg> diff --git a/editor/icons/icon_file_dead.svg b/editor/icons/icon_file_dead.svg new file mode 100644 index 0000000000..e0aee6fd90 --- /dev/null +++ b/editor/icons/icon_file_dead.svg @@ -0,0 +1,7 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<g transform="translate(0 -1.6949e-5)"> +<path transform="translate(0 1036.4)" d="m2 1v14h12v-9h-5v-5zm8 0v4h4zm-6.0078 6c0.1353-0.0020779 0.26567 0.050774 0.36133 0.14648l0.64648 0.64648 0.64648-0.64648c0.09183-0.091882 0.21582-0.14442 0.3457-0.14648 0.1353-0.00208 0.26567 0.050774 0.36133 0.14648 0.19521 0.19525 0.19521 0.51178 0 0.70703l-0.64648 0.64648 0.64648 0.64648c0.19521 0.19525 0.19521 0.51178 0 0.70703-0.19525 0.19521-0.51178 0.19521-0.70703 0l-0.64648-0.64648-0.64648 0.64648c-0.19525 0.19521-0.51178 0.19521-0.70703 0-0.19521-0.19525-0.19521-0.51178 0-0.70703l0.64648-0.64648-0.64648-0.64648c-0.19521-0.19525-0.19521-0.51178 0-0.70703 0.09183-0.091882 0.21582-0.14442 0.3457-0.14648zm6 0c0.1353-0.00208 0.26567 0.050774 0.36133 0.14648l0.64648 0.64648 0.64648-0.64648c0.09183-0.091883 0.21582-0.14442 0.3457-0.14648 0.1353-0.00208 0.26567 0.050774 0.36133 0.14648 0.19521 0.19525 0.19521 0.51178 0 0.70703l-0.64648 0.64648 0.64648 0.64648c0.19521 0.19525 0.19521 0.51178 0 0.70703-0.19525 0.19521-0.51178 0.19521-0.70703 0l-0.64648-0.64648-0.64648 0.64648c-0.19525 0.19521-0.51178 0.19521-0.70703 0-0.19521-0.19525-0.19521-0.51178 0-0.70703l0.64648-0.64648-0.64648-0.64648c-0.19521-0.19525-0.19521-0.51178 0-0.70703 0.09183-0.091882 0.21582-0.14442 0.3457-0.14648zm-6.4922 4h9c0.277 0 0.5 0.223 0.5 0.5s-0.223 0.5-0.5 0.5h-4.5c0 1.1046-0.89543 2-2 2s-2-0.8954-2-2h-0.5c-0.277 0-0.5-0.223-0.5-0.5s0.223-0.5 0.5-0.5zm1.5 1c-1.9e-5 0.5523 0.44771 1 1 1s1-0.4477 1-1z" fill="#ff8484"/> +</g> +</g> +</svg> diff --git a/editor/icons/icon_filesystem.svg b/editor/icons/icon_filesystem.svg new file mode 100644 index 0000000000..41e0348d68 --- /dev/null +++ b/editor/icons/icon_filesystem.svg @@ -0,0 +1,5 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<path transform="translate(0 1036.4)" d="m1 1v5h2v8h1 5v1h6v-3h-6v1h-5v-4h5v1h6v-3h-6v1h-5v-2h3v-4h-2l-1-1h-3z" fill="#e0e0e0"/> +</g> +</svg> diff --git a/editor/icons/icon_key_call.svg b/editor/icons/icon_key_call.svg new file mode 100644 index 0000000000..7fcc65801a --- /dev/null +++ b/editor/icons/icon_key_call.svg @@ -0,0 +1,5 @@ +<svg width="8" height="8" version="1.1" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1044.4)"> +<rect transform="rotate(-45)" x="-741.53" y="741.08" width="6.1027" height="6.1027" ry=".76286" fill="#adf18f"/> +</g> +</svg> diff --git a/editor/icons/icon_mini_checkerboard.svg b/editor/icons/icon_mini_checkerboard.svg new file mode 100644 index 0000000000..e740113b2d --- /dev/null +++ b/editor/icons/icon_mini_checkerboard.svg @@ -0,0 +1,4 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<path d="m0 0v8h8v-8h-8zm8 8v8h8v-8h-8z" fill="#e0e0e0" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.9994"/> +<path d="m8 0v8h8v-8h-8zm0 8h-8v8h8v-8z" fill="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.9994"/> +</svg> diff --git a/editor/icons/icon_shader_material.svg b/editor/icons/icon_shader_material.svg new file mode 100644 index 0000000000..f77aa837c5 --- /dev/null +++ b/editor/icons/icon_shader_material.svg @@ -0,0 +1,11 @@ +<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> +<g transform="translate(0 -1036.4)"> +<path transform="translate(0 1036.4)" d="m2 1c-0.55226 1e-4 -0.99994 0.4477-1 1v1h2 6 3l-2-2h-8z" fill="#ff7070"/> +<path transform="translate(0 1036.4)" d="m1 3v2h2v-2h-2zm8 0v2h5l-2-2h-3z" fill="#ffeb70"/> +<path transform="translate(0 1036.4)" d="m1 5v2h2v-2h-2zm8 0v1c0 0.554 0.44599 1 1 1h3 2v-1l-1-1h-5z" fill="#9dff70"/> +<path transform="translate(0 1036.4)" d="m1 7v2h2v-2h-2zm12 0v2h2v-2h-2z" fill="#70ffb9"/> +<path transform="translate(0 1036.4)" d="m1 9v2h2v-2h-2zm12 0v2h2v-2h-2z" fill="#70deff"/> +<path transform="translate(0 1036.4)" d="m1 13v1c5.52e-5 0.5523 0.44774 0.9999 1 1h12c0.55226-1e-4 0.99994-0.4477 1-1v-1h-2-10-2z" fill="#ff70ac"/> +<path transform="translate(0 1036.4)" d="m1 11v2h2v-2h-2zm12 0v2h2v-2h-2z" fill="#9f70ff"/> +</g> +</svg> diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 2f03e72851..831eb74b66 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -55,8 +55,8 @@ Error EditorSceneImporterGLTF::_parse_glb(const String &p_path, GLTFState &state uint32_t magic = f->get_32(); ERR_FAIL_COND_V(magic != 0x46546C67, ERR_FILE_UNRECOGNIZED); //glTF - uint32_t version = f->get_32(); - uint32_t length = f->get_32(); + f->get_32(); // version + f->get_32(); // length uint32_t chunk_length = f->get_32(); uint32_t chunk_type = f->get_32(); @@ -474,7 +474,7 @@ Error EditorSceneImporterGLTF::_decode_buffer_view(GLTFState &state, int p_buffe int buffer_end = (stride * (count - 1)) + element_size; ERR_FAIL_COND_V(buffer_end > bv.byte_length, ERR_PARSE_ERROR); - ERR_FAIL_COND_V((offset + buffer_end) > buffer.size(), ERR_PARSE_ERROR); + ERR_FAIL_COND_V((int)(offset + buffer_end) > buffer.size(), ERR_PARSE_ERROR); //fill everything as doubles @@ -1434,6 +1434,8 @@ Error EditorSceneImporterGLTF::_parse_cameras(GLTFState &state) { } print_line("total cameras: " + itos(state.cameras.size())); + + return OK; } Error EditorSceneImporterGLTF::_parse_animations(GLTFState &state) { @@ -1943,7 +1945,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye bool last = false; while (true) { - float value = _interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, track.weight_tracks[i].interpolation); + _interpolate_track<float>(track.weight_tracks[i].times, track.weight_tracks[i].values, time, track.weight_tracks[i].interpolation); if (last) { break; } diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 594728d2e0..0bbe287e2b 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -230,8 +230,8 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Array if (isroot) return p_node; - - if (MeshInstance *mi = Object::cast_to<MeshInstance>(p_node)) { + MeshInstance *mi = Object::cast_to<MeshInstance>(p_node); + if (mi) { Node *col = mi->create_trimesh_collision_node(); ERR_FAIL_COND_V(!col, NULL); @@ -1024,7 +1024,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p String root_type = p_options["nodes/root_type"]; if (scene->get_class() != root_type) { - Node *base_node = base_node = Object::cast_to<Node>(ClassDB::instance(root_type)); + Node *base_node = Object::cast_to<Node>(ClassDB::instance(root_type)); if (base_node) { diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index ade3550daa..f29bdde634 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -33,7 +33,7 @@ #include "io/config_file.h" #include "io/image_loader.h" #include "scene/resources/texture.h" - +#include "editor/editor_node.h" void ResourceImporterTexture::_texture_reimport_srgb(const Ref<StreamTexture> &p_tex) { singleton->mutex->lock(); @@ -411,10 +411,14 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String if (compress_mode == COMPRESS_VIDEO_RAM) { //must import in all formats, in order of priority (so platform choses the best supported one. IE, etc2 over etc). //Android, GLES 2.x + + bool ok_on_pc=false; + if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_s3tc")) { _save_stex(image, p_save_path + ".s3tc.stex", compress_mode, lossy, Image::COMPRESS_S3TC, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal); r_platform_variants->push_back("s3tc"); + ok_on_pc=true; } if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc2")) { @@ -434,6 +438,9 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String r_platform_variants->push_back("pvrtc"); } + if (!ok_on_pc) { + EditorNode::add_io_error("Warning, no suitable PC VRAM compression enabled in Project Settings. This texture will not display correcly on PC."); + } } else { //import normally _save_stex(image, p_save_path + ".stex", compress_mode, lossy, Image::COMPRESS_S3TC /*this is ignored */, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal); diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index 25185149b1..025dbbaacf 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -103,7 +103,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s } /* GET FILESIZE */ - uint32_t filesize = file->get_32(); + file->get_32(); // filesize /* CHECK WAVE */ @@ -129,7 +129,7 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s int format_freq = 0; int loop_begin = 0; int loop_end = 0; - int frames; + int frames = 0; Vector<float> data; diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 4f3472bf03..2b2358f3d0 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -409,7 +409,7 @@ bool CanvasItemEditor::_is_part_of_subscene(CanvasItem *p_item) { return item_owner && item_owner != scene_node && p_item != scene_node && item_owner->get_filename() != ""; } -void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, Vector<_SelectResult> &r_items, unsigned int limit) { +void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, Vector<_SelectResult> &r_items, int limit) { if (!p_node) return; if (Object::cast_to<Viewport>(p_node)) @@ -580,7 +580,8 @@ void CanvasItemEditor::_key_move(const Vector2 &p_dir, bool p_snap, KeyMoveMODE } else { // p_move_mode==MOVE_LOCAL_BASE || p_move_mode==MOVE_LOCAL_WITH_ROT - if (Node2D *node_2d = Object::cast_to<Node2D>(canvas_item)) { + Node2D *node_2d = Object::cast_to<Node2D>(canvas_item); + if (node_2d) { if (p_move_mode == MOVE_LOCAL_WITH_ROT) { Transform2D m; @@ -589,9 +590,10 @@ void CanvasItemEditor::_key_move(const Vector2 &p_dir, bool p_snap, KeyMoveMODE } node_2d->set_position(node_2d->get_position() + drag); - } else if (Control *control = Object::cast_to<Control>(canvas_item)) { - - control->set_position(control->get_position() + drag); + } else { + Control *control = Object::cast_to<Control>(canvas_item); + if (control) + control->set_position(control->get_position() + drag); } } } @@ -742,7 +744,8 @@ float CanvasItemEditor::_anchor_snap(float p_anchor, bool *p_snapped, float p_op float radius = 0.05 / zoom; float basic_anchors[3] = { 0.0, 0.5, 1.0 }; for (int i = 0; i < 3; i++) { - if ((dist = fabs(p_anchor - basic_anchors[i])) < radius) { + dist = fabs(p_anchor - basic_anchors[i]); + if (dist < radius) { if (!snapped || dist <= dist_min) { p_anchor = basic_anchors[i]; dist_min = dist; @@ -750,7 +753,8 @@ float CanvasItemEditor::_anchor_snap(float p_anchor, bool *p_snapped, float p_op } } } - if (p_opposite_anchor >= 0 && (dist = fabs(p_anchor - p_opposite_anchor)) < radius) { + dist = fabs(p_anchor - p_opposite_anchor); + if (p_opposite_anchor >= 0 && dist < radius) { if (!snapped || dist <= dist_min) { p_anchor = p_opposite_anchor; dist_min = dist; @@ -1019,6 +1023,51 @@ void CanvasItemEditor::_list_select(const Ref<InputEventMouseButton> &b) { } } +void CanvasItemEditor::_update_cursor() { + + CursorShape c = CURSOR_ARROW; + switch (drag) { + case DRAG_NONE: + if (Input::get_singleton()->is_mouse_button_pressed(BUTTON_MIDDLE) || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { + c = CURSOR_DRAG; + } else { + switch (tool) { + case TOOL_MOVE: + c = CURSOR_MOVE; + break; + case TOOL_EDIT_PIVOT: + c = CURSOR_CROSS; + break; + case TOOL_PAN: + c = CURSOR_DRAG; + break; + } + } + break; + case DRAG_LEFT: + case DRAG_RIGHT: + c = CURSOR_HSIZE; + break; + case DRAG_TOP: + case DRAG_BOTTOM: + c = CURSOR_VSIZE; + break; + case DRAG_TOP_LEFT: + case DRAG_BOTTOM_RIGHT: + c = CURSOR_FDIAGSIZE; + break; + case DRAG_TOP_RIGHT: + case DRAG_BOTTOM_LEFT: + c = CURSOR_BDIAGSIZE; + break; + case DRAG_ALL: + case DRAG_NODE_2D: + c = CURSOR_MOVE; + break; + } + viewport->set_default_cursor_shape(c); +} + void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) { { @@ -1457,6 +1506,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) { Ref<InputEventMouseMotion> m = p_event; if (m.is_valid()) { // Mouse motion event + _update_cursor(); if (!viewport->has_focus() && (!get_focus_owner() || !get_focus_owner()->is_text_field())) viewport->call_deferred("grab_focus"); @@ -1469,7 +1519,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) { } if (drag == DRAG_NONE) { - if ((m->get_button_mask() & BUTTON_MASK_LEFT && tool == TOOL_PAN) || m->get_button_mask() & BUTTON_MASK_MIDDLE || (m->get_button_mask() & BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE))) { + if (((m->get_button_mask() & BUTTON_MASK_LEFT) && tool == TOOL_PAN) || (m->get_button_mask() & BUTTON_MASK_MIDDLE) || ((m->get_button_mask() & BUTTON_MASK_LEFT) && Input::get_singleton()->is_key_pressed(KEY_SPACE))) { // Pan the viewport Point2i relative; if (bool(EditorSettings::get_singleton()->get("editors/2d/warped_mouse_panning"))) { @@ -1881,7 +1931,7 @@ void CanvasItemEditor::_viewport_draw() { if (snap_show_grid) { //Draw the grid Size2 s = viewport->get_size(); - int last_cell; + int last_cell = 0; Transform2D xform = transform.affine_inverse(); Vector2 grid_offset; @@ -2223,6 +2273,8 @@ void CanvasItemEditor::_notification(int p_what) { if (p_what == NOTIFICATION_FIXED_PROCESS) { + EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET("gui/common/snap_controls_to_pixels")); + List<Node *> &selection = editor_selection->get_selected_node_list(); bool all_control = true; @@ -2257,17 +2309,17 @@ void CanvasItemEditor::_notification(int p_what) { anchors[MARGIN_RIGHT] = Object::cast_to<Control>(canvas_item)->get_anchor(MARGIN_RIGHT); anchors[MARGIN_TOP] = Object::cast_to<Control>(canvas_item)->get_anchor(MARGIN_TOP); anchors[MARGIN_BOTTOM] = Object::cast_to<Control>(canvas_item)->get_anchor(MARGIN_BOTTOM); - } - if (r != se->prev_rect || xform != se->prev_xform || pivot != se->prev_pivot || anchors[MARGIN_LEFT] != se->prev_anchors[MARGIN_LEFT] || anchors[MARGIN_RIGHT] != se->prev_anchors[MARGIN_RIGHT] || anchors[MARGIN_TOP] != se->prev_anchors[MARGIN_TOP] || anchors[MARGIN_BOTTOM] != se->prev_anchors[MARGIN_BOTTOM]) { - viewport->update(); - se->prev_rect = r; - se->prev_xform = xform; - se->prev_pivot = pivot; - se->prev_anchors[MARGIN_LEFT] = anchors[MARGIN_LEFT]; - se->prev_anchors[MARGIN_RIGHT] = anchors[MARGIN_RIGHT]; - se->prev_anchors[MARGIN_TOP] = anchors[MARGIN_TOP]; - se->prev_anchors[MARGIN_BOTTOM] = anchors[MARGIN_BOTTOM]; + if (r != se->prev_rect || xform != se->prev_xform || pivot != se->prev_pivot || anchors[MARGIN_LEFT] != se->prev_anchors[MARGIN_LEFT] || anchors[MARGIN_RIGHT] != se->prev_anchors[MARGIN_RIGHT] || anchors[MARGIN_TOP] != se->prev_anchors[MARGIN_TOP] || anchors[MARGIN_BOTTOM] != se->prev_anchors[MARGIN_BOTTOM]) { + viewport->update(); + se->prev_rect = r; + se->prev_xform = xform; + se->prev_pivot = pivot; + se->prev_anchors[MARGIN_LEFT] = anchors[MARGIN_LEFT]; + se->prev_anchors[MARGIN_RIGHT] = anchors[MARGIN_RIGHT]; + se->prev_anchors[MARGIN_TOP] = anchors[MARGIN_TOP]; + se->prev_anchors[MARGIN_BOTTOM] = anchors[MARGIN_BOTTOM]; + } } } @@ -3562,29 +3614,31 @@ void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) cons Sprite *sprite = memnew(Sprite); sprite->set_texture(texture); sprite->set_modulate(Color(1, 1, 1, 0.7f)); - preview->add_child(sprite); + preview_node->add_child(sprite); label->show(); label_desc->show(); } else { if (scene.is_valid()) { Node *instance = scene->instance(); if (instance) { - preview->add_child(instance); + preview_node->add_child(instance); } } } - editor->get_scene_root()->add_child(preview); + editor->get_scene_root()->add_child(preview_node); } } } void CanvasItemEditorViewport::_remove_preview() { - if (preview->get_parent()) { - editor->get_scene_root()->remove_child(preview); - for (int i = preview->get_child_count() - 1; i >= 0; i--) { - Node *node = preview->get_child(i); - memdelete(node); + if (preview_node->get_parent()) { + for (int i = preview_node->get_child_count() - 1; i >= 0; i--) { + Node *node = preview_node->get_child(i); + node->queue_delete(); + preview_node->remove_child(node); } + editor->get_scene_root()->remove_child(preview_node); + label->hide(); label_desc->hide(); } @@ -3794,11 +3848,11 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian break; } if (can_instance) { - if (!preview->get_parent()) { // create preview only once + if (!preview_node->get_parent()) { // create preview only once _create_preview(files); } Transform2D trans = canvas->get_canvas_transform(); - preview->set_position((p_point - trans.get_origin()) / trans.get_scale().x); + preview_node->set_position((p_point - trans.get_origin()) / trans.get_scale().x); label->set_text(vformat(TTR("Adding %s..."), default_type)); } return can_instance; @@ -3820,11 +3874,16 @@ void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p List<Node *> list = editor->get_editor_selection()->get_selected_node_list(); if (list.size() == 0) { - accept->get_ok()->set_text(TTR("OK :(")); - accept->set_text(TTR("No parent to instance a child at.")); - accept->popup_centered_minsize(); - _remove_preview(); - return; + Node *root_node = editor->get_edited_scene(); + if (root_node) { + list.push_back(root_node); + } else { + accept->get_ok()->set_text(TTR("OK :(")); + accept->set_text(TTR("No parent to instance a child at.")); + accept->popup_centered_minsize(); + _remove_preview(); + return; + } } if (list.size() != 1) { accept->get_ok()->set_text(TTR("I see..")); @@ -3891,7 +3950,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte editor = p_node; editor_data = editor->get_scene_tree_dock()->get_editor_data(); canvas = p_canvas; - preview = memnew(Node2D); + preview_node = memnew(Node2D); accept = memnew(AcceptDialog); editor->get_gui_base()->add_child(accept); @@ -3945,5 +4004,5 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte } CanvasItemEditorViewport::~CanvasItemEditorViewport() { - memdelete(preview); + memdelete(preview_node); } diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index 8f67d641f5..2e1a2eac5f 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -34,7 +34,6 @@ #include "editor/editor_plugin.h" #include "scene/2d/canvas_item.h" #include "scene/gui/box_container.h" -#include "scene/gui/button_group.h" #include "scene/gui/check_box.h" #include "scene/gui/label.h" #include "scene/gui/panel_container.h" @@ -291,7 +290,7 @@ class CanvasItemEditor : public VBoxContainer { int handle_len; bool _is_part_of_subscene(CanvasItem *p_item); - void _find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, Vector<_SelectResult> &r_items, unsigned int limit = 0); + void _find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, Vector<_SelectResult> &r_items, int limit = 0); void _find_canvas_items_at_rect(const Rect2 &p_rect, Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, List<CanvasItem *> *r_items); void _select_click_on_empty_area(Point2 p_click_pos, bool p_append, bool p_box_selection); @@ -324,6 +323,7 @@ class CanvasItemEditor : public VBoxContainer { bool updating_scroll; void _update_scroll(float); void _update_scrollbars(); + void _update_cursor(); void incbeg(float &beg, float &end, float inc, float minsize, bool p_symmetric); void incend(float &beg, float &end, float inc, float minsize, bool p_symmetric); @@ -459,7 +459,7 @@ class CanvasItemEditorViewport : public Control { EditorNode *editor; EditorData *editor_data; CanvasItemEditor *canvas; - Node2D *preview; + Node2D *preview_node; AcceptDialog *accept; WindowDialog *selector; Label *selector_label; diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.h b/editor/plugins/collision_polygon_2d_editor_plugin.h index bc3c5a1659..4715abd2e6 100644 --- a/editor/plugins/collision_polygon_2d_editor_plugin.h +++ b/editor/plugins/collision_polygon_2d_editor_plugin.h @@ -33,7 +33,6 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "scene/2d/collision_polygon_2d.h" -#include "scene/gui/button_group.h" #include "scene/gui/tool_button.h" /** diff --git a/editor/plugins/collision_polygon_editor_plugin.h b/editor/plugins/collision_polygon_editor_plugin.h index 0150d8a9d7..0f63810443 100644 --- a/editor/plugins/collision_polygon_editor_plugin.h +++ b/editor/plugins/collision_polygon_editor_plugin.h @@ -35,7 +35,6 @@ #include "scene/3d/collision_polygon.h" #include "scene/3d/immediate_geometry.h" #include "scene/3d/mesh_instance.h" -#include "scene/gui/button_group.h" #include "scene/gui/tool_button.h" /** diff --git a/editor/plugins/cube_grid_theme_editor_plugin.cpp b/editor/plugins/cube_grid_theme_editor_plugin.cpp index 08b38c2ca2..1c17daf425 100644 --- a/editor/plugins/cube_grid_theme_editor_plugin.cpp +++ b/editor/plugins/cube_grid_theme_editor_plugin.cpp @@ -88,7 +88,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, if (mesh.is_null()) continue; - int id = p_library->find_item_name(mi->get_name()); + int id = p_library->find_item_by_name(mi->get_name()); if (id < 0) { id = p_library->get_last_unused_item_id(); @@ -111,7 +111,8 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, sb->get_shape_owners(&shapes); for (List<uint32_t>::Element *E = shapes.front(); E; E = E->next()) { - if (sb->is_shape_owner_disabled(E->get())) continue; + if (sb->is_shape_owner_disabled(E->get())) + continue; //Transform shape_transform = sb->shape_owner_get_transform(E->get()); @@ -120,7 +121,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) { Ref<Shape> collision = sb->shape_owner_get_shape(E->get(), k); - if (collision.is_valid()) + if (!collision.is_valid()) continue; MeshLibrary::ShapeData shape_data; shape_data.shape = collision; diff --git a/editor/plugins/light_occluder_2d_editor_plugin.h b/editor/plugins/light_occluder_2d_editor_plugin.h index 7a4f18963d..b270dcb6e5 100644 --- a/editor/plugins/light_occluder_2d_editor_plugin.h +++ b/editor/plugins/light_occluder_2d_editor_plugin.h @@ -33,7 +33,6 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "scene/2d/light_occluder_2d.h" -#include "scene/gui/button_group.h" #include "scene/gui/tool_button.h" /** diff --git a/editor/plugins/line_2d_editor_plugin.cpp b/editor/plugins/line_2d_editor_plugin.cpp index a5f854e1b1..84620a75a5 100644 --- a/editor/plugins/line_2d_editor_plugin.cpp +++ b/editor/plugins/line_2d_editor_plugin.cpp @@ -211,7 +211,7 @@ void Line2DEditor::_bind_methods() { } void Line2DEditor::_mode_selected(int p_mode) { - for (unsigned int i = 0; i < _MODE_COUNT; ++i) { + for (int i = 0; i < _MODE_COUNT; ++i) { toolbar_buttons[i]->set_pressed(i == p_mode); } mode = Mode(p_mode); diff --git a/editor/plugins/line_2d_editor_plugin.h b/editor/plugins/line_2d_editor_plugin.h index dea77ec248..dea0433084 100644 --- a/editor/plugins/line_2d_editor_plugin.h +++ b/editor/plugins/line_2d_editor_plugin.h @@ -34,7 +34,6 @@ #include "editor/editor_plugin.h" #include "scene/2d/line_2d.h" #include "scene/2d/path_2d.h" -#include "scene/gui/button_group.h" #include "scene/gui/tool_button.h" class CanvasItemEditor; diff --git a/editor/plugins/navigation_polygon_editor_plugin.h b/editor/plugins/navigation_polygon_editor_plugin.h index 33f9d5c785..7dd555e9c9 100644 --- a/editor/plugins/navigation_polygon_editor_plugin.h +++ b/editor/plugins/navigation_polygon_editor_plugin.h @@ -33,7 +33,6 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "scene/2d/navigation_polygon.h" -#include "scene/gui/button_group.h" #include "scene/gui/tool_button.h" /** diff --git a/editor/plugins/path_2d_editor_plugin.h b/editor/plugins/path_2d_editor_plugin.h index c195845244..f0f5d4d637 100644 --- a/editor/plugins/path_2d_editor_plugin.h +++ b/editor/plugins/path_2d_editor_plugin.h @@ -33,7 +33,6 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "scene/2d/path_2d.h" -#include "scene/gui/button_group.h" #include "scene/gui/tool_button.h" /** diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index a3195c05d6..3917c700f0 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -395,7 +395,7 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { if (mm.is_valid()) { - if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) { + if (edited_point != -1 && (wip_active || (mm->get_button_mask() & BUTTON_MASK_LEFT))) { Vector2 gpoint = mm->get_position(); Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint); @@ -554,7 +554,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) { if (mm.is_valid()) { - if (mm->get_button_mask() & BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { + if ((mm->get_button_mask() & BUTTON_MASK_MIDDLE) || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { Vector2 drag(mm->get_relative().x, mm->get_relative().y); uv_hscroll->set_value(uv_hscroll->get_value() - drag.x); @@ -659,7 +659,7 @@ void Polygon2DEditor::_uv_draw() { if (snap_show_grid) { Size2 s = uv_edit_draw->get_size(); - int last_cell; + int last_cell = 0; if (snap_step.x != 0) { for (int i = 0; i < s.width; i++) { diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h index 38148ca7e3..f9d6a6b4b6 100644 --- a/editor/plugins/polygon_2d_editor_plugin.h +++ b/editor/plugins/polygon_2d_editor_plugin.h @@ -33,7 +33,6 @@ #include "editor/editor_node.h" #include "editor/editor_plugin.h" #include "scene/2d/polygon_2d.h" -#include "scene/gui/button_group.h" #include "scene/gui/tool_button.h" /** diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index a529f152dc..04be1ba4ab 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -972,6 +972,14 @@ void ScriptEditor::_menu_option(int p_option) { EditorNode::get_singleton()->show_warning("Can't obtain the script for running"); break; } + + current->apply_code(); + Error err = scr->reload(false); //hard reload script before running always + + if (err != OK) { + EditorNode::get_singleton()->show_warning("Script failed reloading, check console for errors."); + return; + } if (!scr->is_tool()) { EditorNode::get_singleton()->show_warning("Script is not in tool mode, will not be able to run"); @@ -1149,8 +1157,6 @@ void ScriptEditor::_notification(int p_what) { case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - tab_container->add_style_override("panel", editor->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles")); - help_search->set_icon(get_icon("HelpSearch", "EditorIcons")); site_search->set_icon(get_icon("Instance", "EditorIcons")); class_search->set_icon(get_icon("ClassList", "EditorIcons")); @@ -1417,7 +1423,7 @@ void ScriptEditor::_update_script_colors() { int non_zero_hist_size = (hist_size == 0) ? 1 : hist_size; float v = Math::ease((edit_pass - pass) / float(non_zero_hist_size), 0.4); - script_list->set_item_custom_bg_color(i, hot_color.linear_interpolate(cold_color, v)); + script_list->set_item_custom_fg_color(i, hot_color.linear_interpolate(cold_color, v)); } } } @@ -1539,8 +1545,14 @@ bool ScriptEditor::edit(const Ref<Script> &p_script, int p_line, int p_col, bool bool open_dominant = EditorSettings::get_singleton()->get("text_editor/files/open_dominant_script_on_scene_change"); + if (p_script->get_language()->overrides_external_editor()) { + Error err = p_script->get_language()->open_in_external_editor(p_script, p_line >= 0 ? p_line : 0, p_col); + if (err != OK) + ERR_PRINT("Couldn't open script in the overridden external text editor"); + return false; + } + if ((debugger->get_dump_stack_script() != p_script || debugger->get_debug_with_external_editor()) && - p_script->get_language()->open_in_external_editor(p_script, p_line >= 0 ? p_line : 0, p_col) == OK && p_script->get_path().is_resource_file() && bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) { @@ -2210,7 +2222,6 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { members_overview->set_v_size_flags(SIZE_EXPAND_FILL); tab_container = memnew(TabContainer); - tab_container->add_style_override("panel", p_editor->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles")); tab_container->set_tabs_visible(false); script_split->add_child(tab_container); @@ -2506,9 +2517,9 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { EDITOR_DEF("text_editor/open_scripts/script_temperature_enabled", true); EDITOR_DEF("text_editor/open_scripts/highlight_current_script", true); EDITOR_DEF("text_editor/open_scripts/script_temperature_history_size", 15); - EDITOR_DEF("text_editor/open_scripts/script_temperature_hot_color", Color(1, 0, 0, 0.3)); - EDITOR_DEF("text_editor/open_scripts/script_temperature_cold_color", Color(0, 0, 1, 0.3)); - EDITOR_DEF("text_editor/open_scripts/current_script_background_color", Color(0.81, 0.81, 0.14, 0.63)); + EDITOR_DEF("text_editor/open_scripts/script_temperature_hot_color", Color::html("ed5e5e")); + EDITOR_DEF("text_editor/open_scripts/script_temperature_cold_color", Color(1, 1, 1, 0.3)); + EDITOR_DEF("text_editor/open_scripts/current_script_background_color", Color(1, 1, 1, 0.5)); EDITOR_DEF("text_editor/open_scripts/group_help_pages", true); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "text_editor/open_scripts/sort_scripts_by", PROPERTY_HINT_ENUM, "Name,Path")); EDITOR_DEF("text_editor/open_scripts/sort_scripts_by", 0); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 33890d890d..2192d3ac49 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -75,14 +75,9 @@ void ScriptTextEditor::_load_theme_settings() { text_edit->clear_colors(); - /* color from color_theme or from editor color */ - - Color background_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0)); - if (EDITOR_DEF("text_editor/theme/adapted_code_editor_background_color", false)) - background_color = get_color("dark_color_1", "Editor"); - /* keyword color */ - text_edit->add_color_override("background_color", background_color); + + text_edit->add_color_override("background_color", EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0))); text_edit->add_color_override("completion_background_color", EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0, 0, 0, 0))); text_edit->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244"))); text_edit->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf"))); @@ -629,7 +624,7 @@ void ScriptTextEditor::_code_complete_script(const String &p_code, List<String> } String hint; Error err = script->get_language()->complete_code(p_code, script->get_path().get_base_dir(), base, r_options, r_force, hint); - if (hint != "") { + if (err == OK && hint != "") { code_editor->get_text_edit()->set_code_hint(hint); } } diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 13b0391a87..1b02f18d85 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -164,6 +164,8 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List<String> String calltip; Error err = sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip); + if (err != OK) + ERR_PRINT("Shaderlang complete failed"); if (calltip != "") { get_text_edit()->set_code_hint(calltip); @@ -289,6 +291,8 @@ void ShaderEditor::_editor_settings_changed() { shader_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink_speed")); shader_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/theme/line_spacing")); shader_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/cursor/block_caret")); + shader_editor->get_text_edit()->set_smooth_scroll_enabled(EditorSettings::get_singleton()->get("text_editor/open_scripts/smooth_scrolling")); + shader_editor->get_text_edit()->set_v_scroll_speed(EditorSettings::get_singleton()->get("text_editor/open_scripts/v_scroll_speed")); } void ShaderEditor::_bind_methods() { @@ -401,13 +405,7 @@ void ShaderEditorPlugin::edit(Object *p_object) { bool ShaderEditorPlugin::handles(Object *p_object) const { - bool handles = true; Shader *shader = Object::cast_to<Shader>(p_object); - /* - if (Object::cast_to<ShaderGraph>(shader)) // Don't handle ShaderGraph's - handles = false; - */ - return shader != NULL; } diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index d2e60ef9ce..235700a3c3 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -35,12 +35,15 @@ #include "editor/editor_node.h" #include "editor/editor_settings.h" #include "editor/plugins/animation_player_editor_plugin.h" +#include "editor/plugins/script_editor_plugin.h" +#include "editor/script_editor_debugger.h" #include "editor/spatial_editor_gizmos.h" #include "os/keyboard.h" #include "print_string.h" #include "project_settings.h" #include "scene/3d/camera.h" #include "scene/3d/visual_instance.h" +#include "scene/resources/packed_scene.h" #include "scene/resources/surface_tool.h" #include "sort.h" @@ -77,7 +80,7 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) { Transform old_transform = camera->get_global_transform(); Transform transform; - bool disable_interp = (Input::get_singleton()->get_mouse_button_mask() & (2 | 4)) || Input::get_singleton()->is_key_pressed(KEY_SHIFT) || Input::get_singleton()->is_key_pressed(KEY_ALT) || Input::get_singleton()->is_key_pressed(KEY_CONTROL); + bool disable_interp = orthogonal || (Input::get_singleton()->get_mouse_button_mask() & (2 | 4)) || Input::get_singleton()->is_key_pressed(KEY_SHIFT) || Input::get_singleton()->is_key_pressed(KEY_ALT) || Input::get_singleton()->is_key_pressed(KEY_CONTROL); if (p_interp_delta && !disable_interp) { //interpolate @@ -228,7 +231,7 @@ Vector3 SpatialEditorViewport::_get_camera_normal() const { return -_get_camera_transform().basis.get_axis(2); } -Vector3 SpatialEditorViewport::_get_ray(const Vector2 &p_pos) { +Vector3 SpatialEditorViewport::_get_ray(const Vector2 &p_pos) const { return camera->project_ray_normal(p_pos); } @@ -700,6 +703,11 @@ void SpatialEditorViewport::_smouseenter() { surface->grab_focus(); } +void SpatialEditorViewport::_smouseexit() { + + _remove_preview(); +} + void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) { _find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->get_shift()); @@ -1895,6 +1903,7 @@ void SpatialEditorViewport::_notification(int p_what) { surface->connect("draw", this, "_draw"); surface->connect("gui_input", this, "_sinput"); surface->connect("mouse_entered", this, "_smouseenter"); + surface->connect("mouse_exited", this, "_smouseexit"); info->add_style_override("panel", get_stylebox("panel", "Panel")); preview_camera->set_icon(get_icon("Camera", "EditorIcons")); _init_gizmo_instance(index); @@ -2425,6 +2434,7 @@ void SpatialEditorViewport::_bind_methods() { ClassDB::bind_method(D_METHOD("_draw"), &SpatialEditorViewport::_draw); ClassDB::bind_method(D_METHOD("_smouseenter"), &SpatialEditorViewport::_smouseenter); + ClassDB::bind_method(D_METHOD("_smouseexit"), &SpatialEditorViewport::_smouseexit); ClassDB::bind_method(D_METHOD("_sinput"), &SpatialEditorViewport::_sinput); ClassDB::bind_method(D_METHOD("_menu_option"), &SpatialEditorViewport::_menu_option); ClassDB::bind_method(D_METHOD("_toggle_camera_preview"), &SpatialEditorViewport::_toggle_camera_preview); @@ -2432,6 +2442,8 @@ void SpatialEditorViewport::_bind_methods() { ClassDB::bind_method(D_METHOD("update_transform_gizmo_view"), &SpatialEditorViewport::update_transform_gizmo_view); ClassDB::bind_method(D_METHOD("_selection_result_pressed"), &SpatialEditorViewport::_selection_result_pressed); ClassDB::bind_method(D_METHOD("_selection_menu_hide"), &SpatialEditorViewport::_selection_menu_hide); + ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SpatialEditorViewport::can_drop_data_fw); + ClassDB::bind_method(D_METHOD("drop_data_fw"), &SpatialEditorViewport::drop_data_fw); ADD_SIGNAL(MethodInfo("toggle_maximize_view", PropertyInfo(Variant::OBJECT, "viewport"))); } @@ -2481,6 +2493,292 @@ void SpatialEditorViewport::focus_selection() { cursor.pos = center; } +void SpatialEditorViewport::assign_pending_data_pointers(Spatial *p_preview_node, Rect3 *p_preview_bounds, AcceptDialog *p_accept) { + preview_node = p_preview_node; + preview_bounds = p_preview_bounds; + accept = p_accept; +} + +Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const { + const float MAX_DISTANCE = 10; + + Vector3 world_ray = _get_ray(p_pos); + Vector3 world_pos = _get_ray_pos(p_pos); + + Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world()->get_scenario()); + Set<Ref<SpatialEditorGizmo> > found_gizmos; + + float closest_dist = MAX_DISTANCE; + + Vector3 point = world_pos + world_ray * MAX_DISTANCE; + Vector3 normal = Vector3(0.0, 0.0, 0.0); + + for (int i = 0; i < instances.size(); i++) { + + MeshInstance *mesh_instance = Object::cast_to<MeshInstance>(ObjectDB::get_instance(instances[i])); + + if (!mesh_instance) + continue; + + Ref<SpatialEditorGizmo> seg = mesh_instance->get_gizmo(); + + if ((!seg.is_valid()) || found_gizmos.has(seg)) { + continue; + } + + found_gizmos.insert(seg); + + Vector3 hit_point; + Vector3 hit_normal; + bool inters = seg->intersect_ray(camera, p_pos, hit_point, hit_normal, NULL, false); + + if (!inters) + continue; + + float dist = world_pos.distance_to(hit_point); + + if (dist < 0) + continue; + + if (dist < closest_dist) { + closest_dist = dist; + point = hit_point; + normal = hit_normal; + } + } + Vector3 center = preview_bounds->get_size() * 0.5; + return point + (center * normal); +} + +Rect3 SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, const Rect3 p_bounds) { + Rect3 bounds = p_bounds; + for (int i = 0; i < p_parent->get_child_count(); i++) { + Spatial *child = Object::cast_to<Spatial>(p_parent->get_child(i)); + if (child) { + MeshInstance *mesh_instance = Object::cast_to<MeshInstance>(child); + if (mesh_instance) { + Rect3 mesh_instance_bounds = mesh_instance->get_aabb(); + mesh_instance_bounds.position += mesh_instance->get_global_transform().origin - p_parent->get_global_transform().origin; + bounds.merge_with(mesh_instance_bounds); + } + bounds = _calculate_spatial_bounds(child, bounds); + } + } + return bounds; +} + +void SpatialEditorViewport::_create_preview(const Vector<String> &files) const { + for (int i = 0; i < files.size(); i++) { + String path = files[i]; + RES res = ResourceLoader::load(path); + Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); + if (scene != NULL) { + if (scene.is_valid()) { + Node *instance = scene->instance(); + if (instance) { + preview_node->add_child(instance); + } + } + editor->get_scene_root()->add_child(preview_node); + } + } + *preview_bounds = _calculate_spatial_bounds(preview_node, Rect3()); +} + +void SpatialEditorViewport::_remove_preview() { + if (preview_node->get_parent()) { + for (int i = preview_node->get_child_count() - 1; i >= 0; i--) { + Node *node = preview_node->get_child(i); + node->queue_delete(); + preview_node->remove_child(node); + } + editor->get_scene_root()->remove_child(preview_node); + } +} + +bool SpatialEditorViewport::_cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node) { + if (p_desired_node->get_filename() == p_target_scene_path) { + return true; + } + + int childCount = p_desired_node->get_child_count(); + for (int i = 0; i < childCount; i++) { + Node *child = p_desired_node->get_child(i); + if (_cyclical_dependency_exists(p_target_scene_path, child)) { + return true; + } + } + return false; +} + +bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) { + Ref<PackedScene> sdata = ResourceLoader::load(path); + if (!sdata.is_valid()) { // invalid scene + return false; + } + + Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); + if (!instanced_scene) { // error on instancing + return false; + } + + if (editor->get_edited_scene()->get_filename() != "") { // cyclical instancing + if (_cyclical_dependency_exists(editor->get_edited_scene()->get_filename(), instanced_scene)) { + memdelete(instanced_scene); + return false; + } + } + + instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path)); + + editor_data->get_undo_redo().add_do_method(parent, "add_child", instanced_scene); + editor_data->get_undo_redo().add_do_method(instanced_scene, "set_owner", editor->get_edited_scene()); + editor_data->get_undo_redo().add_do_reference(instanced_scene); + editor_data->get_undo_redo().add_undo_method(parent, "remove_child", instanced_scene); + + String new_name = parent->validate_child_name(instanced_scene); + ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); + editor_data->get_undo_redo().add_do_method(sed, "live_debug_instance_node", editor->get_edited_scene()->get_path_to(parent), path, new_name); + editor_data->get_undo_redo().add_undo_method(sed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name)); + + Transform global_transform; + Spatial *parent_spatial = Object::cast_to<Spatial>(parent); + if (parent_spatial) + global_transform = parent_spatial->get_global_transform(); + + global_transform.origin = _get_instance_position(p_point); + + editor_data->get_undo_redo().add_do_method(instanced_scene, "set_global_transform", global_transform); + + return true; +} + +void SpatialEditorViewport::_perform_drop_data() { + _remove_preview(); + + Vector<String> error_files; + + editor_data->get_undo_redo().create_action(TTR("Create Node")); + + for (int i = 0; i < selected_files.size(); i++) { + String path = selected_files[i]; + RES res = ResourceLoader::load(path); + if (res.is_null()) { + continue; + } + Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); + if (scene != NULL) { + bool success = _create_instance(target_node, path, drop_pos); + if (!success) { + error_files.push_back(path); + } + } + } + + editor_data->get_undo_redo().commit_action(); + + if (error_files.size() > 0) { + String files_str; + for (int i = 0; i < error_files.size(); i++) { + files_str += error_files[i].get_file().get_basename() + ","; + } + files_str = files_str.substr(0, files_str.length() - 1); + accept->get_ok()->set_text(TTR("Ugh")); + accept->set_text(vformat(TTR("Error instancing scene from %s"), files_str.c_str())); + accept->popup_centered_minsize(); + } +} + +bool SpatialEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { + + bool can_instance = false; + + if (!preview_node->is_inside_tree()) { + Dictionary d = p_data; + if (d.has("type") && (String(d["type"]) == "files")) { + Vector<String> files = d["files"]; + + List<String> scene_extensions; + ResourceLoader::get_recognized_extensions_for_type("PackedScene", &scene_extensions); + + for (int i = 0; i < files.size(); i++) { + if (scene_extensions.find(files[i].get_extension())) { + RES res = ResourceLoader::load(files[i]); + if (res.is_null()) { + continue; + } + + String type = res->get_class(); + if (type == "PackedScene") { + Ref<PackedScene> sdata = ResourceLoader::load(files[i]); + Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); + if (!instanced_scene) { + continue; + } + memdelete(instanced_scene); + } + can_instance = true; + break; + } + } + if (can_instance) { + _create_preview(files); + } + } + } else { + can_instance = true; + } + + if (can_instance) { + Transform global_transform = Transform(Basis(), _get_instance_position(p_point)); + preview_node->set_global_transform(global_transform); + } + + return can_instance; +} + +void SpatialEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { + if (!can_drop_data_fw(p_point, p_data, p_from)) + return; + + bool is_shift = Input::get_singleton()->is_key_pressed(KEY_SHIFT); + + selected_files.clear(); + Dictionary d = p_data; + if (d.has("type") && String(d["type"]) == "files") { + selected_files = d["files"]; + } + + List<Node *> list = editor->get_editor_selection()->get_selected_node_list(); + if (list.size() == 0) { + Node *root_node = editor->get_edited_scene(); + if (root_node) { + list.push_back(root_node); + } else { + accept->get_ok()->set_text(TTR("OK :(")); + accept->set_text(TTR("No parent to instance a child at.")); + accept->popup_centered_minsize(); + _remove_preview(); + return; + } + } + if (list.size() != 1) { + accept->get_ok()->set_text(TTR("I see..")); + accept->set_text(TTR("This operation requires a single selected node.")); + accept->popup_centered_minsize(); + _remove_preview(); + return; + } + + target_node = list[0]; + if (is_shift && target_node != editor->get_edited_scene()) { + target_node = target_node->get_parent(); + } + drop_pos = p_point; + + _perform_drop_data(); +} + SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, EditorNode *p_editor, int p_index) { _edit.mode = TRANSFORM_NONE; @@ -2491,6 +2789,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed index = p_index; editor = p_editor; + editor_data = editor->get_scene_tree_dock()->get_editor_data(); editor_selection = editor->get_editor_selection(); undo_redo = editor->get_undo_redo(); clicked = 0; @@ -2509,6 +2808,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed c->add_child(viewport); surface = memnew(Control); + surface->set_drag_forwarding(this); add_child(surface); surface->set_area_as_parent_rect(); surface->set_clip_contents(true); @@ -2573,9 +2873,10 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed preview_camera->hide(); preview_camera->connect("toggled", this, "_toggle_camera_preview"); previewing = NULL; - preview = NULL; gizmo_scale = 1.0; + preview_node = NULL; + info = memnew(PanelContainer); info->set_self_modulate(Color(1, 1, 1, 0.4)); surface->add_child(info); @@ -2583,6 +2884,8 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed info->add_child(info_label); info->hide(); + accept = NULL; + freelook_active = false; selection_menu = memnew(PopupMenu); @@ -2958,7 +3261,7 @@ void SpatialEditor::update_transform_gizmo() { gizmo.transform.origin = pcenter; gizmo.transform.basis = gizmo_basis; - for (int i = 0; i < VIEWPORTS_COUNT; i++) { + for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { viewports[i]->update_transform_gizmo_view(); } } @@ -3108,7 +3411,7 @@ void SpatialEditor::set_state(const Dictionary &p_state) { Array vp = d["viewports"]; ERR_FAIL_COND(vp.size() > 4); - for (int i = 0; i < VIEWPORTS_COUNT; i++) { + for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { viewports[i]->set_state(vp[i]); } } @@ -3119,13 +3422,6 @@ void SpatialEditor::set_state(const Dictionary &p_state) { settings_znear->set_value(float(d["znear"])); if (d.has("fov")) settings_fov->set_value(float(d["fov"])); - - if (d.has("default_srgb")) { - bool use = d["default_srgb"]; - - //viewport_environment->set_enable_fx(Environment::FX_SRGB,use); - //view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB), use ); - } if (d.has("show_grid")) { bool use = d["show_grid"]; @@ -3852,15 +4148,15 @@ void SpatialEditor::_toggle_maximize_view(Object *p_viewport) { if (!maximized) { - for (int i = 0; i < VIEWPORTS_COUNT; i++) { - if (i == index) + for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { + if (i == (uint32_t)index) viewports[i]->set_area_as_parent_rect(); else viewports[i]->hide(); } } else { - for (int i = 0; i < VIEWPORTS_COUNT; i++) + for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) viewports[i]->show(); if (view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT))) @@ -3904,7 +4200,7 @@ void SpatialEditor::clear() { settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.1)); settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far", 1500.0)); - for (int i = 0; i < VIEWPORTS_COUNT; i++) { + for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { viewports[i]->reset(); } @@ -3917,7 +4213,7 @@ void SpatialEditor::clear() { } } - for (int i = 0; i < VIEWPORTS_COUNT; i++) { + for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { viewports[i]->view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(SpatialEditorViewport::VIEW_AUDIO_LISTENER), i == 0); viewports[i]->viewport->set_as_audio_listener(i == 0); @@ -4000,6 +4296,10 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { vs = memnew(VSeparator); hbc_menu->add_child(vs); + // Drag and drop support; + preview_node = memnew(Spatial); + preview_bounds = Rect3(); + ED_SHORTCUT("spatial_editor/bottom_view", TTR("Bottom View"), KEY_MASK_ALT + KEY_KP_7); ED_SHORTCUT("spatial_editor/top_view", TTR("Top View"), KEY_KP_7); ED_SHORTCUT("spatial_editor/rear_view", TTR("Rear View"), KEY_MASK_ALT + KEY_KP_1); @@ -4044,6 +4344,9 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p = view_menu->get_popup(); + accept = memnew(AcceptDialog); + editor->get_gui_base()->add_child(accept); + p->add_check_shortcut(ED_SHORTCUT("spatial_editor/1_viewport", TTR("1 Viewport"), KEY_MASK_CMD + KEY_1), MENU_VIEW_USE_1_VIEWPORT); p->add_check_shortcut(ED_SHORTCUT("spatial_editor/2_viewports", TTR("2 Viewports"), KEY_MASK_CMD + KEY_2), MENU_VIEW_USE_2_VIEWPORTS); p->add_check_shortcut(ED_SHORTCUT("spatial_editor/2_viewports_alt", TTR("2 Viewports (Alt)"), KEY_MASK_ALT + KEY_MASK_CMD + KEY_2), MENU_VIEW_USE_2_VIEWPORTS_ALT); @@ -4074,10 +4377,11 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { viewport_base = memnew(SpatialEditorViewportContainer); shader_split->add_child(viewport_base); viewport_base->set_v_size_flags(SIZE_EXPAND_FILL); - for (int i = 0; i < VIEWPORTS_COUNT; i++) { + for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) { viewports[i] = memnew(SpatialEditorViewport(this, editor, i)); viewports[i]->connect("toggle_maximize_view", this, "_toggle_maximize_view"); + viewports[i]->assign_pending_data_pointers(preview_node, &preview_bounds, accept); viewport_base->add_child(viewports[i]); } //vbc->add_child(viewport_base); @@ -4212,6 +4516,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { } SpatialEditor::~SpatialEditor() { + memdelete(preview_node); } void SpatialEditorPlugin::make_visible(bool p_visible) { diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 374861b5e7..db5abe2b53 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -106,7 +106,16 @@ private: void _menu_option(int p_option); Size2 prev_size; + Spatial *preview_node; + Rect3 *preview_bounds; + Vector<String> selected_files; + AcceptDialog *accept; + + Node *target_node; + Point2 drop_pos; + EditorNode *editor; + EditorData *editor_data; EditorSelection *editor_selection; UndoRedo *undo_redo; @@ -143,7 +152,7 @@ private: ObjectID _select_ray(const Point2 &p_pos, bool p_append, bool &r_includes_current, int *r_gizmo_handle = NULL, bool p_alt_select = false); void _find_items_at_pos(const Point2 &p_pos, bool &r_includes_current, Vector<_RayResult> &results, bool p_alt_select = false); Vector3 _get_ray_pos(const Vector2 &p_pos) const; - Vector3 _get_ray(const Vector2 &p_pos); + Vector3 _get_ray(const Vector2 &p_pos) const; Point2 _point_to_screen(const Vector3 &p_point); Transform _get_camera_transform() const; int get_selected_count() const; @@ -250,6 +259,7 @@ private: void _draw(); void _smouseenter(); + void _smouseexit(); void _sinput(const Ref<InputEvent> &p_event); void _update_freelook(real_t delta); SpatialEditor *spatial_editor; @@ -266,6 +276,17 @@ private: void _list_select(Ref<InputEventMouseButton> b); Point2i _get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const; + Vector3 _get_instance_position(const Point2 &p_pos) const; + static Rect3 _calculate_spatial_bounds(const Spatial *p_parent, const Rect3 p_bounds); + void _create_preview(const Vector<String> &files) const; + void _remove_preview(); + bool _cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node); + bool _create_instance(Node *parent, String &path, const Point2 &p_point); + void _perform_drop_data(); + + bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; + void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); + protected: void _notification(int p_what); static void _bind_methods(); @@ -281,6 +302,11 @@ public: void focus_selection(); + void assign_pending_data_pointers( + Spatial *p_preview_node, + Rect3 *p_preview_bounds, + AcceptDialog *p_accept); + Viewport *get_viewport_node() { return viewport; } SpatialEditorViewport(SpatialEditor *p_spatial_editor, EditorNode *p_editor, int p_index); @@ -396,6 +422,10 @@ private: Ref<SpatialMaterial> indicator_mat; Ref<SpatialMaterial> cursor_material; + // Scene drag and drop support + Spatial *preview_node; + Rect3 preview_bounds; + /* struct Selected { AABB aabb; @@ -442,6 +472,8 @@ private: MenuButton *transform_menu; MenuButton *view_menu; + AcceptDialog *accept; + ConfirmationDialog *snap_dialog; ConfirmationDialog *xform_dialog; ConfirmationDialog *settings_dialog; @@ -559,6 +591,7 @@ public: Camera *get_camera() { return NULL; } void edit(Spatial *p_spatial); void clear(); + SpatialEditor(EditorNode *p_editor); ~SpatialEditor(); }; diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index c2c26bfe6c..7b40f69082 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -244,8 +244,22 @@ void SpriteFramesEditor::_down_pressed() { void SpriteFramesEditor::_delete_pressed() { + ERR_FAIL_COND(!frames->has_animation(edited_anim)); + if (tree->get_current() < 0) return; + + int to_delete = tree->get_current(); + if (to_delete < 0 || to_delete >= frames->get_frame_count(edited_anim)) { + return; + } + + undo_redo->create_action(TTR("Delete Resource")); + undo_redo->add_do_method(frames, "remove_frame", edited_anim, to_delete); + undo_redo->add_undo_method(frames, "add_frame", edited_anim, frames->get_frame(edited_anim, to_delete), to_delete); + undo_redo->add_do_method(this, "_update_library"); + undo_redo->add_undo_method(this, "_update_library"); + undo_redo->commit_action(); } void SpriteFramesEditor::_animation_select() { diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 82b507bd49..38d1350b07 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -67,7 +67,7 @@ void TextureRegionEditor::_region_draw() { if (snap_mode == SNAP_GRID) { Size2 s = edit_draw->get_size(); - int last_cell; + int last_cell = 0; if (snap_step.x != 0) { if (snap_separation.x == 0) @@ -406,7 +406,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { } else if (drag) { if (edited_margin >= 0) { - float new_margin; + float new_margin = 0; if (edited_margin == 0) new_margin = prev_margin + (mm->get_position().y - drag_from.y) / draw_zoom; else if (edited_margin == 1) @@ -415,6 +415,9 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { new_margin = prev_margin + (mm->get_position().x - drag_from.x) / draw_zoom; else if (edited_margin == 3) new_margin = prev_margin - (mm->get_position().x - drag_from.x) / draw_zoom; + else + ERR_PRINT("Unexpected edited_margin"); + if (new_margin < 0) new_margin = 0; static Margin m[4] = { MARGIN_TOP, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT }; diff --git a/editor/plugins/theme_editor_plugin.h b/editor/plugins/theme_editor_plugin.h index cb6f086de6..16b2da94d1 100644 --- a/editor/plugins/theme_editor_plugin.h +++ b/editor/plugins/theme_editor_plugin.h @@ -30,7 +30,6 @@ #ifndef THEME_EDITOR_PLUGIN_H #define THEME_EDITOR_PLUGIN_H -#include "scene/gui/button_group.h" #include "scene/gui/check_box.h" #include "scene/gui/file_dialog.h" #include "scene/gui/option_button.h" diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index f943ee5f6d..43856116a6 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -550,7 +550,6 @@ void TileMapEditor::_draw_fill_preview(int p_cell, const Point2i &p_point, bool PoolVector<Vector2> points = _bucket_fill(p_point, false, true); PoolVector<Vector2>::Read pr = points.read(); int len = points.size(); - int time_after = OS::get_singleton()->get_ticks_msec(); for (int i = 0; i < len; ++i) { _draw_cell(p_cell, pr[i], p_flip_h, p_flip_v, p_transpose, p_xform); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index e5bd6940cb..7e81513a8b 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -733,6 +733,8 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) { ERR_FAIL_COND(platform.is_null()); Error err = platform->export_project(current, export_debug->is_pressed(), p_path, 0); + if (err != OK) + ERR_PRINT("Failed to export project"); } void ProjectExportDialog::_bind_methods() { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 323a36154e..b36d4715c4 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -449,13 +449,15 @@ struct ProjectItem { String conf; uint64_t last_modified; bool favorite; + bool grayed; ProjectItem() {} - ProjectItem(const String &p_project, const String &p_path, const String &p_conf, uint64_t p_last_modified, bool p_favorite = false) { + ProjectItem(const String &p_project, const String &p_path, const String &p_conf, uint64_t p_last_modified, bool p_favorite = false, bool p_grayed = false) { project = p_project; path = p_path; conf = p_conf; last_modified = p_last_modified; favorite = p_favorite; + grayed = p_grayed; } _FORCE_INLINE_ bool operator<(const ProjectItem &l) const { return last_modified > l.last_modified; } _FORCE_INLINE_ bool operator==(const ProjectItem &l) const { return project == l.project; } @@ -465,7 +467,7 @@ void ProjectManager::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - Engine::get_singleton()->set_editor_hint(true); + Engine::get_singleton()->set_editor_hint(false); } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { @@ -737,6 +739,7 @@ void ProjectManager::_load_recent_projects() { String project = _name.get_slice("/", 1); String conf = path.plus_file("project.godot"); bool favorite = (_name.begins_with("favorite_projects/")) ? true : false; + bool grayed = false; uint64_t last_modified = 0; if (FileAccess::exists(conf)) { @@ -748,16 +751,15 @@ void ProjectManager::_load_recent_projects() { if (cache_modified > last_modified) last_modified = cache_modified; } - - ProjectItem item(project, path, conf, last_modified, favorite); - if (favorite) - favorite_projects.push_back(item); - else - projects.push_back(item); } else { - //project doesn't exist on disk but it's in the XML settings file - EditorSettings::get_singleton()->erase(_name); //remove it + grayed = true; } + + ProjectItem item(project, path, conf, last_modified, favorite, grayed); + if (favorite) + favorite_projects.push_back(item); + else + projects.push_back(item); } projects.sort(); @@ -782,14 +784,14 @@ void ProjectManager::_load_recent_projects() { String path = item.path; String conf = item.conf; bool is_favorite = item.favorite; + bool is_grayed = item.grayed; Ref<ConfigFile> cf = memnew(ConfigFile); - Error err = cf->load(conf); - ERR_CONTINUE(err != OK); + Error cf_err = cf->load(conf); String project_name = TTR("Unnamed Project"); - if (cf->has_section_key("application", "config/name")) { + if (cf_err == OK && cf->has_section_key("application", "config/name")) { project_name = static_cast<String>(cf->get_value("application", "config/name")).xml_unescape(); } @@ -797,7 +799,7 @@ void ProjectManager::_load_recent_projects() { continue; Ref<Texture> icon; - if (cf->has_section_key("application", "config/icon")) { + if (cf_err == OK && cf->has_section_key("application", "config/icon")) { String appicon = cf->get_value("application", "config/icon"); if (appicon != "") { Ref<Image> img; @@ -819,8 +821,10 @@ void ProjectManager::_load_recent_projects() { } String main_scene; - if (cf->has_section_key("application", "run/main_scene")) { + if (cf_err == OK && cf->has_section_key("application", "run/main_scene")) { main_scene = cf->get_value("application", "run/main_scene"); + } else { + main_scene = ""; } selected_list_copy.erase(project); @@ -848,6 +852,8 @@ void ProjectManager::_load_recent_projects() { hb->add_child(tf); VBoxContainer *vb = memnew(VBoxContainer); + if (is_grayed) + vb->set_modulate(Color(0.5, 0.5, 0.5)); vb->set_name("project"); vb->set_h_size_flags(SIZE_EXPAND_FILL); hb->add_child(vb); @@ -926,6 +932,13 @@ void ProjectManager::_open_project_confirm() { for (Map<String, String>::Element *E = selected_list.front(); E; E = E->next()) { const String &selected = E->key(); String path = EditorSettings::get_singleton()->get("projects/" + selected); + String conf = path + "/project.godot"; + if (!FileAccess::exists(conf)) { + dialog_error->set_text(TTR("Can't open project")); + dialog_error->popup_centered_minsize(); + return; + } + print_line("OPENING: " + path + " (" + selected + ")"); List<String> args; @@ -1397,6 +1410,9 @@ ProjectManager::ProjectManager() { run_error_diag = memnew(AcceptDialog); gui_base->add_child(run_error_diag); run_error_diag->set_title(TTR("Can't run project")); + + dialog_error = memnew(AcceptDialog); + gui_base->add_child(dialog_error); } ProjectManager::~ProjectManager() { diff --git a/editor/project_manager.h b/editor/project_manager.h index ecc01955ba..9fcf10a0d9 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -58,6 +58,7 @@ class ProjectManager : public Control { ConfirmationDialog *multi_run_ask; ConfirmationDialog *multi_scan_ask; AcceptDialog *run_error_diag; + AcceptDialog *dialog_error; NewProjectDialog *npdialog; ScrollContainer *scroll; VBoxContainer *scroll_childs; diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 9817ab176e..1f65589643 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -182,8 +182,8 @@ void ProjectSettingsEditor::_device_input_add() { Ref<InputEvent> ie; String name = add_at; int idx = edit_idx; - Variant old_val = ProjectSettings::get_singleton()->get(name); - Array arr = old_val; + Array old_val = ProjectSettings::get_singleton()->get(name); + Array arr = old_val.duplicate(); switch (add_type) { @@ -285,8 +285,8 @@ void ProjectSettingsEditor::_press_a_key_confirm() { String name = add_at; int idx = edit_idx; - Variant old_val = ProjectSettings::get_singleton()->get(name); - Array arr = old_val; + Array old_val = ProjectSettings::get_singleton()->get(name); + Array arr = old_val.duplicate(); for (int i = 0; i < arr.size(); i++) { @@ -700,6 +700,8 @@ void ProjectSettingsEditor::_update_actions() { action->set_meta("__input", ie); } } + + _action_check(action_name->get_text()); } void ProjectSettingsEditor::popup_project_settings() { @@ -809,28 +811,41 @@ void ProjectSettingsEditor::_item_del() { undo_redo->commit_action(); } -void ProjectSettingsEditor::_action_adds(String) { +void ProjectSettingsEditor::_action_check(String p_action) { - _action_add(); -} + if (p_action == "") { -void ProjectSettingsEditor::_action_add() { + action_add->set_disabled(true); + } else { - String action = action_name->get_text(); - if (action.find("/") != -1 || action.find(":") != -1 || action == "") { - message->set_text(TTR("Invalid action (anything goes but '/' or ':').")); - message->popup_centered(Size2(300, 100) * EDSCALE); - return; + if (p_action.find("/") != -1 || p_action.find(":") != -1) { + action_add->set_text(TTR("Can't contain '/' or ':'")); + action_add->set_disabled(true); + return; + } + if (ProjectSettings::get_singleton()->has("input/" + p_action)) { + action_add->set_text(TTR("Already existing")); + action_add->set_disabled(true); + return; + } + + action_add->set_disabled(false); } - if (ProjectSettings::get_singleton()->has("input/" + action)) { - message->set_text(vformat(TTR("Action '%s' already exists!"), action)); - message->popup_centered(Size2(300, 100) * EDSCALE); - return; + action_add->set_text(TTR("Add")); +} + +void ProjectSettingsEditor::_action_adds(String) { + + if (!action_add->is_disabled()) { + _action_add(); } +} + +void ProjectSettingsEditor::_action_add() { Array va; - String name = "input/" + action; + String name = "input/" + action_name->get_text(); undo_redo->create_action(TTR("Add Input Action Event")); undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", name, va); undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", name); @@ -854,6 +869,7 @@ void ProjectSettingsEditor::_action_add() { return; r->select(0); input_editor->ensure_cursor_is_visible(); + action_add->set_text(TTR("Add")); } void ProjectSettingsEditor::_item_checked(const String &p_item, bool p_check) { @@ -929,7 +945,7 @@ void ProjectSettingsEditor::_copy_to_platform(int p_which) { String path = globals_editor->get_property_editor()->get_selected_path(); if (path == String()) { - EditorNode::get_singleton()->show_warning(TTR("Select an setting item first!")); + EditorNode::get_singleton()->show_warning(TTR("Select a setting item first!")); return; } @@ -1321,6 +1337,11 @@ void ProjectSettingsEditor::set_plugins_page() { tab_container->set_current_tab(plugin_settings->get_index()); } +TabContainer *ProjectSettingsEditor::get_tabs() { + + return tab_container; +} + void ProjectSettingsEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_item_selected"), &ProjectSettingsEditor::_item_selected); @@ -1331,6 +1352,7 @@ void ProjectSettingsEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_save"), &ProjectSettingsEditor::_save); ClassDB::bind_method(D_METHOD("_action_add"), &ProjectSettingsEditor::_action_add); ClassDB::bind_method(D_METHOD("_action_adds"), &ProjectSettingsEditor::_action_adds); + ClassDB::bind_method(D_METHOD("_action_check"), &ProjectSettingsEditor::_action_check); ClassDB::bind_method(D_METHOD("_action_selected"), &ProjectSettingsEditor::_action_selected); ClassDB::bind_method(D_METHOD("_action_edited"), &ProjectSettingsEditor::_action_edited); ClassDB::bind_method(D_METHOD("_action_activated"), &ProjectSettingsEditor::_action_activated); @@ -1361,6 +1383,8 @@ void ProjectSettingsEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_toggle_search_bar"), &ProjectSettingsEditor::_toggle_search_bar); ClassDB::bind_method(D_METHOD("_copy_to_platform_about_to_show"), &ProjectSettingsEditor::_copy_to_platform_about_to_show); + + ClassDB::bind_method(D_METHOD("get_tabs"), &ProjectSettingsEditor::get_tabs); } ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { @@ -1475,9 +1499,8 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { get_ok()->set_text(TTR("Close")); set_hide_on_ok(true); - message = memnew(ConfirmationDialog); + message = memnew(AcceptDialog); add_child(message); - message->set_hide_on_ok(true); Control *input_base = memnew(Control); input_base->set_name(TTR("Input Map")); @@ -1493,7 +1516,6 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { l = memnew(Label); vbc->add_child(l); - l->set_position(Point2(6, 5) * EDSCALE); l->set_text(TTR("Action:")); hbc = memnew(HBoxContainer); @@ -1503,12 +1525,15 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) { action_name->set_h_size_flags(SIZE_EXPAND_FILL); hbc->add_child(action_name); action_name->connect("text_entered", this, "_action_adds"); + action_name->connect("text_changed", this, "_action_check"); add = memnew(Button); hbc->add_child(add); add->set_custom_minimum_size(Size2(150, 0) * EDSCALE); add->set_text(TTR("Add")); + add->set_disabled(true); add->connect("pressed", this, "_action_add"); + action_add = add; input_editor = memnew(Tree); vbc->add_child(input_editor); diff --git a/editor/project_settings_editor.h b/editor/project_settings_editor.h index ceec089953..7f9b18a968 100644 --- a/editor/project_settings_editor.h +++ b/editor/project_settings_editor.h @@ -66,7 +66,7 @@ class ProjectSettingsEditor : public AcceptDialog { ToolButton *clear_button; HBoxContainer *add_prop_bar; - ConfirmationDialog *message; + AcceptDialog *message; LineEdit *category; LineEdit *property; OptionButton *type; @@ -80,6 +80,7 @@ class ProjectSettingsEditor : public AcceptDialog { MenuButton *popup_copy_to_feature; LineEdit *action_name; + Button *action_add; Tree *input_editor; bool setting; bool updating_translations; @@ -108,6 +109,7 @@ class ProjectSettingsEditor : public AcceptDialog { void _add_item(int p_item, Ref<InputEvent> p_exiting_event = NULL); void _edit_item(Ref<InputEvent> p_exiting_event); + void _action_check(String p_action); void _action_adds(String); void _action_add(); void _device_input_add(); @@ -159,6 +161,8 @@ public: void popup_project_settings(); void set_plugins_page(); + TabContainer *get_tabs(); + void queue_save(); ProjectSettingsEditor(EditorData *p_data); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index a42fb41ee2..c7a4e1fc3b 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -2275,19 +2275,6 @@ void PropertyEditor::_check_reload_status(const String &p_name, TreeItem *item) } } - if (_might_be_in_instance()) { - - Variant vorig; - Dictionary d = item->get_metadata(0); - int usage = d.has("usage") ? int(int(d["usage"]) & (PROPERTY_USAGE_STORE_IF_NONONE | PROPERTY_USAGE_STORE_IF_NONZERO)) : 0; - - if (_get_instanced_node_original_property(p_name, vorig) || usage) { - Variant v = obj->get(p_name); - - bool has_reload = _is_property_different(v, vorig, usage); - } - } - if (obj->call("property_can_revert", p_name).operator bool()) { has_reload = true; diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index 6bbb35ceab..86de7c56e1 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -75,6 +75,8 @@ void PropertySelector::_update_search() { if (properties) set_title(TTR("Select Property")); + else if (virtuals_only) + set_title(TTR("Select Virtual Method")); else set_title(TTR("Select Method")); @@ -209,7 +211,7 @@ void PropertySelector::_update_search() { StringName base = base_type; while (base) { methods.push_back(MethodInfo("*" + String(base))); - ClassDB::get_method_list(base, &methods, true); + ClassDB::get_method_list(base, &methods, true, true); base = ClassDB::get_parent_class(base); } } @@ -230,11 +232,13 @@ void PropertySelector::_update_search() { Ref<Texture> icon; script_methods = false; + print_line("name: " + E->get().name); + String rep = E->get().name.replace("*", ""); if (E->get().name == "*Script Methods") { icon = get_icon("Script", "EditorIcons"); script_methods = true; - } else if (has_icon(E->get().name, "EditorIcons")) { - icon = get_icon(E->get().name, "EditorIcons"); + } else if (has_icon(rep, "EditorIcons")) { + icon = get_icon(rep, "EditorIcons"); } else { icon = get_icon("Object", "EditorIcons"); } @@ -247,6 +251,12 @@ void PropertySelector::_update_search() { if (!script_methods && name.begins_with("_") && !(E->get().flags & METHOD_FLAG_VIRTUAL)) continue; + if (virtuals_only && !(E->get().flags & METHOD_FLAG_VIRTUAL)) + continue; + + if (!virtuals_only && (E->get().flags & METHOD_FLAG_VIRTUAL)) + continue; + if (search_box->get_text() != String() && name.find(search_box->get_text()) == -1) continue; @@ -283,6 +293,12 @@ void PropertySelector::_update_search() { desc += " )"; + if (E->get().flags & METHOD_FLAG_CONST) + desc += " const"; + + if (E->get().flags & METHOD_FLAG_VIRTUAL) + desc += " virtual"; + item->set_text(0, desc); item->set_metadata(0, name); item->set_selectable(0, true); @@ -397,7 +413,7 @@ void PropertySelector::_notification(int p_what) { } } -void PropertySelector::select_method_from_base_type(const String &p_base, const String &p_current) { +void PropertySelector::select_method_from_base_type(const String &p_base, const String &p_current, bool p_virtuals_only) { base_type = p_base; selected = p_current; @@ -405,6 +421,7 @@ void PropertySelector::select_method_from_base_type(const String &p_base, const script = 0; properties = false; instance = NULL; + virtuals_only = p_virtuals_only; popup_centered_ratio(0.6); search_box->set_text(""); @@ -421,6 +438,7 @@ void PropertySelector::select_method_from_script(const Ref<Script> &p_script, co script = p_script->get_instance_id(); properties = false; instance = NULL; + virtuals_only = false; popup_centered_ratio(0.6); search_box->set_text(""); @@ -436,6 +454,7 @@ void PropertySelector::select_method_from_basic_type(Variant::Type p_type, const script = 0; properties = false; instance = NULL; + virtuals_only = false; popup_centered_ratio(0.6); search_box->set_text(""); @@ -456,6 +475,7 @@ void PropertySelector::select_method_from_instance(Object *p_instance, const Str } properties = false; instance = NULL; + virtuals_only = false; popup_centered_ratio(0.6); search_box->set_text(""); @@ -471,6 +491,7 @@ void PropertySelector::select_property_from_base_type(const String &p_base, cons script = 0; properties = true; instance = NULL; + virtuals_only = false; popup_centered_ratio(0.6); search_box->set_text(""); @@ -488,6 +509,7 @@ void PropertySelector::select_property_from_script(const Ref<Script> &p_script, script = p_script->get_instance_id(); properties = true; instance = NULL; + virtuals_only = false; popup_centered_ratio(0.6); search_box->set_text(""); @@ -503,6 +525,7 @@ void PropertySelector::select_property_from_basic_type(Variant::Type p_type, con script = 0; properties = true; instance = NULL; + virtuals_only = false; popup_centered_ratio(0.6); search_box->set_text(""); @@ -518,6 +541,7 @@ void PropertySelector::select_property_from_instance(Object *p_instance, const S script = 0; properties = true; instance = p_instance; + virtuals_only = false; popup_centered_ratio(0.6); search_box->set_text(""); @@ -554,6 +578,7 @@ PropertySelector::PropertySelector() { search_options->connect("cell_selected", this, "_item_selected"); search_options->set_hide_root(true); search_options->set_hide_folding(true); + virtuals_only = false; help_bit = memnew(EditorHelpBit); vbc->add_margin_child(TTR("Description:"), help_bit); diff --git a/editor/property_selector.h b/editor/property_selector.h index 3fa60771d7..eb745d776f 100644 --- a/editor/property_selector.h +++ b/editor/property_selector.h @@ -55,6 +55,7 @@ class PropertySelector : public ConfirmationDialog { String base_type; ObjectID script; Object *instance; + bool virtuals_only; void _item_selected(); @@ -63,7 +64,7 @@ protected: static void _bind_methods(); public: - void select_method_from_base_type(const String &p_base, const String &p_current = ""); + void select_method_from_base_type(const String &p_base, const String &p_current = "", bool p_virtuals_only = false); void select_method_from_script(const Ref<Script> &p_script, const String &p_current = ""); void select_method_from_basic_type(Variant::Type p_type, const String &p_current = ""); void select_method_from_instance(Object *p_instance, const String &p_current = ""); diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index c71cc5af3f..b92ebed167 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -171,33 +171,50 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd, Vector<Pair<Str Pair<String, Ref<Texture> > pair; pair.first = file; pair.second = get_icon((has_icon(efsd->get_file_type(i), ei) ? efsd->get_file_type(i) : ot), ei); + list.push_back(pair); + } + } + + if (add_directories) { + for (int i = 0; i < efsd->get_subdir_count(); i++) { - if (search_text != String() && list.size() > 0) { + _parse_fs(efsd->get_subdir(i), list); + } + } +} - float this_sim = _path_cmp(search_text, file); - float other_sim = _path_cmp(list[0].first, file); - int pos = 1; +Vector<Pair<String, Ref<Texture> > > EditorQuickOpen::_sort_fs(Vector<Pair<String, Ref<Texture> > > &list) { - while (pos < list.size() && this_sim <= other_sim) { - other_sim = _path_cmp(list[pos++].first, file); - } + String search_text = search_box->get_text(); + Vector<Pair<String, Ref<Texture> > > sorted_list; - pos = this_sim >= other_sim ? pos - 1 : pos; - list.insert(pos, pair); + if (search_text == String() || list.size() == 0) + return sorted_list; - } else { + Vector<float> scores; + scores.resize(list.size()); + for (int i = 0; i < list.size(); i++) + scores[i] = _path_cmp(search_text, list[i].first); - list.push_back(pair); - } - } - } + while (list.size() > 0) { - if (add_directories) { - for (int i = 0; i < efsd->get_subdir_count(); i++) { + float best_score = 0.0f; + int best_idx = 0; - _parse_fs(efsd->get_subdir(i), list); + for (int i = 0; i < list.size(); i++) { + float current_score = scores[i]; + if (current_score > best_score) { + best_score = current_score; + best_idx = i; + } } + + sorted_list.push_back(list[best_idx]); + list.remove(best_idx); + scores.remove(best_idx); } + + return sorted_list; } void EditorQuickOpen::_update_search() { @@ -208,6 +225,7 @@ void EditorQuickOpen::_update_search() { Vector<Pair<String, Ref<Texture> > > list; _parse_fs(efsd, list); + list = _sort_fs(list); for (int i = 0; i < list.size(); i++) { TreeItem *ti = search_options->create_item(root); diff --git a/editor/quick_open.h b/editor/quick_open.h index 3f64dd8cf0..5b91965920 100644 --- a/editor/quick_open.h +++ b/editor/quick_open.h @@ -49,6 +49,7 @@ class EditorQuickOpen : public ConfirmationDialog { void _sbox_input(const Ref<InputEvent> &p_ie); void _parse_fs(EditorFileSystemDirectory *efsd, Vector<Pair<String, Ref<Texture> > > &list); + Vector<Pair<String, Ref<Texture> > > _sort_fs(Vector<Pair<String, Ref<Texture> > > &list); float _path_cmp(String search, String path) const; void _confirmed(); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index afdf48b314..5b783493cb 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -433,7 +433,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { dup->set_name(parent->validate_child_name(dup)); - editor_data->get_undo_redo().add_do_method(parent, "_add_child_below_node", node, dup); + editor_data->get_undo_redo().add_do_method(parent, "add_child_below_node", node, dup); for (List<Node *>::Element *F = owned.front(); F; F = F->next()) { if (!duplimap.has(F->get())) { @@ -582,13 +582,13 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { new_scene_from_dialog->popup_centered_ratio(); new_scene_from_dialog->set_title(TTR("Save New Scene As..")); - } break; case TOOL_COPY_NODE_PATH: { List<Node *> selection = editor_selection->get_selected_node_list(); - - if (List<Node *>::Element *e = selection.front()) { - if (Node *node = e->get()) { + List<Node *>::Element *e = selection.front(); + if (e) { + Node *node = e->get(); + if (node) { Node *root = EditorNode::get_singleton()->get_edited_scene(); NodePath path = root->get_path().rel_path_to(node->get_path()); OS::get_singleton()->set_clipboard(path); @@ -597,8 +597,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } break; case TOOL_SCENE_EDITABLE_CHILDREN: { List<Node *> selection = editor_selection->get_selected_node_list(); - if (List<Node *>::Element *e = selection.front()) { - if (Node *node = e->get()) { + List<Node *>::Element *e = selection.front(); + if (e) { + Node *node = e->get(); + if (node) { bool editable = EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(node); int editable_item_idx = menu->get_item_idx_from_text(TTR("Editable Children")); int placeholder_item_idx = menu->get_item_idx_from_text(TTR("Load As Placeholder")); @@ -617,8 +619,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } break; case TOOL_SCENE_USE_PLACEHOLDER: { List<Node *> selection = editor_selection->get_selected_node_list(); - if (List<Node *>::Element *e = selection.front()) { - if (Node *node = e->get()) { + List<Node *>::Element *e = selection.front(); + if (e) { + Node *node = e->get(); + if (node) { bool placeholder = node->get_scene_instance_load_placeholder(); placeholder = !placeholder; int editable_item_idx = menu->get_item_idx_from_text(TTR("Editable Children")); @@ -635,15 +639,16 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } break; case TOOL_SCENE_CLEAR_INSTANCING: { List<Node *> selection = editor_selection->get_selected_node_list(); - if (List<Node *>::Element *e = selection.front()) { - if (Node *node = e->get()) { + List<Node *>::Element *e = selection.front(); + if (e) { + Node *node = e->get(); + if (node) { Node *root = EditorNode::get_singleton()->get_edited_scene(); UndoRedo *undo_redo = &editor_data->get_undo_redo(); if (!root) break; ERR_FAIL_COND(node->get_filename() == String()); - undo_redo->create_action(TTR("Discard Instancing")); undo_redo->add_do_method(node, "set_filename", ""); undo_redo->add_undo_method(node, "set_filename", node->get_filename()); @@ -656,8 +661,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } break; case TOOL_SCENE_OPEN: { List<Node *> selection = editor_selection->get_selected_node_list(); - if (List<Node *>::Element *e = selection.front()) { - if (Node *node = e->get()) { + List<Node *>::Element *e = selection.front(); + if (e) { + Node *node = e->get(); + if (node) { scene_tree->emit_signal("open", node->get_filename()); } } @@ -667,8 +674,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } break; case TOOL_SCENE_CLEAR_INHERITANCE_CONFIRM: { List<Node *> selection = editor_selection->get_selected_node_list(); - if (List<Node *>::Element *e = selection.front()) { - if (Node *node = e->get()) { + List<Node *>::Element *e = selection.front(); + if (e) { + Node *node = e->get(); + if (node) { node->set_scene_inherited_state(Ref<SceneState>()); scene_tree->update_tree(); EditorNode::get_singleton()->get_property_editor()->update_tree(); @@ -677,8 +686,10 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } break; case TOOL_SCENE_OPEN_INHERITED: { List<Node *> selection = editor_selection->get_selected_node_list(); - if (List<Node *>::Element *e = selection.front()) { - if (Node *node = e->get()) { + List<Node *>::Element *e = selection.front(); + if (e) { + Node *node = e->get(); + if (node) { if (node && node->get_scene_inherited_state().is_valid()) { scene_tree->emit_signal("open", node->get_scene_inherited_state()->get_path()); } @@ -823,7 +834,14 @@ Node *SceneTreeDock::_duplicate(Node *p_node, Map<Node *, Node *> &duplimap) { if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) continue; String name = E->get().name; - node->set(name, p_node->get(name)); + Variant value = p_node->get(name); + // Duplicate dictionaries and arrays, mainly needed for __meta__ + if (value.get_type() == Variant::DICTIONARY) { + value = Dictionary(value).copy(); + } else if (value.get_type() == Variant::ARRAY) { + value = Array(value).duplicate(); + } + node->set(name, value); } List<Node::GroupInfo> group_info; diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index d0e2e0c240..089c054b59 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -352,9 +352,16 @@ void ScriptCreateDialog::_path_changed(const String &p_path) { /* Does file already exist */ DirAccess *f = DirAccess::create(DirAccess::ACCESS_RESOURCES); - if (f->file_exists(p) && !(f->current_is_dir())) { + if (f->dir_exists(p)) { + is_new_script_created = false; + is_path_valid = false; + _msg_path_valid(false, TTR("Directory of the same name exists")); + } else if (f->file_exists(p)) { is_new_script_created = false; is_path_valid = true; + _msg_path_valid(true, TTR("File exists, will be reused")); + } else { + path_error_label->set_text(""); } memdelete(f); _update_dialog(); diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp index 623e458aca..05e3feedb5 100644 --- a/editor/settings_config_dialog.cpp +++ b/editor/settings_config_dialog.cpp @@ -165,7 +165,7 @@ void EditorSettingsDialog::_update_shortcuts() { section->set_custom_bg_color(1, get_color("prop_subsection", "Editor")); } - if (shortcut_filter.is_subsequence_ofi(sc->get_name())) { + if (shortcut_filter.is_subsequence_ofi(sc->get_name()) || shortcut_filter.is_subsequence_ofi(sc->get_as_text())) { TreeItem *item = shortcuts->create_item(section); item->set_text(0, sc->get_name()); diff --git a/main/main.cpp b/main/main.cpp index 7b2a890a8e..1295cd73b5 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1333,6 +1333,9 @@ bool Main::start() { Viewport::Usage usage = Viewport::Usage(int(GLOBAL_GET("rendering/quality/intended_usage/framebuffer_allocation"))); sml->get_root()->set_usage(usage); + bool snap_controls = GLOBAL_DEF("gui/common/snap_controls_to_pixels", true); + sml->get_root()->set_snap_controls_to_pixels(snap_controls); + } else { GLOBAL_DEF("display/window/stretch/mode", "disabled"); ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/mode", PropertyInfo(Variant::STRING, "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,2d,viewport")); @@ -1342,6 +1345,7 @@ bool Main::start() { ProjectSettings::get_singleton()->set_custom_property_info("display/window/stretch/shrink", PropertyInfo(Variant::STRING, "display/window/stretch/shrink", PROPERTY_HINT_RANGE, "1,8,1")); sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true)); sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true)); + GLOBAL_DEF("gui/common/snap_controls_to_pixels", true); } String local_game_path; @@ -1383,6 +1387,8 @@ bool Main::start() { if (editor) { Error serr = editor_node->load_scene(local_game_path); + if (serr != OK) + ERR_PRINT("Failed to load scene"); OS::get_singleton()->set_context(OS::CONTEXT_EDITOR); } #endif diff --git a/methods.py b/methods.py index ec7e658a3b..2ab76a5416 100644 --- a/methods.py +++ b/methods.py @@ -1026,9 +1026,6 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs): fd.write("\t\t\t{" + x["set_mask"] + "," + x["clear_mask"] + "},\n") fd.write("\t\t};\n\n") - else: - fd.write("\t\tstatic const Enum *_enums=NULL;\n") - fd.write("\t\tstatic const EnumValue *_enum_values=NULL;\n") conditionals_found = [] if (len(header_data.conditionals)): diff --git a/misc/dist/html/default.html b/misc/dist/html/default.html new file mode 100644 index 0000000000..9fae34f97e --- /dev/null +++ b/misc/dist/html/default.html @@ -0,0 +1,386 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <title></title> + <style type="text/css"> + + body { + margin: 0; + border: 0 none; + padding: 0; + text-align: center; + background-color: #222226; + font-family: 'Noto Sans', Arial, sans-serif; + } + + + /* Godot Engine default theme style + * ================================ */ + + .godot { + color: #e0e0e0; + background-color: #3b3943; + background-image: linear-gradient(to bottom, #403e48, #35333c); + border: 1px solid #45434e; + box-shadow: 0 0 1px 1px #2f2d35; + } + + button.godot { + font-family: 'Droid Sans', Arial, sans-serif; /* override user agent style */ + padding: 1px 5px; + background-color: #37353f; + background-image: linear-gradient(to bottom, #413e49, #3a3842); + border: 1px solid #514f5d; + border-radius: 1px; + box-shadow: 0 0 1px 1px #2a2930; + } + + button.godot:hover { + color: #f0f0f0; + background-color: #44414e; + background-image: linear-gradient(to bottom, #494652, #423f4c); + border: 1px solid #5a5667; + box-shadow: 0 0 1px 1px #26252b; + } + + button.godot:active { + color: #fff; + background-color: #3e3b46; + background-image: linear-gradient(to bottom, #36343d, #413e49); + border: 1px solid #4f4c59; + box-shadow: 0 0 1px 1px #26252b; + } + + button.godot:disabled { + color: rgba(230, 230, 230, 0.2); + background-color: #3d3d3d; + background-image: linear-gradient(to bottom, #434343, #393939); + border: 1px solid #474747; + box-shadow: 0 0 1px 1px #2d2b33; + } + + + /* Canvas / wrapper + * ================ */ + + #container { + display: inline-block; /* scale with canvas */ + vertical-align: top; /* prevent extra height */ + position: relative; /* root for absolutely positioned overlay */ + margin: 0; + border: 0 none; + padding: 0; + background-color: #0c0c0c; + } + + #canvas { + display: block; + margin: 0 auto; + color: white; + } + + #canvas:focus { + outline: none; + } + + + /* Status display + * ============== */ + + #status { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + display: flex; + justify-content: center; + align-items: center; + /* don't consume click events - make children visible explicitly */ + visibility: hidden; + } + + #status-progress { + width: 244px; + height: 7px; + background-color: #38363A; + border: 1px solid #444246; + padding: 1px; + box-shadow: 0 0 2px 1px #1B1C22; + border-radius: 2px; + visibility: visible; + } + + #status-progress-inner { + height: 100%; + width: 0; + box-sizing: border-box; + transition: width 0.5s linear; + background-color: #202020; + border: 1px solid #222223; + box-shadow: 0 0 1px 1px #27282E; + border-radius: 3px; + } + + #status-indeterminate { + visibility: visible; + position: relative; + } + + #status-indeterminate > div { + width: 3px; + height: 0; + border-style: solid; + border-width: 6px 2px 0 2px; + border-color: #2b2b2b transparent transparent transparent; + transform-origin: center 14px; + position: absolute; + } + + #status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); } + #status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); } + #status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); } + #status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); } + #status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); } + #status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); } + #status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); } + #status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); } + + #status-notice { + margin: 0 100px; + line-height: 1.3; + visibility: visible; + padding: 4px 6px; + visibility: visible; + } + + + /* Debug output + * ============ */ + + #output-panel { + display: none; + max-width: 700px; + font-size: small; + margin: 6px auto 0; + padding: 0 4px 4px; + text-align: left; + line-height: 2.2; + } + + #output-header { + display: flex; + justify-content: space-between; + align-items: center; + } + + #output-container { + padding: 6px; + background-color: #2c2a32; + box-shadow: inset 0 0 1px 1px #232127; + color: #bbb; + } + + #output-scroll { + line-height: 1; + height: 12em; + overflow-y: scroll; + white-space: pre-wrap; + font-size: small; + font-family: "Lucida Console", Monaco, monospace; + } + </style> +$GODOT_HEAD_INCLUDE +</head> +<body> + <div id="container"> + <canvas id="canvas" oncontextmenu="event.preventDefault();" width="640" height="480"> + HTML5 canvas appears to be unsupported in the current browser.<br /> + Please try updating or use a different browser. + </canvas> + <div id="status"> + <div id='status-progress' style='display: none;' oncontextmenu="event.preventDefault();"><div id ='status-progress-inner'></div></div> + <div id='status-indeterminate' style='display: none;' oncontextmenu="event.preventDefault();"> + <div></div> + <div></div> + <div></div> + <div></div> + <div></div> + <div></div> + <div></div> + <div></div> + </div> + <div id="status-notice" class="godot" style='display: none;'></div> + </div> + </div> + <div id="output-panel" class="godot"> + <div id="output-header"> + Output: + <button id='output-clear' class='godot' type='button' autocomplete='off'>Clear</button> + </div> + <div id="output-container"><div id="output-scroll"></div></div> + </div> + + <script type="text/javascript" src="$GODOT_BASENAME.js"></script> + <script type="text/javascript">//<![CDATA[ + + var game = new Engine; + + (function() { + + const BASENAME = '$GODOT_BASENAME'; + const MEMORY_SIZE = $GODOT_TOTAL_MEMORY; + const DEBUG_ENABLED = $GODOT_DEBUG_ENABLED; + const INDETERMINATE_STATUS_STEP_MS = 100; + + var container = document.getElementById('container'); + var canvas = document.getElementById('canvas'); + var statusProgress = document.getElementById('status-progress'); + var statusProgressInner = document.getElementById('status-progress-inner'); + var statusIndeterminate = document.getElementById('status-indeterminate'); + var statusNotice = document.getElementById('status-notice'); + + var initializing = true; + var statusMode = 'hidden'; + var indeterminiateStatusAnimationId = 0; + + setStatusMode('indeterminate'); + game.setCanvas(canvas); + game.setAsmjsMemorySize(MEMORY_SIZE); + + function setStatusMode(mode) { + + if (statusMode === mode || !initializing) + return; + [statusProgress, statusIndeterminate, statusNotice].forEach(elem => { + elem.style.display = 'none'; + }); + if (indeterminiateStatusAnimationId !== 0) { + cancelAnimationFrame(indeterminiateStatusAnimationId); + indeterminiateStatusAnimationId = 0; + } + switch (mode) { + case 'progress': + statusProgress.style.display = 'block'; + break; + case 'indeterminate': + statusIndeterminate.style.display = 'block'; + indeterminiateStatusAnimationId = requestAnimationFrame(animateStatusIndeterminate); + break; + case 'notice': + statusNotice.style.display = 'block'; + break; + case 'hidden': + break; + default: + throw new Error("Invalid status mode"); + } + statusMode = mode; + } + + function animateStatusIndeterminate(ms) { + var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8); + if (statusIndeterminate.children[i].style.borderTopColor == '') { + Array.prototype.slice.call(statusIndeterminate.children).forEach(child => { + child.style.borderTopColor = ''; + }); + statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf'; + } + requestAnimationFrame(animateStatusIndeterminate); + } + + function setStatusNotice(text) { + + while (statusNotice.lastChild) { + statusNotice.removeChild(statusNotice.lastChild); + } + var lines = text.split('\n'); + lines.forEach((line, index) => { + statusNotice.appendChild(document.createTextNode(line)); + statusNotice.appendChild(document.createElement('br')); + }); + }; + + game.setProgressFunc((current, total) => { + + if (total > 0) { + statusProgressInner.style.width = current/total * 100 + '%'; + setStatusMode('progress'); + if (current === total) { + // wait for progress bar animation + setTimeout(() => { + setStatusMode('indeterminate'); + }, 500); + } + } else { + setStatusMode('indeterminate'); + } + }); + + if (DEBUG_ENABLED) { + var outputRoot = document.getElementById("output-panel"); + var outputScroll = document.getElementById("output-scroll"); + var OUTPUT_MSG_COUNT_MAX = 400; + + document.getElementById('output-clear').addEventListener('click', () => { + while (outputScroll.firstChild) { + outputScroll.firstChild.remove(); + } + }); + + outputRoot.style.display = 'block'; + + function print(text) { + if (arguments.length > 1) { + text = Array.prototype.slice.call(arguments).join(" "); + } + if (text.length <= 0) return; + while (outputScroll.childElementCount >= OUTPUT_MSG_COUNT_MAX) { + outputScroll.firstChild.remove(); + } + var msg = document.createElement("div"); + if (String.prototype.trim.call(text).startsWith("**ERROR**")) { + msg.style.color = "#d44"; + } else if (String.prototype.trim.call(text).startsWith("**WARNING**")) { + msg.style.color = "#ccc000"; + } else if (String.prototype.trim.call(text).startsWith("**SCRIPT ERROR**")) { + msg.style.color = "#c6d"; + } + msg.textContent = text; + var scrollToBottom = outputScroll.scrollHeight - (outputScroll.clientHeight + outputScroll.scrollTop) < 10; + outputScroll.appendChild(msg); + if (scrollToBottom) { + outputScroll.scrollTop = outputScroll.scrollHeight; + } + }; + + function printError(text) { + print('**ERROR**' + ":", text); + } + + game.setStdoutFunc(text => { + print(text); + console.log(text); + }); + + game.setStderrFunc(text => { + printError(text); + console.warn(text); + }); + } + + game.start(BASENAME + '.pck').then(() => { + setStatusMode('hidden'); + initializing = false; + }, err => { + if (DEBUG_ENABLED) + printError(err.message); + setStatusNotice(err.message); + setStatusMode('notice'); + initializing = false; + }); + })(); + //]]></script> +</body> +</html> diff --git a/misc/dist/html_fs/godotfs.js b/misc/dist/html_fs/godotfs.js deleted file mode 100644 index 676ee689fb..0000000000 --- a/misc/dist/html_fs/godotfs.js +++ /dev/null @@ -1,151 +0,0 @@ - -var Module; -if (typeof Module === 'undefined') Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()'); -if (!Module.expectedDataFileDownloads) { - Module.expectedDataFileDownloads = 0; - Module.finishedDataFileDownloads = 0; -} -Module.expectedDataFileDownloads++; -(function() { - - const PACK_FILE_NAME = '$GODOT_PACK_NAME'; - const PACK_FILE_SIZE = $GODOT_PACK_SIZE; - function fetchRemotePackage(packageName, callback, errback) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', packageName, true); - xhr.responseType = 'arraybuffer'; - xhr.onprogress = function(event) { - var url = packageName; - if (event.loaded && event.total) { - if (!xhr.addedTotal) { - xhr.addedTotal = true; - if (!Module.dataFileDownloads) Module.dataFileDownloads = {}; - Module.dataFileDownloads[url] = { - loaded: event.loaded, - total: event.total - }; - } else { - Module.dataFileDownloads[url].loaded = event.loaded; - } - var total = 0; - var loaded = 0; - var num = 0; - for (var download in Module.dataFileDownloads) { - var data = Module.dataFileDownloads[download]; - total += data.total; - loaded += data.loaded; - num++; - } - total = Math.ceil(total * Module.expectedDataFileDownloads/num); - if (Module['setStatus']) Module['setStatus']('Downloading data... (' + loaded + '/' + total + ')'); - } else if (!Module.dataFileDownloads) { - if (Module['setStatus']) Module['setStatus']('Downloading data...'); - } - }; - xhr.onload = function(event) { - var packageData = xhr.response; - callback(packageData); - }; - xhr.send(null); - }; - - function handleError(error) { - console.error('package error:', error); - }; - - var fetched = null, fetchedCallback = null; - fetchRemotePackage(PACK_FILE_NAME, function(data) { - if (fetchedCallback) { - fetchedCallback(data); - fetchedCallback = null; - } else { - fetched = data; - } - }, handleError); - - function runWithFS() { - -function assert(check, msg) { - if (!check) throw msg + new Error().stack; -} - - function DataRequest(start, end, crunched, audio) { - this.start = start; - this.end = end; - this.crunched = crunched; - this.audio = audio; - } - DataRequest.prototype = { - requests: {}, - open: function(mode, name) { - this.name = name; - this.requests[name] = this; - Module['addRunDependency']('fp ' + this.name); - }, - send: function() {}, - onload: function() { - var byteArray = this.byteArray.subarray(this.start, this.end); - - this.finish(byteArray); - - }, - finish: function(byteArray) { - var that = this; - Module['FS_createPreloadedFile'](this.name, null, byteArray, true, true, function() { - Module['removeRunDependency']('fp ' + that.name); - }, function() { - if (that.audio) { - Module['removeRunDependency']('fp ' + that.name); // workaround for chromium bug 124926 (still no audio with this, but at least we don't hang) - } else { - Module.printErr('Preloading file ' + that.name + ' failed'); - } - }, false, true); // canOwn this data in the filesystem, it is a slide into the heap that will never change - this.requests[this.name] = null; - }, - }; - new DataRequest(0, PACK_FILE_SIZE, 0, 0).open('GET', '/' + PACK_FILE_NAME); - - var PACKAGE_PATH; - if (typeof window === 'object') { - PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/'); - } else { - // worker - PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/'); - } - var PACKAGE_NAME = PACK_FILE_NAME; - var REMOTE_PACKAGE_NAME = PACK_FILE_NAME; - var PACKAGE_UUID = 'b39761ce-0348-4959-9b16-302ed8e1592e'; - - function processPackageData(arrayBuffer) { - Module.finishedDataFileDownloads++; - assert(arrayBuffer, 'Loading data file failed.'); - var byteArray = new Uint8Array(arrayBuffer); - var curr; - - // Reuse the bytearray from the XHR as the source for file reads. - DataRequest.prototype.byteArray = byteArray; - DataRequest.prototype.requests['/' + PACK_FILE_NAME].onload(); - Module['removeRunDependency']('datafile_datapack'); - - }; - Module['addRunDependency']('datafile_datapack'); - - if (!Module.preloadResults) Module.preloadResults = {}; - - Module.preloadResults[PACKAGE_NAME] = {fromCache: false}; - if (fetched) { - processPackageData(fetched); - fetched = null; - } else { - fetchedCallback = processPackageData; - } - - } - if (Module['calledRun']) { - runWithFS(); - } else { - if (!Module['preRun']) Module['preRun'] = []; - Module["preRun"].push(runWithFS); // FS is not initialized yet, wait for it - } - -})(); diff --git a/misc/hooks/pre-commit-clang-format b/misc/hooks/pre-commit-clang-format index 0971ebe23a..d2d65a7428 100755 --- a/misc/hooks/pre-commit-clang-format +++ b/misc/hooks/pre-commit-clang-format @@ -1,6 +1,6 @@ #!/bin/bash -# git pre-commit hook that runs an clang-format stylecheck. +# git pre-commit hook that runs a clang-format stylecheck. # Features: # - abort commit when commit does not comply with the style guidelines # - create a patch of the proposed style changes @@ -97,7 +97,7 @@ do # The sed call is necessary to transform the patch from # --- $file timestamp # +++ - timestamp - # to both lines working on the same file and having a a/ and b/ prefix. + # to both lines working on the same file and having a/ and b/ prefix. # Else it can not be applied with 'git apply'. "$CLANG_FORMAT" -style=file "$file" | \ diff -u "$file" - | \ diff --git a/modules/etc/SCsub b/modules/etc/SCsub index f0c1ee64b9..9c3e703f11 100644 --- a/modules/etc/SCsub +++ b/modules/etc/SCsub @@ -34,7 +34,7 @@ env_etc.Append(CPPPATH=[thirdparty_dir]) env_etc.add_source_files(env.modules_sources, "*.cpp") # upstream uses c++11 -env_etc.Append(CXXFLAGS="-std=gnu++11") +env_etc.Append(CCFLAGS="-std=gnu++11") # -ffast-math seems to be incompatible with ec2comp on recent versions of # GCC and Clang if '-ffast-math' in env_etc['CCFLAGS']: diff --git a/modules/etc/image_etc.cpp b/modules/etc/image_etc.cpp index 9a15beb6eb..dc7d23bbd7 100644 --- a/modules/etc/image_etc.cpp +++ b/modules/etc/image_etc.cpp @@ -37,7 +37,6 @@ static Image::Format _get_etc2_mode(Image::DetectChannels format) { switch (format) { - case Image::DETECTED_L: case Image::DETECTED_R: return Image::FORMAT_ETC2_R11; @@ -47,7 +46,7 @@ static Image::Format _get_etc2_mode(Image::DetectChannels format) { case Image::DETECTED_RGB: return Image::FORMAT_ETC2_RGB8; - case Image::DETECTED_RGBA: + default: return Image::FORMAT_ETC2_RGBA8; // TODO: would be nice if we could use FORMAT_ETC2_RGB8A1 for FORMAT_RGBA5551 @@ -117,7 +116,7 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f return; } - int imgw = p_img->get_width(), imgh = p_img->get_height(); + uint32_t imgw = p_img->get_width(), imgh = p_img->get_height(); ERR_FAIL_COND(next_power_of_2(imgw) != imgw || next_power_of_2(imgh) != imgh); Image::Format etc_format = force_etc1_format ? Image::FORMAT_ETC : _get_etc2_mode(detected_channels); diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index 65970d48c1..f386f2b542 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -2,12 +2,16 @@ Import('env') -env.add_source_files(env.modules_sources, "*.cpp") -env.add_source_files(env.modules_sources, "godot/*.cpp") +gdn_env = env.Clone() -env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN']) -env.Append(CPPPATH=['#modules/gdnative/']) +gdn_env.add_source_files(env.modules_sources, "*.cpp") +gdn_env.add_source_files(env.modules_sources, "gdnative/*.cpp") +gdn_env.add_source_files(env.modules_sources, "nativescript/*.cpp") + +gdn_env.Append(CPPFLAGS=['-DGDAPI_BUILT_IN']) +gdn_env.Append(CPPPATH=['#modules/gdnative/include/']) if "platform" in env and env["platform"] == "x11": # there has to be a better solution? env.Append(LINKFLAGS=["-rdynamic"]) + env.use_ptrcall = True diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp index ded987557c..6da538844a 100644 --- a/modules/gdnative/gdnative.cpp +++ b/modules/gdnative/gdnative.cpp @@ -100,6 +100,11 @@ GDNativeLibrary::~GDNativeLibrary() { void GDNativeLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("set_library_path", "platform", "path"), &GDNativeLibrary::set_library_path); ClassDB::bind_method(D_METHOD("get_library_path", "platform"), &GDNativeLibrary::get_library_path); + + ClassDB::bind_method(D_METHOD("is_singleton_gdnative"), &GDNativeLibrary::is_singleton_gdnative); + ClassDB::bind_method(D_METHOD("set_singleton_gdnative", "singleton"), &GDNativeLibrary::set_singleton_gdnative); + + ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "singleton_gdnative"), "set_singleton_gdnative", "is_singleton_gdnative"); } bool GDNativeLibrary::_set(const StringName &p_name, const Variant &p_value) { @@ -175,7 +180,6 @@ GDNative::GDNative() { } GDNative::~GDNative() { - // TODO(karroffel): implement ALL the things! } extern "C" void _api_anchor(); diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h index dc1c3507ec..4753c7efe5 100644 --- a/modules/gdnative/gdnative.h +++ b/modules/gdnative/gdnative.h @@ -35,7 +35,7 @@ #include "os/thread_safe.h" #include "resource.h" -#include <godot/gdnative.h> +#include "gdnative/gdnative.h" class GDNativeLibrary : public Resource { GDCLASS(GDNativeLibrary, Resource) @@ -77,6 +77,8 @@ class GDNativeLibrary : public Resource { String library_paths[NUM_PLATFORMS]; + bool singleton_gdnative = false; + protected: bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; @@ -92,6 +94,9 @@ public: String get_library_path(StringName p_platform) const; String get_active_library_path() const; + + _FORCE_INLINE_ bool is_singleton_gdnative() const { return singleton_gdnative; } + _FORCE_INLINE_ void set_singleton_gdnative(bool p_singleton) { singleton_gdnative = p_singleton; } }; typedef godot_variant (*native_call_cb)(void *, godot_string *, godot_array *); diff --git a/modules/gdnative/godot/array.cpp b/modules/gdnative/gdnative/array.cpp index c15ba30ca2..51c023981f 100644 --- a/modules/gdnative/godot/array.cpp +++ b/modules/gdnative/gdnative/array.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/array.h> +#include "gdnative/array.h" #include "core/array.h" #include "core/os/memory.h" @@ -61,7 +61,7 @@ void GDAPI godot_array_new_pool_color_array(godot_array *r_dest, const godot_poo memnew_placement(dest, Array); dest->resize(pca->size()); - for (size_t i = 0; i < dest->size(); i++) { + for (int i = 0; i < dest->size(); i++) { Variant v = pca->operator[](i); dest->operator[](i) = v; } @@ -73,7 +73,7 @@ void GDAPI godot_array_new_pool_vector3_array(godot_array *r_dest, const godot_p memnew_placement(dest, Array); dest->resize(pca->size()); - for (size_t i = 0; i < dest->size(); i++) { + for (int i = 0; i < dest->size(); i++) { Variant v = pca->operator[](i); dest->operator[](i) = v; } @@ -85,7 +85,7 @@ void GDAPI godot_array_new_pool_vector2_array(godot_array *r_dest, const godot_p memnew_placement(dest, Array); dest->resize(pca->size()); - for (size_t i = 0; i < dest->size(); i++) { + for (int i = 0; i < dest->size(); i++) { Variant v = pca->operator[](i); dest->operator[](i) = v; } @@ -97,7 +97,7 @@ void GDAPI godot_array_new_pool_string_array(godot_array *r_dest, const godot_po memnew_placement(dest, Array); dest->resize(pca->size()); - for (size_t i = 0; i < dest->size(); i++) { + for (int i = 0; i < dest->size(); i++) { Variant v = pca->operator[](i); dest->operator[](i) = v; } @@ -109,7 +109,7 @@ void GDAPI godot_array_new_pool_real_array(godot_array *r_dest, const godot_pool memnew_placement(dest, Array); dest->resize(pca->size()); - for (size_t i = 0; i < dest->size(); i++) { + for (int i = 0; i < dest->size(); i++) { Variant v = pca->operator[](i); dest->operator[](i) = v; } @@ -121,7 +121,7 @@ void GDAPI godot_array_new_pool_int_array(godot_array *r_dest, const godot_pool_ memnew_placement(dest, Array); dest->resize(pca->size()); - for (size_t i = 0; i < dest->size(); i++) { + for (int i = 0; i < dest->size(); i++) { Variant v = pca->operator[](i); dest->operator[](i) = v; } @@ -133,7 +133,7 @@ void GDAPI godot_array_new_pool_byte_array(godot_array *r_dest, const godot_pool memnew_placement(dest, Array); dest->resize(pca->size()); - for (size_t i = 0; i < dest->size(); i++) { + for (int i = 0; i < dest->size(); i++) { Variant v = pca->operator[](i); dest->operator[](i) = v; } diff --git a/modules/gdnative/godot/basis.cpp b/modules/gdnative/gdnative/basis.cpp index 1d7aa18a70..b1327cdaef 100644 --- a/modules/gdnative/godot/basis.cpp +++ b/modules/gdnative/gdnative/basis.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/basis.h> +#include "gdnative/basis.h" #include "core/math/matrix3.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/color.cpp b/modules/gdnative/gdnative/color.cpp index 3677fdc265..3f8912d896 100644 --- a/modules/gdnative/godot/color.cpp +++ b/modules/gdnative/gdnative/color.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/color.h> +#include "gdnative/color.h" #include "core/color.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/dictionary.cpp b/modules/gdnative/gdnative/dictionary.cpp index 2996cc78a3..ed98cdbb00 100644 --- a/modules/gdnative/godot/dictionary.cpp +++ b/modules/gdnative/gdnative/dictionary.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/dictionary.h> +#include "gdnative/dictionary.h" #include "core/variant.h" // core/variant.h before to avoid compile errors with MSVC diff --git a/modules/gdnative/godot/gdnative.cpp b/modules/gdnative/gdnative/gdnative.cpp index 7cd52da34d..cf1f6a4f16 100644 --- a/modules/gdnative/godot/gdnative.cpp +++ b/modules/gdnative/gdnative/gdnative.cpp @@ -27,11 +27,10 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/gdnative.h> +#include "gdnative/gdnative.h" #include "class_db.h" #include "error_macros.h" -#include "gdnative.h" #include "global_constants.h" #include "os/os.h" #include "project_settings.h" diff --git a/modules/gdnative/godot/node_path.cpp b/modules/gdnative/gdnative/node_path.cpp index 2309588a81..50fade5b94 100644 --- a/modules/gdnative/godot/node_path.cpp +++ b/modules/gdnative/gdnative/node_path.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/node_path.h> +#include "gdnative/node_path.h" #include "core/node_path.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/plane.cpp b/modules/gdnative/gdnative/plane.cpp index f3d4b6971e..a5e05ffa6b 100644 --- a/modules/gdnative/godot/plane.cpp +++ b/modules/gdnative/gdnative/plane.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/plane.h> +#include "gdnative/plane.h" #include "core/math/plane.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/pool_arrays.cpp b/modules/gdnative/gdnative/pool_arrays.cpp index 2e533077f6..1393374da2 100644 --- a/modules/gdnative/godot/pool_arrays.cpp +++ b/modules/gdnative/gdnative/pool_arrays.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/pool_arrays.h> +#include "gdnative/pool_arrays.h" #include "array.h" #include "core/variant.h" @@ -65,7 +65,7 @@ void GDAPI godot_pool_byte_array_new_with_array(godot_pool_byte_array *r_dest, c memnew_placement(dest, PoolVector<uint8_t>); dest->resize(a->size()); - for (size_t i = 0; i < a->size(); i++) { + for (int i = 0; i < a->size(); i++) { dest->set(i, (*a)[i]); } } @@ -144,7 +144,7 @@ void GDAPI godot_pool_int_array_new_with_array(godot_pool_int_array *r_dest, con memnew_placement(dest, PoolVector<godot_int>); dest->resize(a->size()); - for (size_t i = 0; i < a->size(); i++) { + for (int i = 0; i < a->size(); i++) { dest->set(i, (*a)[i]); } } @@ -223,7 +223,7 @@ void GDAPI godot_pool_real_array_new_with_array(godot_pool_real_array *r_dest, c memnew_placement(dest, PoolVector<godot_real>); dest->resize(a->size()); - for (size_t i = 0; i < a->size(); i++) { + for (int i = 0; i < a->size(); i++) { dest->set(i, (*a)[i]); } } @@ -302,7 +302,7 @@ void GDAPI godot_pool_string_array_new_with_array(godot_pool_string_array *r_des memnew_placement(dest, PoolVector<String>); dest->resize(a->size()); - for (size_t i = 0; i < a->size(); i++) { + for (int i = 0; i < a->size(); i++) { dest->set(i, (*a)[i]); } } @@ -389,7 +389,7 @@ void GDAPI godot_pool_vector2_array_new_with_array(godot_pool_vector2_array *r_d memnew_placement(dest, PoolVector<Vector2>); dest->resize(a->size()); - for (size_t i = 0; i < a->size(); i++) { + for (int i = 0; i < a->size(); i++) { dest->set(i, (*a)[i]); } } @@ -475,7 +475,7 @@ void GDAPI godot_pool_vector3_array_new_with_array(godot_pool_vector3_array *r_d memnew_placement(dest, PoolVector<Vector3>); dest->resize(a->size()); - for (size_t i = 0; i < a->size(); i++) { + for (int i = 0; i < a->size(); i++) { dest->set(i, (*a)[i]); } } @@ -561,7 +561,7 @@ void GDAPI godot_pool_color_array_new_with_array(godot_pool_color_array *r_dest, memnew_placement(dest, PoolVector<Color>); dest->resize(a->size()); - for (size_t i = 0; i < a->size(); i++) { + for (int i = 0; i < a->size(); i++) { dest->set(i, (*a)[i]); } } diff --git a/modules/gdnative/godot/quat.cpp b/modules/gdnative/gdnative/quat.cpp index e6bea78b60..7db7847da1 100644 --- a/modules/gdnative/godot/quat.cpp +++ b/modules/gdnative/gdnative/quat.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/quat.h> +#include "gdnative/quat.h" #include "core/math/quat.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/rect2.cpp b/modules/gdnative/gdnative/rect2.cpp index 98e7855dc9..ecd8cce9ca 100644 --- a/modules/gdnative/godot/rect2.cpp +++ b/modules/gdnative/gdnative/rect2.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/rect2.h> +#include "gdnative/rect2.h" #include "core/math/math_2d.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/rect3.cpp b/modules/gdnative/gdnative/rect3.cpp index 88952ab49c..d34d964db9 100644 --- a/modules/gdnative/godot/rect3.cpp +++ b/modules/gdnative/gdnative/rect3.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/rect3.h> +#include "gdnative/rect3.h" #include "core/math/rect3.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/rid.cpp b/modules/gdnative/gdnative/rid.cpp index 51c8aaa1b3..f05c39906c 100644 --- a/modules/gdnative/godot/rid.cpp +++ b/modules/gdnative/gdnative/rid.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/rid.h> +#include "gdnative/rid.h" #include "core/resource.h" #include "core/rid.h" diff --git a/modules/gdnative/godot/string.cpp b/modules/gdnative/gdnative/string.cpp index 1282cf95e5..9b715ce36a 100644 --- a/modules/gdnative/godot/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/string.h> +#include "gdnative/string.h" #include "core/variant.h" #include "string_db.h" diff --git a/modules/gdnative/godot/transform.cpp b/modules/gdnative/gdnative/transform.cpp index a965067b77..d7a3e78d3f 100644 --- a/modules/gdnative/godot/transform.cpp +++ b/modules/gdnative/gdnative/transform.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/transform.h> +#include "gdnative/transform.h" #include "core/math/transform.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/transform2d.cpp b/modules/gdnative/gdnative/transform2d.cpp index 9fc44ecdfa..dcb54f7a53 100644 --- a/modules/gdnative/godot/transform2d.cpp +++ b/modules/gdnative/gdnative/transform2d.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/transform2d.h> +#include "gdnative/transform2d.h" #include "core/math/math_2d.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/variant.cpp b/modules/gdnative/gdnative/variant.cpp index 582544b3a0..b61f80b1f9 100644 --- a/modules/gdnative/godot/variant.cpp +++ b/modules/gdnative/gdnative/variant.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/variant.h> +#include "gdnative/variant.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/vector2.cpp b/modules/gdnative/gdnative/vector2.cpp index 78ed5f06a9..67f858997f 100644 --- a/modules/gdnative/godot/vector2.cpp +++ b/modules/gdnative/gdnative/vector2.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/vector2.h> +#include "gdnative/vector2.h" #include "core/math/math_2d.h" #include "core/variant.h" diff --git a/modules/gdnative/godot/vector3.cpp b/modules/gdnative/gdnative/vector3.cpp index 5faeac2864..c85a3f1c08 100644 --- a/modules/gdnative/godot/vector3.cpp +++ b/modules/gdnative/gdnative/vector3.cpp @@ -27,7 +27,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include <godot/vector3.h> +#include "gdnative/vector3.h" #include "core/variant.h" #include "core/vector.h" diff --git a/modules/gdnative/godot/icon.png.import b/modules/gdnative/godot/icon.png.import deleted file mode 100644 index 27920124f9..0000000000 --- a/modules/gdnative/godot/icon.png.import +++ /dev/null @@ -1,23 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/icon.png-aa47d037a37fb38b3b7e7828e4eec407.stex" - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -stream=false -size_limit=0 -detect_3d=true diff --git a/modules/gdnative/godot/array.h b/modules/gdnative/include/gdnative/array.h index 08f73c8785..edab028cba 100644 --- a/modules/gdnative/godot/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -46,10 +46,10 @@ typedef struct { } godot_array; #endif -#include <godot/pool_arrays.h> -#include <godot/variant.h> +#include <gdnative/pool_arrays.h> +#include <gdnative/variant.h> -#include <godot/gdnative.h> +#include <gdnative/gdnative.h> void GDAPI godot_array_new(godot_array *r_dest); void GDAPI godot_array_new_copy(godot_array *r_dest, const godot_array *p_src); diff --git a/modules/gdnative/godot/basis.h b/modules/gdnative/include/gdnative/basis.h index f36d2199de..8ff6a6f541 100644 --- a/modules/gdnative/godot/basis.h +++ b/modules/gdnative/include/gdnative/basis.h @@ -45,9 +45,9 @@ typedef struct { } godot_basis; #endif -#include <godot/gdnative.h> -#include <godot/quat.h> -#include <godot/vector3.h> +#include <gdnative/gdnative.h> +#include <gdnative/quat.h> +#include <gdnative/vector3.h> void GDAPI godot_basis_new_with_rows(godot_basis *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis); void GDAPI godot_basis_new_with_axis_and_angle(godot_basis *r_dest, const godot_vector3 *p_axis, const godot_real p_phi); diff --git a/modules/gdnative/godot/color.h b/modules/gdnative/include/gdnative/color.h index 5d550e40b3..90dccf75aa 100644 --- a/modules/gdnative/godot/color.h +++ b/modules/gdnative/include/gdnative/color.h @@ -45,8 +45,8 @@ typedef struct { } godot_color; #endif -#include <godot/gdnative.h> -#include <godot/string.h> +#include <gdnative/gdnative.h> +#include <gdnative/string.h> void GDAPI godot_color_new_rgba(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b, const godot_real p_a); void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const godot_real p_g, const godot_real p_b); diff --git a/modules/gdnative/godot/dictionary.h b/modules/gdnative/include/gdnative/dictionary.h index 10d580af08..c85c3f3830 100644 --- a/modules/gdnative/godot/dictionary.h +++ b/modules/gdnative/include/gdnative/dictionary.h @@ -45,9 +45,9 @@ typedef struct { } godot_dictionary; #endif -#include <godot/array.h> -#include <godot/gdnative.h> -#include <godot/variant.h> +#include <gdnative/array.h> +#include <gdnative/gdnative.h> +#include <gdnative/variant.h> void GDAPI godot_dictionary_new(godot_dictionary *r_dest); void GDAPI godot_dictionary_new_copy(godot_dictionary *r_dest, const godot_dictionary *p_src); diff --git a/modules/gdnative/godot/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index c71a7ae1ef..c574c56d5a 100644 --- a/modules/gdnative/godot/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -146,100 +146,74 @@ typedef float godot_real; /////// Object (forward declared) typedef void godot_object; -/////// Brute force forward declarations for the rest -/* -typedef struct godot_variant godot_variant; -typedef struct godot_string godot_string; -typedef struct godot_vector2 godot_vector2; -typedef struct godot_rect2 godot_rect2; -typedef struct godot_vector3 godot_vector3; -typedef struct godot_transform2d godot_transform2d; -typedef struct godot_plane godot_plane; -typedef struct godot_quat godot_quat; -typedef struct godot_rect3 godot_rect3; -typedef struct godot_basis godot_basis; -typedef struct godot_transform godot_transform; -typedef struct godot_color godot_color; -typedef struct godot_node_path godot_node_path; -typedef struct godot_rid godot_rid; -typedef struct godot_dictionary godot_dictionary; -typedef struct godot_array godot_array; -typedef struct godot_pool_byte_array godot_pool_byte_array; -typedef struct godot_pool_int_array godot_pool_int_array; -typedef struct godot_pool_real_array godot_pool_real_array; -typedef struct godot_pool_string_array godot_pool_string_array; -typedef struct godot_pool_vector2_array godot_pool_vector2_array; -typedef struct godot_pool_vector3_array godot_pool_vector3_array; -typedef struct godot_pool_color_array godot_pool_color_array; -*/ /////// String -#include <godot/string.h> +#include <gdnative/string.h> ////// Vector2 -#include <godot/vector2.h> +#include <gdnative/vector2.h> ////// Rect2 -#include <godot/rect2.h> +#include <gdnative/rect2.h> ////// Vector3 -#include <godot/vector3.h> +#include <gdnative/vector3.h> ////// Transform2D -#include <godot/transform2d.h> +#include <gdnative/transform2d.h> /////// Plane -#include <godot/plane.h> +#include <gdnative/plane.h> /////// Quat -#include <godot/quat.h> +#include <gdnative/quat.h> /////// Rect3 -#include <godot/rect3.h> +#include <gdnative/rect3.h> /////// Basis -#include <godot/basis.h> +#include <gdnative/basis.h> /////// Transform -#include <godot/transform.h> +#include <gdnative/transform.h> /////// Color -#include <godot/color.h> +#include <gdnative/color.h> /////// NodePath -#include <godot/node_path.h> +#include <gdnative/node_path.h> /////// RID -#include <godot/rid.h> +#include <gdnative/rid.h> /////// Dictionary -#include <godot/dictionary.h> +#include <gdnative/dictionary.h> /////// Array -#include <godot/array.h> +#include <gdnative/array.h> // single API file for Pool*Array -#include <godot/pool_arrays.h> +#include <gdnative/pool_arrays.h> void GDAPI godot_object_destroy(godot_object *p_o); ////// Variant -#include <godot/variant.h> +#include <gdnative/variant.h> ////// Singleton API diff --git a/modules/gdnative/godot/node_path.h b/modules/gdnative/include/gdnative/node_path.h index 2f71ddd59d..0cfdbc1127 100644 --- a/modules/gdnative/godot/node_path.h +++ b/modules/gdnative/include/gdnative/node_path.h @@ -45,8 +45,8 @@ typedef struct { } godot_node_path; #endif -#include <godot/gdnative.h> -#include <godot/string.h> +#include <gdnative/gdnative.h> +#include <gdnative/string.h> void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_from); void GDAPI godot_node_path_new_copy(godot_node_path *r_dest, const godot_node_path *p_src); diff --git a/modules/gdnative/godot/plane.h b/modules/gdnative/include/gdnative/plane.h index 27548c8b0c..6a8915e08b 100644 --- a/modules/gdnative/godot/plane.h +++ b/modules/gdnative/include/gdnative/plane.h @@ -45,8 +45,8 @@ typedef struct { } godot_plane; #endif -#include <godot/gdnative.h> -#include <godot/vector3.h> +#include <gdnative/gdnative.h> +#include <gdnative/vector3.h> void GDAPI godot_plane_new_with_reals(godot_plane *r_dest, const godot_real p_a, const godot_real p_b, const godot_real p_c, const godot_real p_d); void GDAPI godot_plane_new_with_vectors(godot_plane *r_dest, const godot_vector3 *p_v1, const godot_vector3 *p_v2, const godot_vector3 *p_v3); diff --git a/modules/gdnative/godot/pool_arrays.h b/modules/gdnative/include/gdnative/pool_arrays.h index 1b51dca38c..cb1095ee8c 100644 --- a/modules/gdnative/godot/pool_arrays.h +++ b/modules/gdnative/include/gdnative/pool_arrays.h @@ -113,12 +113,12 @@ typedef struct { } godot_pool_color_array; #endif -#include <godot/array.h> -#include <godot/color.h> -#include <godot/vector2.h> -#include <godot/vector3.h> +#include <gdnative/array.h> +#include <gdnative/color.h> +#include <gdnative/vector2.h> +#include <gdnative/vector3.h> -#include <godot/gdnative.h> +#include <gdnative/gdnative.h> // byte diff --git a/modules/gdnative/godot/quat.h b/modules/gdnative/include/gdnative/quat.h index 9a3238a337..4ffb96eb26 100644 --- a/modules/gdnative/godot/quat.h +++ b/modules/gdnative/include/gdnative/quat.h @@ -45,8 +45,8 @@ typedef struct { } godot_quat; #endif -#include <godot/gdnative.h> -#include <godot/vector3.h> +#include <gdnative/gdnative.h> +#include <gdnative/vector3.h> void GDAPI godot_quat_new(godot_quat *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_z, const godot_real p_w); void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector3 *p_axis, const godot_real p_angle); diff --git a/modules/gdnative/godot/rect2.h b/modules/gdnative/include/gdnative/rect2.h index 8ceeddf1b4..9e6cf60342 100644 --- a/modules/gdnative/godot/rect2.h +++ b/modules/gdnative/include/gdnative/rect2.h @@ -43,8 +43,8 @@ typedef struct godot_rect2 { } godot_rect2; #endif -#include <godot/gdnative.h> -#include <godot/vector2.h> +#include <gdnative/gdnative.h> +#include <gdnative/vector2.h> void GDAPI godot_rect2_new_with_position_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size); void GDAPI godot_rect2_new(godot_rect2 *r_dest, const godot_real p_x, const godot_real p_y, const godot_real p_width, const godot_real p_height); diff --git a/modules/gdnative/godot/rect3.h b/modules/gdnative/include/gdnative/rect3.h index ca96aadd5c..f94b6fea25 100644 --- a/modules/gdnative/godot/rect3.h +++ b/modules/gdnative/include/gdnative/rect3.h @@ -45,9 +45,9 @@ typedef struct { } godot_rect3; #endif -#include <godot/gdnative.h> -#include <godot/plane.h> -#include <godot/vector3.h> +#include <gdnative/gdnative.h> +#include <gdnative/plane.h> +#include <gdnative/vector3.h> void GDAPI godot_rect3_new(godot_rect3 *r_dest, const godot_vector3 *p_pos, const godot_vector3 *p_size); diff --git a/modules/gdnative/godot/rid.h b/modules/gdnative/include/gdnative/rid.h index c56ff38735..d9b5336fc9 100644 --- a/modules/gdnative/godot/rid.h +++ b/modules/gdnative/include/gdnative/rid.h @@ -45,7 +45,7 @@ typedef struct { } godot_rid; #endif -#include <godot/gdnative.h> +#include <gdnative/gdnative.h> void GDAPI godot_rid_new(godot_rid *r_dest); diff --git a/modules/gdnative/godot/string.h b/modules/gdnative/include/gdnative/string.h index 128448e64e..aca23a81d8 100644 --- a/modules/gdnative/godot/string.h +++ b/modules/gdnative/include/gdnative/string.h @@ -46,8 +46,8 @@ typedef struct { } godot_string; #endif -#include <godot/gdnative.h> -#include <godot/variant.h> +#include <gdnative/gdnative.h> +#include <gdnative/variant.h> void GDAPI godot_string_new(godot_string *r_dest); void GDAPI godot_string_new_copy(godot_string *r_dest, const godot_string *p_src); diff --git a/modules/gdnative/godot/transform.h b/modules/gdnative/include/gdnative/transform.h index 60788e3d57..656afae129 100644 --- a/modules/gdnative/godot/transform.h +++ b/modules/gdnative/include/gdnative/transform.h @@ -45,10 +45,10 @@ typedef struct { } godot_transform; #endif -#include <godot/basis.h> -#include <godot/gdnative.h> -#include <godot/variant.h> -#include <godot/vector3.h> +#include <gdnative/basis.h> +#include <gdnative/gdnative.h> +#include <gdnative/variant.h> +#include <gdnative/vector3.h> void GDAPI godot_transform_new_with_axis_origin(godot_transform *r_dest, const godot_vector3 *p_x_axis, const godot_vector3 *p_y_axis, const godot_vector3 *p_z_axis, const godot_vector3 *p_origin); void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_basis, const godot_vector3 *p_origin); diff --git a/modules/gdnative/godot/transform2d.h b/modules/gdnative/include/gdnative/transform2d.h index c0f5725eed..a945868b17 100644 --- a/modules/gdnative/godot/transform2d.h +++ b/modules/gdnative/include/gdnative/transform2d.h @@ -45,9 +45,9 @@ typedef struct { } godot_transform2d; #endif -#include <godot/gdnative.h> -#include <godot/variant.h> -#include <godot/vector2.h> +#include <gdnative/gdnative.h> +#include <gdnative/variant.h> +#include <gdnative/vector2.h> void GDAPI godot_transform2d_new(godot_transform2d *r_dest, const godot_real p_rot, const godot_vector2 *p_pos); void GDAPI godot_transform2d_new_axis_origin(godot_transform2d *r_dest, const godot_vector2 *p_x_axis, const godot_vector2 *p_y_axis, const godot_vector2 *p_origin); diff --git a/modules/gdnative/godot/variant.h b/modules/gdnative/include/gdnative/variant.h index 849ba8bda6..969506585d 100644 --- a/modules/gdnative/godot/variant.h +++ b/modules/gdnative/include/gdnative/variant.h @@ -99,25 +99,25 @@ typedef struct godot_variant_call_error { godot_variant_type expected; } godot_variant_call_error; -#include <godot/array.h> -#include <godot/basis.h> -#include <godot/color.h> -#include <godot/dictionary.h> -#include <godot/node_path.h> -#include <godot/plane.h> -#include <godot/pool_arrays.h> -#include <godot/quat.h> -#include <godot/rect2.h> -#include <godot/rect3.h> -#include <godot/rid.h> -#include <godot/string.h> -#include <godot/transform.h> -#include <godot/transform2d.h> -#include <godot/variant.h> -#include <godot/vector2.h> -#include <godot/vector3.h> - -#include <godot/gdnative.h> +#include <gdnative/array.h> +#include <gdnative/basis.h> +#include <gdnative/color.h> +#include <gdnative/dictionary.h> +#include <gdnative/node_path.h> +#include <gdnative/plane.h> +#include <gdnative/pool_arrays.h> +#include <gdnative/quat.h> +#include <gdnative/rect2.h> +#include <gdnative/rect3.h> +#include <gdnative/rid.h> +#include <gdnative/string.h> +#include <gdnative/transform.h> +#include <gdnative/transform2d.h> +#include <gdnative/variant.h> +#include <gdnative/vector2.h> +#include <gdnative/vector3.h> + +#include <gdnative/gdnative.h> godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_v); diff --git a/modules/gdnative/godot/vector2.h b/modules/gdnative/include/gdnative/vector2.h index 98e9700e32..0af4abae27 100644 --- a/modules/gdnative/godot/vector2.h +++ b/modules/gdnative/include/gdnative/vector2.h @@ -45,7 +45,7 @@ typedef struct { } godot_vector2; #endif -#include <godot/gdnative.h> +#include <gdnative/gdnative.h> void GDAPI godot_vector2_new(godot_vector2 *r_dest, const godot_real p_x, const godot_real p_y); diff --git a/modules/gdnative/godot/vector3.h b/modules/gdnative/include/gdnative/vector3.h index b76ca11a9c..a27d516ec5 100644 --- a/modules/gdnative/godot/vector3.h +++ b/modules/gdnative/include/gdnative/vector3.h @@ -45,8 +45,8 @@ typedef struct { } godot_vector3; #endif -#include <godot/basis.h> -#include <godot/gdnative.h> +#include <gdnative/basis.h> +#include <gdnative/gdnative.h> typedef enum { GODOT_VECTOR3_AXIS_X, diff --git a/modules/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index d1cbf221ec..96f213ead7 100644 --- a/modules/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -30,7 +30,7 @@ #ifndef GODOT_NATIVESCRIPT_H #define GODOT_NATIVESCRIPT_H -#include <godot/gdnative.h> +#include <gdnative/gdnative.h> #ifdef __cplusplus extern "C" { diff --git a/modules/nativescript/SCsub b/modules/gdnative/nativescript/SCsub index e980e40e8e..e980e40e8e 100644 --- a/modules/nativescript/SCsub +++ b/modules/gdnative/nativescript/SCsub diff --git a/modules/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp index fdd5a2ea19..fdd5a2ea19 100644 --- a/modules/nativescript/api_generator.cpp +++ b/modules/gdnative/nativescript/api_generator.cpp diff --git a/modules/nativescript/api_generator.h b/modules/gdnative/nativescript/api_generator.h index 56c2d786e6..56c2d786e6 100644 --- a/modules/nativescript/api_generator.h +++ b/modules/gdnative/nativescript/api_generator.h diff --git a/modules/nativescript/godot_nativescript.cpp b/modules/gdnative/nativescript/godot_nativescript.cpp index 926b3261b2..61ac13b796 100644 --- a/modules/nativescript/godot_nativescript.cpp +++ b/modules/gdnative/nativescript/godot_nativescript.cpp @@ -27,17 +27,17 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "godot_nativescript.h" - -#include "nativescript.h" +#include "nativescript/godot_nativescript.h" #include "class_db.h" #include "error_macros.h" -#include "gdnative.h" +#include "gdnative/gdnative.h" #include "global_constants.h" #include "project_settings.h" #include "variant.h" +#include "nativescript.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/modules/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index e141080687..b9bd65af53 100644 --- a/modules/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "nativescript.h" -#include "modules/gdnative/godot/gdnative.h" +#include "gdnative/gdnative.h" #include "global_constants.h" #include "io/file_access_encrypted.h" @@ -315,7 +315,7 @@ void NativeScript::get_script_signal_list(List<MethodInfo> *r_signals) const { bool NativeScript::get_property_default_value(const StringName &p_property, Variant &r_value) const { NativeScriptDesc *script_data = get_script_desc(); - Map<StringName, NativeScriptDesc::Property>::Element *P = NULL; + OrderedHashMap<StringName, NativeScriptDesc::Property>::Element P; while (!P && script_data) { P = script_data->properties.find(p_property); script_data = script_data->base_data; @@ -323,7 +323,7 @@ bool NativeScript::get_property_default_value(const StringName &p_property, Vari if (!P) return false; - r_value = P->get().default_value; + r_value = P.get().default_value; return true; } @@ -355,23 +355,20 @@ void NativeScript::get_script_method_list(List<MethodInfo> *p_list) const { void NativeScript::get_script_property_list(List<PropertyInfo> *p_list) const { NativeScriptDesc *script_data = get_script_desc(); - if (!script_data) - return; - - Set<PropertyInfo> properties; - + Set<StringName> existing_properties; while (script_data) { - - for (Map<StringName, NativeScriptDesc::Property>::Element *E = script_data->properties.front(); E; E = E->next()) { - properties.insert(E->get().info); + List<PropertyInfo>::Element *insert_position = p_list->front(); + bool insert_before = true; + + for (OrderedHashMap<StringName, NativeScriptDesc::Property>::Element E = script_data->properties.front(); E; E = E.next()) { + if (!existing_properties.has(E.key())) { + insert_position = insert_before ? p_list->insert_before(insert_position, E.get().info) : p_list->insert_after(insert_position, E.get().info); + insert_before = false; + existing_properties.insert(E.key()); + } } - script_data = script_data->base_data; } - - for (Set<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) { - p_list->push_back(E->get()); - } } Variant NativeScript::_new(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { @@ -461,10 +458,10 @@ bool NativeScriptInstance::set(const StringName &p_name, const Variant &p_value) NativeScriptDesc *script_data = GET_SCRIPT_DESC(); while (script_data) { - Map<StringName, NativeScriptDesc::Property>::Element *P = script_data->properties.find(p_name); + OrderedHashMap<StringName, NativeScriptDesc::Property>::Element P = script_data->properties.find(p_name); if (P) { - P->get().setter.set_func((godot_object *)owner, - P->get().setter.method_data, + P.get().setter.set_func((godot_object *)owner, + P.get().setter.method_data, userdata, (godot_variant *)&p_value); return true; @@ -491,11 +488,11 @@ bool NativeScriptInstance::get(const StringName &p_name, Variant &r_ret) const { NativeScriptDesc *script_data = GET_SCRIPT_DESC(); while (script_data) { - Map<StringName, NativeScriptDesc::Property>::Element *P = script_data->properties.find(p_name); + OrderedHashMap<StringName, NativeScriptDesc::Property>::Element P = script_data->properties.find(p_name); if (P) { godot_variant value; - value = P->get().getter.get_func((godot_object *)owner, - P->get().getter.method_data, + value = P.get().getter.get_func((godot_object *)owner, + P.get().getter.method_data, userdata); r_ret = *(Variant *)&value; godot_variant_destroy(&value); @@ -592,10 +589,10 @@ Variant::Type NativeScriptInstance::get_property_type(const StringName &p_name, while (script_data) { - Map<StringName, NativeScriptDesc::Property>::Element *P = script_data->properties.find(p_name); + OrderedHashMap<StringName, NativeScriptDesc::Property>::Element P = script_data->properties.find(p_name); if (P) { *r_is_valid = true; - return P->get().info.type; + return P.get().info.type; } script_data = script_data->base_data; @@ -706,9 +703,9 @@ NativeScriptInstance::RPCMode NativeScriptInstance::get_rset_mode(const StringNa while (script_data) { - Map<StringName, NativeScriptDesc::Property>::Element *E = script_data->properties.find(p_variable); + OrderedHashMap<StringName, NativeScriptDesc::Property>::Element E = script_data->properties.find(p_variable); if (E) { - switch (E->get().rset_mode) { + switch (E.get().rset_mode) { case GODOT_METHOD_RPC_MODE_DISABLED: return RPC_MODE_DISABLED; case GODOT_METHOD_RPC_MODE_REMOTE: @@ -796,12 +793,12 @@ void NativeScriptLanguage::_unload_stuff() { for (Map<StringName, NativeScriptDesc>::Element *C = L->get().front(); C; C = C->next()) { // free property stuff first - for (Map<StringName, NativeScriptDesc::Property>::Element *P = C->get().properties.front(); P; P = P->next()) { - if (P->get().getter.free_func) - P->get().getter.free_func(P->get().getter.method_data); + for (OrderedHashMap<StringName, NativeScriptDesc::Property>::Element P = C->get().properties.front(); P; P = P.next()) { + if (P.get().getter.free_func) + P.get().getter.free_func(P.get().getter.method_data); - if (P->get().setter.free_func) - P->get().setter.free_func(P->get().setter.method_data); + if (P.get().setter.free_func) + P.get().setter.free_func(P.get().setter.method_data); } // free method stuff diff --git a/modules/nativescript/nativescript.h b/modules/gdnative/nativescript/nativescript.h index 571a3c9cc7..bc7e850d3e 100644 --- a/modules/nativescript/nativescript.h +++ b/modules/gdnative/nativescript/nativescript.h @@ -32,14 +32,15 @@ #include "io/resource_loader.h" #include "io/resource_saver.h" +#include "ordered_hash_map.h" #include "os/thread_safe.h" #include "resource.h" #include "scene/main/node.h" #include "script_language.h" #include "self_list.h" -#include "godot_nativescript.h" #include "modules/gdnative/gdnative.h" +#include <nativescript/godot_nativescript.h> #ifndef NO_THREADS #include "os/mutex.h" @@ -65,7 +66,7 @@ struct NativeScriptDesc { }; Map<StringName, Method> methods; - Map<StringName, Property> properties; + OrderedHashMap<StringName, Property> properties; Map<StringName, Signal> signals_; // QtCreator doesn't like the name signals StringName base; StringName base_native_type; diff --git a/modules/nativescript/register_types.cpp b/modules/gdnative/nativescript/register_types.cpp index b846710ab8..b846710ab8 100644 --- a/modules/nativescript/register_types.cpp +++ b/modules/gdnative/nativescript/register_types.cpp diff --git a/modules/nativescript/register_types.h b/modules/gdnative/nativescript/register_types.h index 7ac558f68f..7ac558f68f 100644 --- a/modules/nativescript/register_types.h +++ b/modules/gdnative/nativescript/register_types.h diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index 9ad05b7194..559e9fa455 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -28,12 +28,99 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "register_types.h" +#include "gdnative/gdnative.h" + #include "gdnative.h" #include "io/resource_loader.h" #include "io/resource_saver.h" +#include "nativescript/register_types.h" + +#include "core/engine.h" #include "core/os/os.h" +#include "core/project_settings.h" + +#ifdef TOOLS_ENABLED +#include "editor/editor_node.h" + +// Class used to discover singleton gdnative files + +void actual_discoverer_handler(); + +class GDNativeSingletonDiscover : public Object { + // GDCLASS(GDNativeSingletonDiscover, Object) + + virtual String get_class() const { + // okay, this is a really dirty hack. + // We're overriding get_class so we can connect it to a signal + // This works because get_class is a virtual method, so we don't + // need to register a new class to ClassDB just for this one + // little signal. + + actual_discoverer_handler(); + + return "Object"; + } +}; + +Set<String> get_gdnative_singletons(EditorFileSystemDirectory *p_dir) { + + Set<String> file_paths; + + // check children + + for (int i = 0; i < p_dir->get_file_count(); i++) { + String file_name = p_dir->get_file(i); + String file_type = p_dir->get_file_type(i); + + if (file_type != "GDNativeLibrary") { + continue; + } + + Ref<GDNativeLibrary> lib = ResourceLoader::load(p_dir->get_file_path(i)); + if (lib.is_valid() && lib->is_singleton_gdnative()) { + file_paths.insert(p_dir->get_file_path(i)); + } + } + + // check subdirectories + for (int i = 0; i < p_dir->get_subdir_count(); i++) { + Set<String> paths = get_gdnative_singletons(p_dir->get_subdir(i)); + + for (Set<String>::Element *E = paths.front(); E; E = E->next()) { + file_paths.insert(E->get()); + } + } + + return file_paths; +} + +void actual_discoverer_handler() { + EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem(); + + Set<String> file_paths = get_gdnative_singletons(dir); + + Array files; + files.resize(file_paths.size()); + int i = 0; + for (Set<String>::Element *E = file_paths.front(); E; i++, E = E->next()) { + files.set(i, E->get()); + } + + ProjectSettings::get_singleton()->set("gdnative/singletons", files); + + ProjectSettings::get_singleton()->save(); +} + +GDNativeSingletonDiscover *discoverer = NULL; + +void discoverer_callback() { + discoverer = memnew(GDNativeSingletonDiscover); + EditorFileSystem::get_singleton()->connect("filesystem_changed", discoverer, "get_class"); +} + +#endif godot_variant cb_standard_varcall(void *handle, godot_string *p_procedure, godot_array *p_args) { if (handle == NULL) { @@ -62,21 +149,110 @@ godot_variant cb_standard_varcall(void *handle, godot_string *p_procedure, godot return proc(NULL, p_args); } +void cb_singleton_call( + void *p_handle, + godot_string *p_proc_name, + void *p_data, + int p_num_args, + void **p_args, + void *r_return) { + if (p_handle == NULL) { + ERR_PRINT("No valid library handle, can't call singleton procedure"); + return; + } + + void *singleton_proc; + Error err = OS::get_singleton()->get_dynamic_library_symbol_handle( + p_handle, + *(String *)p_proc_name, + singleton_proc); + + if (err != OK) { + return; + } + + void (*singleton_procedure_ptr)() = (void (*)())singleton_proc; + singleton_procedure_ptr(); +} + GDNativeCallRegistry *GDNativeCallRegistry::singleton; +Vector<Ref<GDNative> > singleton_gdnatives; + void register_gdnative_types() { +#ifdef TOOLS_ENABLED + + if (Engine::get_singleton()->is_editor_hint()) { + EditorNode::add_init_callback(discoverer_callback); + } +#endif + ClassDB::register_class<GDNativeLibrary>(); ClassDB::register_class<GDNative>(); GDNativeCallRegistry::singleton = memnew(GDNativeCallRegistry); GDNativeCallRegistry::singleton->register_native_call_type("standard_varcall", cb_standard_varcall); + + GDNativeCallRegistry::singleton->register_native_raw_call_type("gdnative_singleton_call", cb_singleton_call); + + register_nativescript_types(); + + // run singletons + + Array singletons = ProjectSettings::get_singleton()->get("gdnative/singletons"); + + singleton_gdnatives.resize(singletons.size()); + + for (int i = 0; i < singletons.size(); i++) { + String path = singletons[i]; + + Ref<GDNativeLibrary> lib = ResourceLoader::load(path); + + singleton_gdnatives[i].instance(); + singleton_gdnatives[i]->set_library(lib); + + if (!singleton_gdnatives[i]->initialize()) { + // Can't initialize. Don't make a native_call then + continue; + } + + singleton_gdnatives[i]->call_native_raw( + "gdnative_singleton_call", + "godot_gdnative_singleton", + NULL, + 0, + NULL, + NULL); + } } void unregister_gdnative_types() { + + for (int i = 0; i < singleton_gdnatives.size(); i++) { + + if (singleton_gdnatives[i].is_null()) { + continue; + } + + if (!singleton_gdnatives[i]->is_initialized()) { + continue; + } + + singleton_gdnatives[i]->terminate(); + } + + unregister_nativescript_types(); + memdelete(GDNativeCallRegistry::singleton); +#ifdef TOOLS_ENABLED + if (Engine::get_singleton()->is_editor_hint() && discoverer != NULL) { + memdelete(discoverer); + } +#endif + // This is for printing out the sizes of the core types /* diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index 70e7da5748..bc51b84047 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -866,7 +866,7 @@ static bool _guess_expression_type(GDCompletionContext &context, const GDParser: MethodBind *mb = ClassDB::get_method(base_type, getter); if (mb) { PropertyInfo rt = mb->get_return_info(); - if (rt.usage & PROPERTY_USAGE_CLASS_IS_ENUM && t == Variant::INT) { + if ((rt.usage & PROPERTY_USAGE_CLASS_IS_ENUM) && t == Variant::INT) { r_type.enumeration = rt.class_name; } else if (t == Variant::OBJECT) { @@ -1903,11 +1903,11 @@ static void _find_call_arguments(GDCompletionContext &context, const GDParser::N arghint += ", "; else arghint += " "; - if (i == p_argidx || (mi.flags & METHOD_FLAG_VARARG && i > p_argidx)) { + if (i == p_argidx || ((mi.flags & METHOD_FLAG_VARARG) && i > p_argidx)) { arghint += String::chr(0xFFFF); } arghint += _get_visual_datatype(mi.arguments[i]) + " " + mi.arguments[i].name; - if (i == p_argidx || (mi.flags & METHOD_FLAG_VARARG && i > p_argidx)) { + if (i == p_argidx || ((mi.flags & METHOD_FLAG_VARARG) && i > p_argidx)) { arghint += String::chr(0xFFFF); } } diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index e6f65fe0c2..ddee7b2521 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -290,8 +290,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a #ifdef DEBUG_ENABLED - uint64_t function_start_time; - uint64_t function_call_time; + uint64_t function_start_time = 0; + uint64_t function_call_time = 0; if (GDScriptLanguage::get_singleton()->profiling) { function_start_time = OS::get_singleton()->get_ticks_usec(); @@ -691,7 +691,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a } #ifdef DEBUG_ENABLED - uint64_t call_time; + uint64_t call_time = 0; if (GDScriptLanguage::get_singleton()->profiling) { call_time = OS::get_singleton()->get_ticks_usec(); @@ -1026,7 +1026,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a } case OPCODE_ITERATE_BEGIN: { - CHECK_SPACE(8); //space for this an regular iterate + CHECK_SPACE(8); //space for this a regular iterate GET_VARIANT_PTR(counter, 1); GET_VARIANT_PTR(container, 2); diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index f0cfdd6258..04752dc71a 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -1177,20 +1177,28 @@ void GDFunctions::call(Function p_func, const Variant **p_args, int p_arg_count, VALIDATE_ARG_COUNT(1); switch (p_args[0]->get_type()) { + case Variant::STRING: { + + String d = *p_args[0]; + r_ret = d.length(); + } break; case Variant::DICTIONARY: { + Dictionary d = *p_args[0]; r_ret = d.size(); } break; case Variant::ARRAY: { + Array d = *p_args[0]; r_ret = d.size(); } break; case Variant::POOL_BYTE_ARRAY: { + PoolVector<uint8_t> d = *p_args[0]; r_ret = d.size(); - } break; case Variant::POOL_INT_ARRAY: { + PoolVector<int> d = *p_args[0]; r_ret = d.size(); } break; @@ -1200,14 +1208,14 @@ void GDFunctions::call(Function p_func, const Variant **p_args, int p_arg_count, r_ret = d.size(); } break; case Variant::POOL_STRING_ARRAY: { + PoolVector<String> d = *p_args[0]; r_ret = d.size(); - } break; case Variant::POOL_VECTOR2_ARRAY: { + PoolVector<Vector2> d = *p_args[0]; r_ret = d.size(); - } break; case Variant::POOL_VECTOR3_ARRAY: { diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 072937a521..72c3f9612a 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -1284,7 +1284,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool if (expression[next_op + 1].is_op) { // this is not invalid and can really appear // but it becomes invalid anyway because no binary op - // can be followed by an unary op in a valid combination, + // can be followed by a unary op in a valid combination, // due to how precedence works, unaries will always disappear first _set_error("Unexpected two consecutive operators after ternary if."); @@ -1294,7 +1294,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool if (expression[next_op + 3].is_op) { // this is not invalid and can really appear // but it becomes invalid anyway because no binary op - // can be followed by an unary op in a valid combination, + // can be followed by a unary op in a valid combination, // due to how precedence works, unaries will always disappear first _set_error("Unexpected two consecutive operators after ternary else."); @@ -1331,7 +1331,7 @@ GDParser::Node *GDParser::_parse_expression(Node *p_parent, bool p_static, bool if (expression[next_op + 1].is_op) { // this is not invalid and can really appear // but it becomes invalid anyway because no binary op - // can be followed by an unary op in a valid combination, + // can be followed by a unary op in a valid combination, // due to how precedence works, unaries will always disappear first _set_error("Unexpected two consecutive operators."); @@ -1857,7 +1857,7 @@ GDParser::PatternNode *GDParser::_parse_pattern(bool p_static) { tokenizer->advance(1); break; } else { - _set_error("'..' pattern only allowed at the end of an dictionary pattern"); + _set_error("'..' pattern only allowed at the end of a dictionary pattern"); return NULL; } } diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h index 6f05a4770b..5e1a8b19ac 100644 --- a/modules/gdscript/gd_script.h +++ b/modules/gdscript/gd_script.h @@ -389,7 +389,6 @@ public: virtual bool can_inherit_from_file() { return true; } virtual int find_function(const String &p_function, const String &p_code) const; virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const; - virtual Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) { return OK; } virtual Error complete_code(const String &p_code, const String &p_base_path, Object *p_owner, List<String> *r_options, bool &r_forced, String &r_call_hint); #ifdef TOOLS_ENABLED virtual Error lookup_code(const String &p_code, const String &p_symbol, const String &p_base_path, Object *p_owner, LookupResult &r_result); diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 1b932f040e..4f7545a11d 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -396,8 +396,6 @@ bool GridMap::_octant_update(const OctantKey &p_key) { Map<int, List<Pair<Transform, IndexKey> > > multimesh_items; - print_line("updating octant " + itos(p_key.x) + ", " + itos(p_key.y) + ", " + itos(p_key.z) + " cells: " + itos(g.cells.size())); - for (Set<IndexKey>::Element *E = g.cells.front(); E; E = E->next()) { ERR_CONTINUE(!cell_map.has(E->get())); @@ -464,7 +462,6 @@ bool GridMap::_octant_update(const OctantKey &p_key) { //update multimeshes for (Map<int, List<Pair<Transform, IndexKey> > >::Element *E = multimesh_items.front(); E; E = E->next()) { - print_line("multimesh item " + itos(E->key()) + " transforms " + itos(E->get().size())); Octant::MultimeshInstance mmi; RID mm = VS::get_singleton()->multimesh_create(); @@ -655,6 +652,24 @@ void GridMap::_notification(int p_what) { //_update_area_instances(); } break; + case NOTIFICATION_VISIBILITY_CHANGED: { + _update_visibility(); + } break; + } +} + +void GridMap::_update_visibility() { + if (!is_inside_tree()) + return; + + _change_notify("visible"); + + for (Map<OctantKey, Octant *>::Element *e = octant_map.front(); e; e = e->next()) { + Octant *octant = e->value(); + for (int i = 0; i < octant->multimesh_instances.size(); i++) { + Octant::MultimeshInstance &mi = octant->multimesh_instances[i]; + VS::get_singleton()->instance_set_visible(mi.instance, is_visible()); + } } } @@ -720,6 +735,7 @@ void GridMap::_update_octants_callback() { to_delete.pop_back(); } + _update_visibility(); awaiting_update = false; } diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h index 9e1d250680..eb1b215696 100644 --- a/modules/gridmap/grid_map.h +++ b/modules/gridmap/grid_map.h @@ -190,6 +190,7 @@ protected: void _get_property_list(List<PropertyInfo> *p_list) const; void _notification(int p_what); + void _update_visibility(); static void _bind_methods(); public: diff --git a/modules/nativescript/config.py b/modules/nativescript/config.py deleted file mode 100644 index 9f57b9bb74..0000000000 --- a/modules/nativescript/config.py +++ /dev/null @@ -1,8 +0,0 @@ - - -def can_build(platform): - return True - - -def configure(env): - env.use_ptrcall = True diff --git a/modules/openssl/SCsub b/modules/openssl/SCsub index add7d4dcfc..eb3c0e64d8 100644 --- a/modules/openssl/SCsub +++ b/modules/openssl/SCsub @@ -655,7 +655,7 @@ if (env['builtin_openssl'] != 'no'): env_openssl.add_source_files(env.modules_sources, thirdparty_sources) - # FIXME: Clone the environment to make a env_openssl and not pollute the modules env + # FIXME: Clone the environment to make env_openssl and not pollute the modules env thirdparty_include_paths = [ "", "crypto", diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 9989785c70..90ee164b6f 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -74,15 +74,11 @@ RES ResourceFormatPVR::load(const String &p_path, const String &p_original_path, uint32_t mipmaps = f->get_32(); uint32_t flags = f->get_32(); uint32_t surfsize = f->get_32(); - uint32_t bpp = f->get_32(); - uint32_t rmask = f->get_32(); - uint32_t gmask = f->get_32(); - uint32_t bmask = f->get_32(); - uint32_t amask = f->get_32(); + f->seek(f->get_pos() + 20); // bpp, rmask, gmask, bmask, amask uint8_t pvrid[5] = { 0, 0, 0, 0, 0 }; f->get_buffer(pvrid, 4); ERR_FAIL_COND_V(String((char *)pvrid) != "PVR!", RES()); - uint32_t surfcount = f->get_32(); + f->get_32(); // surfcount /* print_line("height: "+itos(height)); diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index 8afd01e20b..00e8ce0f54 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -309,7 +309,7 @@ Ref<RegExMatch> RegEx::search(const String &p_subject, int p_offset, int p_end) _pattern_info(PCRE2_INFO_NAMETABLE, &table); _pattern_info(PCRE2_INFO_NAMEENTRYSIZE, &entry_size); - for (int i = 0; i < count; i++) { + for (uint32_t i = 0; i < count; i++) { CharType id = table[i * entry_size]; if (result->data[id].start == -1) @@ -338,7 +338,7 @@ String RegEx::sub(const String &p_subject, const String &p_replacement, bool p_a PCRE2_SIZE olength = output.length(); PCRE2_SIZE length = p_subject.length(); - if (p_end >= 0 && p_end < length) + if (p_end >= 0 && (uint32_t)p_end < length) length = p_end; if (sizeof(CharType) == 2) { @@ -430,7 +430,7 @@ Array RegEx::get_names() const { _pattern_info(PCRE2_INFO_NAMETABLE, &table); _pattern_info(PCRE2_INFO_NAMEENTRYSIZE, &entry_size); - for (int i = 0; i < count; i++) { + for (uint32_t i = 0; i < count; i++) { String name = &table[i * entry_size + 1]; if (result.find(name) < 0) { diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index 29073a8499..072f18b990 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -91,7 +91,7 @@ void image_compress_squish(Image *p_image, Image::CompressSource p_source) { if (p_image->get_format() <= Image::FORMAT_RGBA8) { int squish_comp = squish::kColourRangeFit; - Image::Format target_format; + Image::Format target_format = Image::FORMAT_RGBA8; Image::DetectChannels dc = p_image->get_detected_channels(); @@ -140,6 +140,10 @@ void image_compress_squish(Image *p_image, Image::CompressSource p_source) { squish_comp |= squish::kDxt5; } break; + default: { + ERR_PRINT("Unknown image format, defaulting to RGBA8"); + break; + } } PoolVector<uint8_t> data; diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 49d959203c..9457fbfaf6 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -31,7 +31,10 @@ #include "os/file_access.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include "thirdparty/misc/stb_vorbis.c" +#pragma GCC diagnostic pop void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_frames) { @@ -42,6 +45,12 @@ void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fra while (todo && active) { int mixed = stb_vorbis_get_samples_float_interleaved(ogg_stream, 2, (float *)p_buffer, todo * 2); + if (vorbis_stream->channels == 1 && mixed > 0) { + //mix mono to stereo + for (int i = 0; i < mixed; i++) { + p_buffer[i].r = p_buffer[i].l; + } + } todo -= mixed; frames_mixed += mixed; @@ -112,8 +121,8 @@ float AudioStreamPlaybackOGGVorbis::get_length() const { AudioStreamPlaybackOGGVorbis::~AudioStreamPlaybackOGGVorbis() { if (ogg_alloc.alloc_buffer) { - AudioServer::get_singleton()->audio_data_free(ogg_alloc.alloc_buffer); stb_vorbis_close(ogg_stream); + AudioServer::get_singleton()->audio_data_free(ogg_alloc.alloc_buffer); } } diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.h b/modules/stb_vorbis/audio_stream_ogg_vorbis.h index a459e6f31d..bcd829a56a 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.h +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.h @@ -34,7 +34,10 @@ #include "servers/audio/audio_stream.h" #define STB_VORBIS_HEADER_ONLY +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include "thirdparty/misc/stb_vorbis.c" +#pragma GCC diagnostic pop #undef STB_VORBIS_HEADER_ONLY class AudioStreamOGGVorbis; diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp index 84332ee2ff..7c7cf5bcbe 100644 --- a/modules/tga/image_loader_tga.cpp +++ b/modules/tga/image_loader_tga.cpp @@ -53,19 +53,19 @@ Error ImageLoaderTGA::decode_tga_rle(const uint8_t *p_compressed_buffer, size_t count = (c & 0x7f) + 1; if (c & 0x80) { - for (int i = 0; i < p_pixel_size; i++) { + for (size_t i = 0; i < p_pixel_size; i++) { pixels_w.ptr()[i] = p_compressed_buffer[compressed_pos]; compressed_pos += 1; } - for (int i = 0; i < count; i++) { - for (int j = 0; j < p_pixel_size; j++) { + for (size_t i = 0; i < count; i++) { + for (size_t j = 0; j < p_pixel_size; j++) { p_uncompressed_buffer[output_pos + j] = pixels_w.ptr()[j]; } output_pos += p_pixel_size; } } else { count *= p_pixel_size; - for (int i = 0; i < count; i++) { + for (size_t i = 0; i < count; i++) { p_uncompressed_buffer[output_pos] = p_compressed_buffer[compressed_pos]; compressed_pos += 1; output_pos += 1; @@ -208,7 +208,7 @@ Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force PoolVector<uint8_t> src_image; int src_image_len = f->get_len(); ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); - ERR_FAIL_COND_V(src_image_len < sizeof(tga_header_s), ERR_FILE_CORRUPT); + ERR_FAIL_COND_V(src_image_len < (int)sizeof(tga_header_s), ERR_FILE_CORRUPT); src_image.resize(src_image_len); Error err = OK; diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index 2a24f8d4d1..02b994f8db 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -414,7 +414,8 @@ void VideoStreamPlaybackTheora::update(float p_delta) { bool buffer_full = false; /* if there's pending, decoded audio, grab it */ - if ((ret = vorbis_synthesis_pcmout(&vd, &pcm)) > 0) { + ret = vorbis_synthesis_pcmout(&vd, &pcm); + if (ret > 0) { const int AUXBUF_LEN = 4096; int to_read = ret; diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index b2e7a6aa27..297e9e510f 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -571,7 +571,6 @@ public: virtual bool has_named_classes() const; virtual int find_function(const String &p_function, const String &p_code) const; virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const; - virtual Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) { return ERR_UNAVAILABLE; } virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const; virtual void add_global_constant(const StringName &p_variable, const Variant &p_value); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 8386687c9f..dfec1eea60 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -506,7 +506,7 @@ void VisualScriptEditor::_update_graph(int p_only_id) { gnode->set_show_close_button(true); } - if (Object::cast_to<VisualScriptExpression>(*node)) { + if (Object::cast_to<VisualScriptExpression>(node.ptr())) { LineEdit *line_edit = memnew(LineEdit); line_edit->set_text(node->get_text()); @@ -520,10 +520,10 @@ void VisualScriptEditor::_update_graph(int p_only_id) { gnode->add_child(text); } - if (Object::cast_to<VisualScriptExpression>(*node)) { + if (Object::cast_to<VisualScriptComment>(node.ptr())) { Ref<VisualScriptComment> vsc = node; gnode->set_comment(true); - gnode->set_resizeable(true); + gnode->set_resizable(true); gnode->set_custom_minimum_size(vsc->get_size() * EDSCALE); gnode->connect("resize_request", this, "_comment_node_resized", varray(E->get())); } @@ -926,48 +926,6 @@ void VisualScriptEditor::_member_edited() { } } -void VisualScriptEditor::_override_pressed(int p_id) { - - //override a virtual function or method from base type - - ERR_FAIL_COND(!virtuals_in_menu.has(p_id)); - - VirtualInMenu vim = virtuals_in_menu[p_id]; - - String name = _validate_name(vim.name); - selected = name; - edited_func = selected; - Ref<VisualScriptFunction> func_node; - func_node.instance(); - func_node->set_name(vim.name); - - undo_redo->create_action(TTR("Add Function")); - undo_redo->add_do_method(script.ptr(), "add_function", name); - for (int i = 0; i < vim.args.size(); i++) { - func_node->add_argument(vim.args[i].first, vim.args[i].second); - } - - undo_redo->add_do_method(script.ptr(), "add_node", name, script->get_available_id(), func_node); - if (vim.ret != Variant::NIL || vim.ret_variant) { - Ref<VisualScriptReturn> ret_node; - ret_node.instance(); - ret_node->set_return_type(vim.ret); - ret_node->set_enable_return_value(true); - ret_node->set_name(vim.name); - undo_redo->add_do_method(script.ptr(), "add_node", name, script->get_available_id() + 1, ret_node, Vector2(500, 0)); - } - - undo_redo->add_undo_method(script.ptr(), "remove_function", name); - undo_redo->add_do_method(this, "_update_members"); - undo_redo->add_undo_method(this, "_update_members"); - undo_redo->add_do_method(this, "_update_graph"); - undo_redo->add_undo_method(this, "_update_graph"); - - undo_redo->commit_action(); - - _update_graph(); -} - void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_button) { TreeItem *ti = Object::cast_to<TreeItem>(p_item); @@ -980,64 +938,9 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt //add function, this one uses menu if (p_button == 1) { - new_function_menu->clear(); - new_function_menu->set_size(Size2(0, 0)); - int idx = 0; - - virtuals_in_menu.clear(); - - List<MethodInfo> mi; - ClassDB::get_method_list(script->get_instance_base_type(), &mi); - for (List<MethodInfo>::Element *E = mi.front(); E; E = E->next()) { - MethodInfo mi = E->get(); - if (mi.flags & METHOD_FLAG_VIRTUAL) { - - VirtualInMenu vim; - vim.name = mi.name; - vim.ret = mi.return_val.type; - if (mi.return_val.name != String()) - vim.ret_variant = true; - else - vim.ret_variant = false; - - String desc; - - if (mi.return_val.type == Variant::NIL) - desc = "var"; - else - desc = Variant::get_type_name(mi.return_val.type); - desc += " " + mi.name + " ( "; - - for (int i = 0; i < mi.arguments.size(); i++) { - - if (i > 0) - desc += ", "; - - if (mi.arguments[i].type == Variant::NIL) - desc += "var "; - else - desc += Variant::get_type_name(mi.arguments[i].type) + " "; - - desc += mi.arguments[i].name; - - Pair<Variant::Type, String> p; - p.first = mi.arguments[i].type; - p.second = mi.arguments[i].name; - vim.args.push_back(p); - } - desc += " )"; + new_virtual_method_select->select_method_from_base_type(script->get_instance_base_type(), String(), true); - virtuals_in_menu[idx] = vim; - - new_function_menu->add_item(desc, idx); - idx++; - } - } - - Rect2 pos = members->get_item_rect(ti); - new_function_menu->set_position(members->get_global_position() + pos.position + Vector2(0, pos.size.y)); - new_function_menu->popup(); return; } else if (p_button == 0) { @@ -2686,21 +2589,21 @@ void VisualScriptEditor::_selected_connect_node_method_or_setget(const String &p Ref<VisualScriptNode> vsn = script->get_node(edited_func, port_action_new_node); - if (Object::cast_to<VisualScriptFunctionCall>(*vsn)) { + if (Object::cast_to<VisualScriptFunctionCall>(vsn.ptr())) { Ref<VisualScriptFunctionCall> vsfc = vsn; vsfc->set_function(p_text); script->data_connect(edited_func, port_action_node, port_action_output, port_action_new_node, 0); } - if (Object::cast_to<VisualScriptPropertySet>(*vsn)) { + if (Object::cast_to<VisualScriptPropertySet>(vsn.ptr())) { Ref<VisualScriptPropertySet> vsp = vsn; vsp->set_property(p_text); script->data_connect(edited_func, port_action_node, port_action_output, port_action_new_node, 0); } - if (Object::cast_to<VisualScriptPropertyGet>(*vsn)) { + if (Object::cast_to<VisualScriptPropertyGet>(vsn.ptr())) { Ref<VisualScriptPropertyGet> vsp = vsn; vsp->set_property(p_text); @@ -2711,6 +2614,63 @@ void VisualScriptEditor::_selected_connect_node_method_or_setget(const String &p _update_graph_connections(); } +void VisualScriptEditor::_selected_new_virtual_method(const String &p_text) { + + String name = p_text; + if (script->has_function(name)) { + EditorNode::get_singleton()->show_warning(vformat(TTR("Script already has function '%s'"), name)); + return; + } + + MethodInfo minfo; + { + List<MethodInfo> methods; + bool found = false; + ClassDB::get_virtual_methods(script->get_instance_base_type(), &methods); + for (List<MethodInfo>::Element *E = methods.front(); E; E = E->next()) { + if (E->get().name == name) { + minfo = E->get(); + found = true; + } + } + + ERR_FAIL_COND(!found); + } + + selected = name; + edited_func = selected; + Ref<VisualScriptFunction> func_node; + func_node.instance(); + func_node->set_name(name); + + undo_redo->create_action(TTR("Add Function")); + undo_redo->add_do_method(script.ptr(), "add_function", name); + + for (int i = 0; i < minfo.arguments.size(); i++) { + func_node->add_argument(minfo.arguments[i].type, minfo.arguments[i].name); + } + + undo_redo->add_do_method(script.ptr(), "add_node", name, script->get_available_id(), func_node); + if (minfo.return_val.type != Variant::NIL || minfo.return_val.usage & PROPERTY_USAGE_NIL_IS_VARIANT) { + Ref<VisualScriptReturn> ret_node; + ret_node.instance(); + ret_node->set_return_type(minfo.return_val.type); + ret_node->set_enable_return_value(true); + ret_node->set_name(name); + undo_redo->add_do_method(script.ptr(), "add_node", name, script->get_available_id() + 1, ret_node, Vector2(500, 0)); + } + + undo_redo->add_undo_method(script.ptr(), "remove_function", name); + undo_redo->add_do_method(this, "_update_members"); + undo_redo->add_undo_method(this, "_update_members"); + undo_redo->add_do_method(this, "_update_graph"); + undo_redo->add_undo_method(this, "_update_graph"); + + undo_redo->commit_action(); + + _update_graph(); +} + void VisualScriptEditor::_cancel_connect_node_method_or_setget() { script->remove_node(edited_func, port_action_new_node); @@ -3147,7 +3107,6 @@ void VisualScriptEditor::_bind_methods() { ClassDB::bind_method("_update_members", &VisualScriptEditor::_update_members); ClassDB::bind_method("_change_base_type", &VisualScriptEditor::_change_base_type); ClassDB::bind_method("_change_base_type_callback", &VisualScriptEditor::_change_base_type_callback); - ClassDB::bind_method("_override_pressed", &VisualScriptEditor::_override_pressed); ClassDB::bind_method("_node_selected", &VisualScriptEditor::_node_selected); ClassDB::bind_method("_node_moved", &VisualScriptEditor::_node_moved); ClassDB::bind_method("_move_node", &VisualScriptEditor::_move_node); @@ -3166,6 +3125,8 @@ void VisualScriptEditor::_bind_methods() { ClassDB::bind_method("_button_resource_previewed", &VisualScriptEditor::_button_resource_previewed); ClassDB::bind_method("_port_action_menu", &VisualScriptEditor::_port_action_menu); ClassDB::bind_method("_selected_connect_node_method_or_setget", &VisualScriptEditor::_selected_connect_node_method_or_setget); + ClassDB::bind_method("_selected_new_virtual_method", &VisualScriptEditor::_selected_new_virtual_method); + ClassDB::bind_method("_cancel_connect_node_method_or_setget", &VisualScriptEditor::_cancel_connect_node_method_or_setget); ClassDB::bind_method("_expression_text_changed", &VisualScriptEditor::_expression_text_changed); @@ -3344,9 +3305,6 @@ VisualScriptEditor::VisualScriptEditor() { undo_redo = EditorNode::get_singleton()->get_undo_redo(); - new_function_menu = memnew(PopupMenu); - new_function_menu->connect("id_pressed", this, "_override_pressed"); - add_child(new_function_menu); updating_members = false; set_process_input(true); //for revert on drag @@ -3366,6 +3324,11 @@ VisualScriptEditor::VisualScriptEditor() { new_connect_node_select->connect("selected", this, "_selected_connect_node_method_or_setget"); new_connect_node_select->get_cancel()->connect("pressed", this, "_cancel_connect_node_method_or_setget"); + new_virtual_method_select = memnew(PropertySelector); + add_child(new_virtual_method_select); + new_virtual_method_select->connect("selected", this, "_selected_new_virtual_method"); + new_virtual_method_select->get_cancel()->connect("pressed", this, "_selected_new_virtual_method"); + port_action_popup = memnew(PopupMenu); add_child(port_action_popup); port_action_popup->connect("id_pressed", this, "_port_action_menu"); diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index dd051ef8e4..5b8c3ea74e 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -103,6 +103,7 @@ class VisualScriptEditor : public ScriptEditorBase { PropertySelector *method_select; PropertySelector *new_connect_node_select; + PropertySelector *new_virtual_method_select; VisualScriptEditorVariableEdit *variable_editor; @@ -135,10 +136,6 @@ class VisualScriptEditor : public ScriptEditorBase { Vector<Pair<Variant::Type, String> > args; }; - Map<int, VirtualInMenu> virtuals_in_menu; - - PopupMenu *new_function_menu; - StringName edited_func; void _update_graph_connections(); @@ -177,6 +174,7 @@ class VisualScriptEditor : public ScriptEditorBase { void _port_action_menu(int p_option); void _selected_connect_node_method_or_setget(const String &p_text); void _cancel_connect_node_method_or_setget(); + void _selected_new_virtual_method(const String &p_text); int error_line; @@ -188,7 +186,6 @@ class VisualScriptEditor : public ScriptEditorBase { void _change_base_type(); void _member_selected(); void _member_edited(); - void _override_pressed(int p_id); void _begin_node_move(); void _end_node_move(); diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 6bd052fe26..eae866d167 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -831,7 +831,6 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { case TK_BUILTIN_FUNC: { //builtin function - Variant::Type bt = Variant::Type(int(tk.value)); _get_token(tk); if (tk.type != TK_PARENTHESIS_OPEN) { _set_error("Expected '('"); @@ -1179,7 +1178,7 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { if (expression[next_op + 1].is_op) { // this is not invalid and can really appear // but it becomes invalid anyway because no binary op - // can be followed by an unary op in a valid combination, + // can be followed by a unary op in a valid combination, // due to how precedence works, unaries will always disappear first _set_error("Unexpected two consecutive operators."); diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 1decc004ab..093f01c49f 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -1493,7 +1493,7 @@ void VisualScriptGlobalConstant::_bind_methods() { cc += ","; cc += GlobalConstants::get_global_constant_name(i); } - ADD_PROPERTY(PropertyInfo(Variant::INT, "constant/constant", PROPERTY_HINT_ENUM, cc), "set_global_constant", "get_global_constant"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "constant", PROPERTY_HINT_ENUM, cc), "set_global_constant", "get_global_constant"); } VisualScriptGlobalConstant::VisualScriptGlobalConstant() { @@ -1622,7 +1622,7 @@ void VisualScriptClassConstant::_bind_methods() { ClassDB::bind_method(D_METHOD("get_base_type"), &VisualScriptClassConstant::get_base_type); ADD_PROPERTY(PropertyInfo(Variant::STRING, "base_type", PROPERTY_HINT_TYPE_STRING, "Object"), "set_base_type", "get_base_type"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant/constant", PROPERTY_HINT_ENUM, ""), "set_class_constant", "get_class_constant"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant", PROPERTY_HINT_ENUM, ""), "set_class_constant", "get_class_constant"); } VisualScriptClassConstant::VisualScriptClassConstant() { @@ -1760,7 +1760,7 @@ void VisualScriptBasicTypeConstant::_bind_methods() { } ADD_PROPERTY(PropertyInfo(Variant::INT, "basic_type", PROPERTY_HINT_ENUM, argt), "set_basic_type", "get_basic_type"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant/constant", PROPERTY_HINT_ENUM, ""), "set_basic_type_constant", "get_basic_type_constant"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant", PROPERTY_HINT_ENUM, ""), "set_basic_type_constant", "get_basic_type_constant"); } VisualScriptBasicTypeConstant::VisualScriptBasicTypeConstant() { @@ -1881,7 +1881,7 @@ void VisualScriptMathConstant::_bind_methods() { cc += ","; cc += const_name[i]; } - ADD_PROPERTY(PropertyInfo(Variant::INT, "constant/constant", PROPERTY_HINT_ENUM, cc), "set_math_constant", "get_math_constant"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "constant", PROPERTY_HINT_ENUM, cc), "set_math_constant", "get_math_constant"); } VisualScriptMathConstant::VisualScriptMathConstant() { @@ -2002,7 +2002,7 @@ void VisualScriptEngineSingleton::_bind_methods() { cc += E->get().name; } - ADD_PROPERTY(PropertyInfo(Variant::STRING, "constant/constant", PROPERTY_HINT_ENUM, cc), "set_singleton", "get_singleton"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "/constant", PROPERTY_HINT_ENUM, cc), "set_singleton", "get_singleton"); } VisualScriptEngineSingleton::VisualScriptEngineSingleton() { @@ -3727,11 +3727,11 @@ void register_visual_script_nodes() { VisualScriptLanguage::singleton->add_register_func("data/preload", create_node_generic<VisualScriptPreload>); VisualScriptLanguage::singleton->add_register_func("data/action", create_node_generic<VisualScriptInputAction>); - VisualScriptLanguage::singleton->add_register_func("constant/constants/constant", create_node_generic<VisualScriptConstant>); - VisualScriptLanguage::singleton->add_register_func("constant/constants/math_constant", create_node_generic<VisualScriptMathConstant>); - VisualScriptLanguage::singleton->add_register_func("constant/constants/class_constant", create_node_generic<VisualScriptClassConstant>); - VisualScriptLanguage::singleton->add_register_func("constant/constants/global_constant", create_node_generic<VisualScriptGlobalConstant>); - VisualScriptLanguage::singleton->add_register_func("constant/constants/basic_type_constant", create_node_generic<VisualScriptBasicTypeConstant>); + VisualScriptLanguage::singleton->add_register_func("constants/constant", create_node_generic<VisualScriptConstant>); + VisualScriptLanguage::singleton->add_register_func("constants/math_constant", create_node_generic<VisualScriptMathConstant>); + VisualScriptLanguage::singleton->add_register_func("constants/class_constant", create_node_generic<VisualScriptClassConstant>); + VisualScriptLanguage::singleton->add_register_func("constants/global_constant", create_node_generic<VisualScriptGlobalConstant>); + VisualScriptLanguage::singleton->add_register_func("constants/basic_type_constant", create_node_generic<VisualScriptBasicTypeConstant>); VisualScriptLanguage::singleton->add_register_func("custom/custom_node", create_node_generic<VisualScriptCustomNode>); VisualScriptLanguage::singleton->add_register_func("custom/sub_call", create_node_generic<VisualScriptSubCall>); diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 4b8e17421b..b6d4021ca3 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -516,7 +516,7 @@ public: } else { //yield - Object *object; + Object *object = NULL; switch (call_mode) { diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 3c5c0fda23..e3615e2298 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -520,34 +520,30 @@ class EditorExportAndroid : public EditorExportPlatform { void _fix_manifest(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &p_manifest, bool p_give_internet) { - const int CHUNK_AXML_FILE = 0x00080003; - const int CHUNK_RESOURCEIDS = 0x00080180; + // Leaving the unused types commented because looking these constants up + // again later would be annoying + // const int CHUNK_AXML_FILE = 0x00080003; + // const int CHUNK_RESOURCEIDS = 0x00080180; const int CHUNK_STRINGS = 0x001C0001; - const int CHUNK_XML_END_NAMESPACE = 0x00100101; - const int CHUNK_XML_END_TAG = 0x00100103; - const int CHUNK_XML_START_NAMESPACE = 0x00100100; + // const int CHUNK_XML_END_NAMESPACE = 0x00100101; + // const int CHUNK_XML_END_TAG = 0x00100103; + // const int CHUNK_XML_START_NAMESPACE = 0x00100100; const int CHUNK_XML_START_TAG = 0x00100102; - const int CHUNK_XML_TEXT = 0x00100104; + // const int CHUNK_XML_TEXT = 0x00100104; const int UTF8_FLAG = 0x00000100; Vector<String> string_table; - uint32_t ofs = 0; + uint32_t ofs = 8; - uint32_t header = decode_uint32(&p_manifest[ofs]); - uint32_t filesize = decode_uint32(&p_manifest[ofs + 4]); - ofs += 8; + uint32_t string_count = 0; + uint32_t styles_count = 0; + uint32_t string_flags = 0; + uint32_t string_data_offset = 0; - //print_line("FILESIZE: "+itos(filesize)+" ACTUAL: "+itos(p_manifest.size())); - - uint32_t string_count; - uint32_t styles_count; - uint32_t string_flags; - uint32_t string_data_offset; - - uint32_t styles_offset; - uint32_t string_table_begins; - uint32_t string_table_ends; + uint32_t styles_offset = 0; + uint32_t string_table_begins = 0; + uint32_t string_table_ends = 0; Vector<uint8_t> stable_extra; String version_name = p_preset->get("version/name"); @@ -646,24 +642,16 @@ class EditorExportAndroid : public EditorExportPlatform { case CHUNK_XML_START_TAG: { int iofs = ofs + 8; - uint32_t line = decode_uint32(&p_manifest[iofs]); - uint32_t nspace = decode_uint32(&p_manifest[iofs + 8]); uint32_t name = decode_uint32(&p_manifest[iofs + 12]); - uint32_t check = decode_uint32(&p_manifest[iofs + 16]); String tname = string_table[name]; - - //printf("NSPACE: %i\n",nspace); - //printf("NAME: %i (%s)\n",name,tname.utf8().get_data()); - //printf("CHECK: %x\n",check); uint32_t attrcount = decode_uint32(&p_manifest[iofs + 20]); iofs += 28; - //printf("ATTRCOUNT: %x\n",attrcount); + for (uint32_t i = 0; i < attrcount; i++) { uint32_t attr_nspace = decode_uint32(&p_manifest[iofs]); uint32_t attr_name = decode_uint32(&p_manifest[iofs + 4]); uint32_t attr_value = decode_uint32(&p_manifest[iofs + 8]); - uint32_t attr_flags = decode_uint32(&p_manifest[iofs + 12]); uint32_t attr_resid = decode_uint32(&p_manifest[iofs + 16]); String value; @@ -678,12 +666,6 @@ class EditorExportAndroid : public EditorExportPlatform { else nspace = ""; - //printf("ATTR %i NSPACE: %i\n",i,attr_nspace); - //printf("ATTR %i NAME: %i (%s)\n",i,attr_name,attrname.utf8().get_data()); - //printf("ATTR %i VALUE: %i (%s)\n",i,attr_value,value.utf8().get_data()); - //printf("ATTR %i FLAGS: %x\n",i,attr_flags); - //printf("ATTR %i RESID: %x\n",i,attr_resid); - //replace project information if (tname == "manifest" && attrname == "package") { @@ -691,9 +673,6 @@ class EditorExportAndroid : public EditorExportPlatform { string_table[attr_value] = get_package_name(package_name); } - //print_line("tname: "+tname); - //print_line("nspace: "+nspace); - //print_line("attrname: "+attrname); if (tname == "manifest" && /*nspace=="android" &&*/ attrname == "versionCode") { print_line("FOUND versionCode"); @@ -712,13 +691,6 @@ class EditorExportAndroid : public EditorExportPlatform { if (tname == "activity" && /*nspace=="android" &&*/ attrname == "screenOrientation") { encode_uint32(orientation == 0 ? 0 : 1, &p_manifest[iofs + 16]); - /* - print_line("FOUND screen orientation"); - if (attr_value==0xFFFFFFFF) { - WARN_PRINT("Version name in a resource, should be plaintext") - } else { - string_table[attr_value]=(orientation==0?"landscape":"portrait"); - }*/ } if (tname == "uses-feature" && /*nspace=="android" &&*/ attrname == "glEsVersion") { @@ -771,13 +743,10 @@ class EditorExportAndroid : public EditorExportPlatform { } break; } - //printf("chunk %x: size: %d\n",chunk,size); ofs += size; } - //printf("end\n"); - //create new andriodmanifest binary Vector<uint8_t> ret; @@ -876,8 +845,6 @@ class EditorExportAndroid : public EditorExportPlatform { const int UTF8_FLAG = 0x00000100; print_line("*******************GORRRGLE***********************"); - uint32_t header = decode_uint32(&p_manifest[0]); - uint32_t filesize = decode_uint32(&p_manifest[4]); uint32_t string_block_len = decode_uint32(&p_manifest[16]); uint32_t string_count = decode_uint32(&p_manifest[20]); uint32_t string_flags = decode_uint32(&p_manifest[28]); @@ -887,10 +854,6 @@ class EditorExportAndroid : public EditorExportPlatform { String package_name = p_preset->get("package/name"); - //printf("stirng block len: %i\n",string_block_len); - //printf("stirng count: %i\n",string_count); - //printf("flags: %x\n",string_flags); - for (uint32_t i = 0; i < string_count; i++) { uint32_t offset = decode_uint32(&p_manifest[string_table_begins + i * 4]); diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub index b804863ee1..e282041745 100644 --- a/platform/javascript/SCsub +++ b/platform/javascript/SCsub @@ -20,33 +20,32 @@ for x in javascript_files: javascript_objects.append(env_javascript.Object(x)) env.Append(LINKFLAGS=["-s", "EXPORTED_FUNCTIONS=\"['_main','_audio_server_mix_function','_main_after_fs_sync','_send_notification']\""]) -env.Append(LINKFLAGS=["--shell-file", '"platform/javascript/godot_shell.html"']) # output file name without file extension basename = "godot" + env["PROGSUFFIX"] target_dir = env.Dir("#bin") -js_file = target_dir.File(basename + ".js") -implicit_targets = [js_file] zip_dir = target_dir.Dir('.javascript_zip') -zip_files = env.InstallAs([zip_dir.File("godot.js"), zip_dir.File("godotfs.js")], [js_file, "#misc/dist/html_fs/godotfs.js"]) +zip_files = env.InstallAs(zip_dir.File('godot.html'), '#misc/dist/html/default.html') +implicit_targets = [] if env['wasm'] == 'yes': - wasm_file = target_dir.File(basename+'.wasm') - implicit_targets.append(wasm_file) - zip_files.append(InstallAs(zip_dir.File('godot.wasm'), wasm_file)) + wasm = target_dir.File(basename + '.wasm') + implicit_targets.append(wasm) + zip_files.append(InstallAs(zip_dir.File('godot.wasm'), wasm)) + prejs = env.File('pre_wasm.js') else: - asmjs_files = [target_dir.File(basename+'.asm.js'), target_dir.File(basename+'.html.mem')] - zip_files.append(InstallAs([zip_dir.File('godot.asm.js'), zip_dir.File('godot.mem')], asmjs_files)) + asmjs_files = [target_dir.File(basename + '.asm.js'), target_dir.File(basename + '.js.mem')] implicit_targets.extend(asmjs_files) + zip_files.append(InstallAs([zip_dir.File('godot.asm.js'), zip_dir.File('godot.mem')], asmjs_files)) + prejs = env.File('pre_asmjs.js') -# HTML file must be the first target in the list -html_file = env.Program(["#bin/godot"] + implicit_targets, javascript_objects, PROGSUFFIX=env["PROGSUFFIX"]+".html")[0] -Depends(html_file, "godot_shell.html") +js = env.Program(['#bin/godot'] + implicit_targets, javascript_objects, PROGSUFFIX=env['PROGSUFFIX'] + '.js')[0]; +zip_files.append(InstallAs(zip_dir.File('godot.js'), js)) -# Emscripten hardcodes file names, so replace common base name with -# placeholder while leaving extension; also change `.html.mem` to just `.mem` -fixup_html = env.Substfile(html_file, SUBST_DICT=[(basename, '$$GODOT_BASE'), ('.html.mem', '.mem')], SUBSTFILESUFFIX='.fixup.html') +postjs = env.File('engine.js') +env.Depends(js, [prejs, postjs]) +env.Append(LINKFLAGS=['--pre-js', prejs.path]) +env.Append(LINKFLAGS=['--post-js', postjs.path]) -zip_files.append(InstallAs(zip_dir.File('godot.html'), fixup_html)) -Zip('#bin/godot', zip_files, ZIPSUFFIX=env['PROGSUFFIX']+env['ZIPSUFFIX'], ZIPROOT=zip_dir, ZIPCOMSTR="Archving $SOURCES as $TARGET") +Zip('#bin/godot', zip_files, ZIPSUFFIX=env['PROGSUFFIX'] + env['ZIPSUFFIX'], ZIPROOT=zip_dir, ZIPCOMSTR="Archving $SOURCES as $TARGET") diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 5f066f1b15..bea8f156af 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -100,6 +100,7 @@ def configure(env): ## Link flags + env.Append(LINKFLAGS=['-s', 'EXTRA_EXPORTED_RUNTIME_METHODS="[\'FS\']"']) env.Append(LINKFLAGS=['-s', 'USE_WEBGL2=1']) if (env['wasm'] == 'yes'): @@ -112,6 +113,7 @@ def configure(env): else: env.Append(LINKFLAGS=['-s', 'ASM_JS=1']) env.Append(LINKFLAGS=['--separate-asm']) + env.Append(LINKFLAGS=['--memory-init-file', '1']) # TODO: Move that to opus module's config if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js new file mode 100644 index 0000000000..552f5a7e02 --- /dev/null +++ b/platform/javascript/engine.js @@ -0,0 +1,366 @@ + return Module; + }, +}; + +(function() { + var engine = Engine; + + var USING_WASM = engine.USING_WASM; + var DOWNLOAD_ATTEMPTS_MAX = 4; + + var basePath = null; + var engineLoadPromise = null; + + var loadingFiles = {}; + + function getBasePath(path) { + + if (path.endsWith('/')) + path = path.slice(0, -1); + if (path.lastIndexOf('.') > path.lastIndexOf('/')) + path = path.slice(0, path.lastIndexOf('.')); + return path; + } + + function getBaseName(path) { + + path = getBasePath(path); + return path.slice(path.lastIndexOf('/') + 1); + } + + Engine = function Engine() { + + this.rtenv = null; + + var gameInitPromise = null; + var unloadAfterInit = true; + var memorySize = 268435456; + + var progressFunc = null; + var pckProgressTracker = {}; + var lastProgress = { loaded: 0, total: 0 }; + + var canvas = null; + var stdout = null; + var stderr = null; + + this.initGame = function(mainPack) { + + if (!gameInitPromise) { + + if (mainPack === undefined) { + if (basePath !== null) { + mainPack = basePath + '.pck'; + } else { + return Promise.reject(new Error("No main pack to load specified")); + } + } + if (basePath === null) + basePath = getBasePath(mainPack); + + gameInitPromise = Engine.initEngine().then( + instantiate.bind(this) + ); + var gameLoadPromise = loadPromise(mainPack, pckProgressTracker).then(function(xhr) { return xhr.response; }); + gameInitPromise = Promise.all([gameLoadPromise, gameInitPromise]).then(function(values) { + // resolve with pck + return new Uint8Array(values[0]); + }); + if (unloadAfterInit) + gameInitPromise.then(Engine.unloadEngine); + requestAnimationFrame(animateProgress); + } + return gameInitPromise; + }; + + function instantiate(initializer) { + + var rtenvOpts = { + noInitialRun: true, + thisProgram: getBaseName(basePath), + engine: this, + }; + if (typeof stdout === 'function') + rtenvOpts.print = stdout; + if (typeof stderr === 'function') + rtenvOpts.printErr = stderr; + if (typeof WebAssembly === 'object' && initializer instanceof WebAssembly.Module) { + rtenvOpts.instantiateWasm = function(imports, onSuccess) { + WebAssembly.instantiate(initializer, imports).then(function(result) { + onSuccess(result); + }); + return {}; + }; + } else if (initializer.asm && initializer.mem) { + rtenvOpts.asm = initializer.asm; + rtenvOpts.memoryInitializerRequest = initializer.mem; + rtenvOpts.TOTAL_MEMORY = memorySize; + } else { + throw new Error("Invalid initializer"); + } + + return new Promise(function(resolve, reject) { + rtenvOpts.onRuntimeInitialized = resolve; + rtenvOpts.onAbort = reject; + rtenvOpts.engine.rtenv = Engine.RuntimeEnvironment(rtenvOpts); + }); + } + + this.start = function(mainPack) { + + return this.initGame(mainPack).then(synchronousStart.bind(this)); + }; + + function synchronousStart(pckView) { + // TODO don't expect canvas when runninng as cli tool + if (canvas instanceof HTMLCanvasElement) { + this.rtenv.canvas = canvas; + } else { + var firstCanvas = document.getElementsByTagName('canvas')[0]; + if (firstCanvas instanceof HTMLCanvasElement) { + this.rtenv.canvas = firstCanvas; + } else { + throw new Error("No canvas found"); + } + } + + var actualCanvas = this.rtenv.canvas; + var context = false; + try { + context = actualCanvas.getContext('webgl2') || actualCanvas.getContext('experimental-webgl2'); + } catch (e) {} + if (!context) { + throw new Error("WebGL 2 not available"); + } + + // canvas can grab focus on click + if (actualCanvas.tabIndex < 0) { + actualCanvas.tabIndex = 0; + } + // necessary to calculate cursor coordinates correctly + actualCanvas.style.padding = 0; + actualCanvas.style.borderWidth = 0; + actualCanvas.style.borderStyle = 'none'; + // until context restoration is implemented + actualCanvas.addEventListener('webglcontextlost', function(ev) { + alert("WebGL context lost, please reload the page"); + ev.preventDefault(); + }, false); + + this.rtenv.FS.createDataFile('/', this.rtenv.thisProgram + '.pck', pckView, true, true, true); + gameInitPromise = null; + this.rtenv.callMain(); + } + + this.setProgressFunc = function(func) { + progressFunc = func; + }; + + function animateProgress() { + + var loaded = 0; + var total = 0; + var totalIsValid = true; + var progressIsFinal = true; + + [loadingFiles, pckProgressTracker].forEach(function(tracker) { + Object.keys(tracker).forEach(function(file) { + if (!tracker[file].final) + progressIsFinal = false; + if (!totalIsValid || tracker[file].total === 0) { + totalIsValid = false; + total = 0; + } else { + total += tracker[file].total; + } + loaded += tracker[file].loaded; + }); + }); + if (loaded !== lastProgress.loaded || total !== lastProgress.total) { + lastProgress.loaded = loaded; + lastProgress.total = total; + if (typeof progressFunc === 'function') + progressFunc(loaded, total); + } + if (!progressIsFinal) + requestAnimationFrame(animateProgress); + } + + this.setCanvas = function(elem) { + canvas = elem; + }; + + this.setAsmjsMemorySize = function(size) { + memorySize = size; + }; + + this.setUnloadAfterInit = function(enabled) { + + if (enabled && !unloadAfterInit && gameInitPromise) { + gameInitPromise.then(Engine.unloadEngine); + } + unloadAfterInit = enabled; + }; + + this.setStdoutFunc = function(func) { + + var print = function(text) { + if (arguments.length > 1) { + text = Array.prototype.slice.call(arguments).join(" "); + } + func(text); + }; + if (this.rtenv) + this.rtenv.print = print; + stdout = print; + }; + + this.setStderrFunc = function(func) { + + var printErr = function(text) { + if (arguments.length > 1) + text = Array.prototype.slice.call(arguments).join(" "); + func(text); + }; + if (this.rtenv) + this.rtenv.printErr = printErr; + stderr = printErr; + }; + + + }; // Engine() + + Engine.RuntimeEnvironment = engine.RuntimeEnvironment; + + Engine.initEngine = function(newBasePath) { + + if (newBasePath !== undefined) basePath = getBasePath(newBasePath); + if (engineLoadPromise === null) { + if (USING_WASM) { + if (typeof WebAssembly !== 'object') + return Promise.reject(new Error("Browser doesn't support WebAssembly")); + // TODO cache/retrieve module to/from idb + engineLoadPromise = loadPromise(basePath + '.wasm').then(function(xhr) { + return WebAssembly.compile(xhr.response); + }); + } else { + var asmjsPromise = loadPromise(basePath + '.asm.js').then(function(xhr) { + return asmjsModulePromise(xhr.response); + }); + var memPromise = loadPromise(basePath + '.mem'); + engineLoadPromise = Promise.all([asmjsPromise, memPromise]).then(function(values) { + return { asm: values[0], mem: values[1] }; + }); + } + engineLoadPromise = engineLoadPromise.catch(function(err) { + engineLoadPromise = null; + throw err; + }); + } + return engineLoadPromise; + }; + + function asmjsModulePromise(module) { + var elem = document.createElement('script'); + var script = new Blob([ + 'Engine.asm = (function() { var Module = {};', + module, + 'return Module.asm; })();' + ]); + var url = URL.createObjectURL(script); + elem.src = url; + return new Promise(function(resolve, reject) { + elem.addEventListener('load', function() { + URL.revokeObjectURL(url); + var asm = Engine.asm; + Engine.asm = undefined; + setTimeout(function() { + // delay to reclaim compilation memory + resolve(asm); + }, 1); + }); + elem.addEventListener('error', function() { + URL.revokeObjectURL(url); + reject("asm.js faiilure"); + }); + document.body.appendChild(elem); + }); + } + + Engine.unloadEngine = function() { + engineLoadPromise = null; + }; + + function loadPromise(file, tracker) { + if (tracker === undefined) + tracker = loadingFiles; + return new Promise(function(resolve, reject) { + loadXHR(resolve, reject, file, tracker); + }); + } + + function loadXHR(resolve, reject, file, tracker) { + + var xhr = new XMLHttpRequest; + xhr.open('GET', file); + if (!file.endsWith('.js')) { + xhr.responseType = 'arraybuffer'; + } + ['loadstart', 'progress', 'load', 'error', 'timeout', 'abort'].forEach(function(ev) { + xhr.addEventListener(ev, onXHREvent.bind(xhr, resolve, reject, file, tracker)); + }); + xhr.send(); + } + + function onXHREvent(resolve, reject, file, tracker, ev) { + + if (this.status >= 400) { + + if (this.status < 500 || ++tracker[file].attempts >= DOWNLOAD_ATTEMPTS_MAX) { + reject(new Error("Failed loading file '" + file + "': " + this.statusText)); + this.abort(); + return; + } else { + loadXHR(resolve, reject, file); + } + } + + switch (ev.type) { + case 'loadstart': + if (tracker[file] === undefined) { + tracker[file] = { + total: ev.total, + loaded: ev.loaded, + attempts: 0, + final: false, + }; + } + break; + + case 'progress': + tracker[file].loaded = ev.loaded; + tracker[file].total = ev.total; + break; + + case 'load': + tracker[file].final = true; + resolve(this); + break; + + case 'error': + case 'timeout': + if (++tracker[file].attempts >= DOWNLOAD_ATTEMPTS_MAX) { + tracker[file].final = true; + reject(new Error("Failed loading file '" + file + "'")); + } else { + loadXHR(resolve, reject, file); + } + break; + + case 'abort': + tracker[file].final = true; + reject(new Error("Loading file '" + file + "' was aborted.")); + break; + } + } +})(); diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 5a161dd0ab..4a97bf4c32 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -100,8 +100,8 @@ void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t> &p_html, const Re for (int i = 0; i < lines.size(); i++) { String current_line = lines[i]; - current_line = current_line.replace("$GODOT_TMEM", itos(memory_mb * 1024 * 1024)); - current_line = current_line.replace("$GODOT_BASE", p_name); + current_line = current_line.replace("$GODOT_TOTAL_MEMORY", itos(memory_mb * 1024 * 1024)); + current_line = current_line.replace("$GODOT_BASENAME", p_name); current_line = current_line.replace("$GODOT_HEAD_INCLUDE", p_preset->get("html/head_include")); current_line = current_line.replace("$GODOT_DEBUG_ENABLED", p_debug ? "true" : "false"); str_export += current_line + "\n"; @@ -114,28 +114,6 @@ void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t> &p_html, const Re } } -void EditorExportPlatformJavaScript::_fix_fsloader_js(Vector<uint8_t> &p_js, const String &p_pack_name, uint64_t p_pack_size) { - - String str_template = String::utf8(reinterpret_cast<const char *>(p_js.ptr()), p_js.size()); - String str_export; - Vector<String> lines = str_template.split("\n"); - for (int i = 0; i < lines.size(); i++) { - if (lines[i].find("$GODOT_PACK_NAME") != -1) { - str_export += lines[i].replace("$GODOT_PACK_NAME", p_pack_name); - } else if (lines[i].find("$GODOT_PACK_SIZE") != -1) { - str_export += lines[i].replace("$GODOT_PACK_SIZE", itos(p_pack_size)); - } else { - str_export += lines[i] + "\n"; - } - } - - CharString cs = str_export.utf8(); - p_js.resize(cs.length()); - for (int i = 0; i < cs.length(); i++) { - p_js[i] = cs[i]; - } -} - void EditorExportPlatformJavaScript::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) { if (p_preset->get("texture_format/s3tc")) { @@ -286,10 +264,6 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese _fix_html(data, p_preset, p_path.get_file().get_basename(), p_debug); file = p_path.get_file(); - } else if (file == "godotfs.js") { - - _fix_fsloader_js(data, pck_path.get_file(), pack_size); - file = p_path.get_file().get_basename() + "fs.js"; } else if (file == "godot.js") { file = p_path.get_file().get_basename() + ".js"; diff --git a/platform/javascript/godot_shell.html b/platform/javascript/godot_shell.html deleted file mode 100644 index ee7399a129..0000000000 --- a/platform/javascript/godot_shell.html +++ /dev/null @@ -1,347 +0,0 @@ -<!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> -<head> - <meta charset="utf-8" /> - <title></title> - <style type="text/css"> - body { - margin: 0; - border: 0 none; - padding: 0; - text-align: center; - background-color: #222226; - font-family: 'Droid Sans', Arial, sans-serif; - } - - - /* Godot Engine default theme style - * ================================ */ - - .godot { - color: #e0e0e0; - background-color: #3b3943; - background-image: linear-gradient(to bottom, #403e48, #35333c); - border: 1px solid #45434e; - box-shadow: 0 0 1px 1px #2f2d35; - } - - button.godot { - font-family: 'Droid Sans', Arial, sans-serif; /* override user agent style */ - padding: 1px 5px; - background-color: #37353f; - background-image: linear-gradient(to bottom, #413e49, #3a3842); - border: 1px solid #514f5d; - border-radius: 1px; - box-shadow: 0 0 1px 1px #2a2930; - } - - button.godot:hover { - color: #f0f0f0; - background-color: #44414e; - background-image: linear-gradient(to bottom, #494652, #423f4c); - border: 1px solid #5a5667; - box-shadow: 0 0 1px 1px #26252b; - } - - button.godot:active { - color: #fff; - background-color: #3e3b46; - background-image: linear-gradient(to bottom, #36343d, #413e49); - border: 1px solid #4f4c59; - box-shadow: 0 0 1px 1px #26252b; - } - - button.godot:disabled { - color: rgba(230, 230, 230, 0.2); - background-color: #3d3d3d; - background-image: linear-gradient(to bottom, #434343, #393939); - border: 1px solid #474747; - box-shadow: 0 0 1px 1px #2d2b33; - } - - - /* Canvas / wrapper - * ================ */ - - #container { - display: inline-block; /* scale with canvas */ - vertical-align: top; /* prevent extra height */ - position: relative; /* root for absolutely positioned overlay */ - margin: 0; - border: 0 none; - padding: 0; - background-color: #0c0c0c; - } - - #canvas { - display: block; - margin: 0 auto; - /* canvas must have border and padding set to zero to - * calculate cursor coordinates correctly */ - border: 0 none; - padding: 0; - color: white; - } - - #canvas:focus { - outline: none; - } - - - /* Status display - * ============== */ - - #status-container { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - display: flex; - justify-content: center; - align-items: center; - /* don't consume click events - make children visible explicitly */ - visibility: hidden; - } - - #status { - line-height: 1.3; - cursor: pointer; - visibility: visible; - padding: 4px 6px; - } - - - /* Debug output - * ============ */ - - #output-panel { - display: none; - max-width: 700px; - font-size: small; - margin: 6px auto 0; - padding: 0 4px 4px; - text-align: left; - line-height: 2.2; - } - - #output-header { - display: flex; - justify-content: space-between; - align-items: center; - } - - #output-container { - padding: 6px; - background-color: #2c2a32; - box-shadow: inset 0 0 1px 1px #232127; - color: #bbb; - } - - #output-scroll { - line-height: 1; - height: 12em; - overflow-y: scroll; - white-space: pre-wrap; - font-size: small; - font-family: "Lucida Console", Monaco, monospace; - } - </style> -$GODOT_HEAD_INCLUDE -</head> -<body> - <div id="container"> - <canvas id="canvas" width="640" height="480" tabindex="0" oncontextmenu="event.preventDefault();"> - HTML5 canvas appears to be unsupported in the current browser.<br /> - Please try updating or use a different browser. - </canvas> - <div id="status-container"> - <span id="status" class="godot" onclick="this.style.visibility='hidden';">Downloading page...</span> - </div> - </div> - <div id="output-panel" class="godot"> - <div id="output-header"> - Output: - <button class="godot" type="button" autocomplete="off" onclick="Presentation.clearOutput();">Clear</button> - </div> - <div id="output-container"><div id="output-scroll"></div></div> - </div> - - <!-- Scripts --> - <script type="text/javascript">//<![CDATA[ - var Presentation = (function() { - var statusElement = document.getElementById("status"); - var canvasElement = document.getElementById("canvas"); - - var presentation = { - postRun: [], - setStatusVisible: function setStatusVisible(visible) { - statusElement.style.visibility = (visible ? "visible" : "hidden"); - }, - setStatus: function setStatus(text) { - if (text.length === 0) { - // emscripten sets empty string as status after "Running..." - // per timeout, but another status may have been set by then - if (Presentation.setStatus.lastText === "Running...") - Presentation.setStatusVisible(false); - return; - } - Presentation.setStatus.lastText = text; - while (statusElement.lastChild) { - statusElement.removeChild(statusElement.lastChild); - } - var lines = text.split("\n"); - lines.forEach(function(line, index) { - statusElement.appendChild(document.createTextNode(line)); - statusElement.appendChild(document.createElement("br")); - }); - var closeNote = document.createElement("span"); - closeNote.style.fontSize = "small"; - closeNote.textContent = "click to close"; - statusElement.appendChild(closeNote); - Presentation.setStatusVisible(true); - }, - isWebGL2Available: function isWebGL2Available() { - var context; - try { - context = canvasElement.getContext("webgl2") || canvasElement.getContext("experimental-webgl2"); - } catch (e) {} - return !!context; - }, - }; - - window.onerror = function(event) { presentation.setStatus("Failure during start-up\nSee JavaScript console") }; - - if ($GODOT_DEBUG_ENABLED) { // debugging enabled - var outputRoot = document.getElementById("output-panel"); - var outputElement = document.getElementById("output-scroll"); - const maxOutputMessages = 400; - - presentation.setOutputVisible = function setOutputVisible(visible) { - outputRoot.style.display = (visible ? "block" : "none"); - }; - presentation.clearOutput = function clearOutput() { - while (outputElement.firstChild) { - outputElement.firstChild.remove(); - } - }; - - presentation.setOutputVisible(true); - - presentation.print = function print(text) { - if (arguments.length > 1) { - text = Array.prototype.slice.call(arguments).join(" "); - } - if (text.length <= 0) return; - while (outputElement.childElementCount >= maxOutputMessages) { - outputElement.firstChild.remove(); - } - var msg = document.createElement("div"); - if (String.prototype.trim.call(text).startsWith("**ERROR**") - || String.prototype.trim.call(text).startsWith("**EXCEPTION**")) { - msg.style.color = "#d44"; - } else if (String.prototype.trim.call(text).startsWith("**WARNING**")) { - msg.style.color = "#ccc000"; - } else if (String.prototype.trim.call(text).startsWith("**SCRIPT ERROR**")) { - msg.style.color = "#c6d"; - } - msg.textContent = text; - var scrollToBottom = outputElement.scrollHeight - (outputElement.clientHeight + outputElement.scrollTop) < 10; - outputElement.appendChild(msg); - if (scrollToBottom) { - outputElement.scrollTop = outputElement.scrollHeight; - } - }; - - presentation.postRun.push(function() { - window.onerror = function(event) { presentation.print("**EXCEPTION**:", event) }; - }); - - } else { - presentation.postRun.push(function() { window.onerror = null; }); - } - - return presentation; - })(); - - // Emscripten interface - var Module = (function() { - const BASE_NAME = '$GODOT_BASE'; - var module = { - thisProgram: BASE_NAME, - wasmBinaryFile: BASE_NAME + '.wasm', - TOTAL_MEMORY: $GODOT_TMEM, - print: function print(text) { - if (arguments.length > 1) { - text = Array.prototype.slice.call(arguments).join(" "); - } - console.log(text); - if (typeof Presentation !== "undefined" && typeof Presentation.print === "function") { - Presentation.print(text); - } - }, - printErr: function printErr(text) { - if (arguments.length > 1) { - text = Array.prototype.slice.call(arguments).join(" "); - } - console.error(text); - if (typeof Presentation !== "undefined" && typeof Presentation.print === "function") { - Presentation.print("**ERROR**:", text) - } - }, - canvas: document.getElementById("canvas"), - setStatus: function setStatus(text) { - var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/); - var now = Date.now(); - if (m) { - if (now - Date.now() < 30) // if this is a progress update, skip it if too soon - return; - text = m[1]; - } - if (typeof Presentation !== "undefined" && typeof Presentation.setStatus == "function") { - Presentation.setStatus(text); - } - } - }; - - // As a default initial behavior, pop up an alert when WebGL context is lost. To make your - // application robust, you may want to override this behavior before shipping! - // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2 - module.canvas.addEventListener("webglcontextlost", function(e) { alert("WebGL context lost. Plase reload the page."); e.preventDefault(); }, false); - - if (typeof Presentation !== "undefined" && Presentation.postRun instanceof Array) { - module.postRun = Presentation.postRun; - } - - return module; - })(); - - if (!Presentation.isWebGL2Available()) { - Presentation.setStatus("WebGL 2 appears to be unsupported.\nPlease update browser and drivers."); - Presentation.preventLoading = true; - } else { - Presentation.setStatus("Downloading..."); - } - - if (Presentation.preventLoading) { - // prevent *fs.js and Emscripten's SCRIPT placeholder from loading any files - Presentation._XHR_send = XMLHttpRequest.prototype.send; - XMLHttpRequest.prototype.send = function() {}; - Presentation._Node_appendChild = Node.prototype.appendChild; - Node.prototype.appendChild = function(node) { - if (!(node instanceof HTMLScriptElement)) { - return Presentation._Node_appendChild.call(this, node); - } - } - } - //]]></script> - <script type="text/javascript" src="$GODOT_BASEfs.js"></script> -{{{ SCRIPT }}} - <script type="text/javascript"> - if (Presentation.preventLoading) { - XMLHttpRequest.prototype.send = Presentation._XHR_send; - Node.prototype.appendChild = Presentation._Node_appendChild; - } - </script> -</body> -</html> diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index a0e5610591..ac8d367366 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -521,21 +521,6 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i #undef SET_EM_CALLBACK #undef EM_CHECK - /* clang-format off */ - EM_ASM_ARGS({ - const send_notification = Module.cwrap('send_notification', null, ['number']); - const notifs = arguments; - (['mouseover', 'mouseleave', 'focus', 'blur']).forEach(function(event, i) { - Module.canvas.addEventListener(event, send_notification.bind(this, notifs[i])); - }); - }, - MainLoop::NOTIFICATION_WM_MOUSE_ENTER, - MainLoop::NOTIFICATION_WM_MOUSE_EXIT, - MainLoop::NOTIFICATION_WM_FOCUS_IN, - MainLoop::NOTIFICATION_WM_FOCUS_OUT - ); -/* clang-format on */ - #ifdef JAVASCRIPT_EVAL_ENABLED javascript_eval = memnew(JavaScript); ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaScript", javascript_eval)); @@ -818,7 +803,23 @@ void OS_JavaScript::main_loop_begin() { if (main_loop) main_loop->init(); + + /* clang-format off */ + EM_ASM_ARGS({ + const send_notification = Module.cwrap('send_notification', null, ['number']); + const notifs = arguments; + (['mouseover', 'mouseleave', 'focus', 'blur']).forEach(function(event, i) { + Module.canvas.addEventListener(event, send_notification.bind(null, notifs[i])); + }); + }, + MainLoop::NOTIFICATION_WM_MOUSE_ENTER, + MainLoop::NOTIFICATION_WM_MOUSE_EXIT, + MainLoop::NOTIFICATION_WM_FOCUS_IN, + MainLoop::NOTIFICATION_WM_FOCUS_OUT + ); + /* clang-format on */ } + bool OS_JavaScript::main_loop_iterate() { if (!main_loop) diff --git a/platform/javascript/pre_asmjs.js b/platform/javascript/pre_asmjs.js new file mode 100644 index 0000000000..3c497721b6 --- /dev/null +++ b/platform/javascript/pre_asmjs.js @@ -0,0 +1,3 @@ +var Engine = { + USING_WASM: false, + RuntimeEnvironment: function(Module) { diff --git a/platform/javascript/pre_wasm.js b/platform/javascript/pre_wasm.js new file mode 100644 index 0000000000..be4383c8c9 --- /dev/null +++ b/platform/javascript/pre_wasm.js @@ -0,0 +1,3 @@ +var Engine = { + USING_WASM: true, + RuntimeEnvironment: function(Module) { diff --git a/platform/osx/audio_driver_osx.cpp b/platform/osx/audio_driver_osx.cpp index 8c5a734f76..78c52af201 100644 --- a/platform/osx/audio_driver_osx.cpp +++ b/platform/osx/audio_driver_osx.cpp @@ -77,7 +77,7 @@ Error AudioDriverOSX::initDevice() { break; }*/ - mix_rate = GLOBAL_DEF("audio/mix_rate", 44100); + mix_rate = GLOBAL_DEF("audio/mix_rate", DEFAULT_MIX_RATE); zeromem(&strdesc, sizeof(strdesc)); strdesc.mFormatID = kAudioFormatLinearPCM; @@ -92,15 +92,19 @@ Error AudioDriverOSX::initDevice() { result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, kOutputBus, &strdesc, sizeof(strdesc)); ERR_FAIL_COND_V(result != noErr, FAILED); - int latency = GLOBAL_DEF("audio/output_latency", 25); - unsigned int buffer_size = closest_power_of_2(latency * mix_rate / 1000); + int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY); + // Sample rate is independent of channels (ref: https://stackoverflow.com/questions/11048825/audio-sample-frequency-rely-on-channels) + buffer_frames = closest_power_of_2(latency * mix_rate / 1000); - if (OS::get_singleton()->is_stdout_verbose()) { - print_line("audio buffer size: " + itos(buffer_size) + " calculated latency: " + itos(buffer_size * 1000 / mix_rate)); - } + result = AudioUnitSetProperty(audio_unit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, kOutputBus, &buffer_frames, sizeof(UInt32)); + ERR_FAIL_COND_V(result != noErr, FAILED); + buffer_size = buffer_frames * channels; samples_in.resize(buffer_size); - buffer_frames = buffer_size / channels; + + if (OS::get_singleton()->is_stdout_verbose()) { + print_line("audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms"); + } AURenderCallbackStruct callback; zeromem(&callback, sizeof(AURenderCallbackStruct)); @@ -234,7 +238,7 @@ void AudioDriverOSX::start() { }; int AudioDriverOSX::get_mix_rate() const { - return 44100; + return mix_rate; }; AudioDriver::SpeakerMode AudioDriverOSX::get_speaker_mode() const { @@ -282,8 +286,12 @@ AudioDriverOSX::AudioDriverOSX() { active = false; mutex = NULL; - mix_rate = 44100; + mix_rate = 0; channels = 2; + + buffer_size = 0; + buffer_frames = 0; + samples_in.clear(); }; diff --git a/platform/osx/audio_driver_osx.h b/platform/osx/audio_driver_osx.h index ac178b89f3..a7e68c8141 100644 --- a/platform/osx/audio_driver_osx.h +++ b/platform/osx/audio_driver_osx.h @@ -45,8 +45,9 @@ class AudioDriverOSX : public AudioDriver { Mutex *mutex; int mix_rate; - int channels; - int buffer_frames; + unsigned int channels; + unsigned int buffer_frames; + unsigned int buffer_size; Vector<int32_t> samples_in; diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index c129743507..25d44c24b5 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -466,8 +466,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t EditorNode::progress_task_step(progress_task, "File: " + p_file_name, (p_file_no * 100) / p_total_files); } - bool do_hash = p_file_name != "AppxSignature.p7x"; - FileMeta meta; meta.name = p_file_name; meta.uncompressed_size = p_len; @@ -501,7 +499,7 @@ void AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t size_t block_size = (p_len - step) > BLOCK_SIZE ? BLOCK_SIZE : (p_len - step); - for (int i = 0; i < block_size; i++) { + for (uint32_t i = 0; i < block_size; i++) { strm_in[i] = p_buffer[step + i]; } @@ -523,14 +521,14 @@ void AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t //package->store_buffer(strm_out.ptr(), strm.total_out - total_out_before); int start = file_buffer.size(); file_buffer.resize(file_buffer.size() + bh.compressed_size); - for (int i = 0; i < bh.compressed_size; i++) + for (uint32_t i = 0; i < bh.compressed_size; i++) file_buffer[start + i] = strm_out[i]; } else { bh.compressed_size = block_size; //package->store_buffer(strm_in.ptr(), block_size); int start = file_buffer.size(); file_buffer.resize(file_buffer.size() + block_size); - for (int i = 0; i < bh.compressed_size; i++) + for (uint32_t i = 0; i < bh.compressed_size; i++) file_buffer[start + i] = strm_in[i]; } @@ -553,7 +551,7 @@ void AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t //package->store_buffer(strm_out.ptr(), strm.total_out - total_out_before); int start = file_buffer.size(); file_buffer.resize(file_buffer.size() + (strm.total_out - total_out_before)); - for (int i = 0; i < (strm.total_out - total_out_before); i++) + for (uint32_t i = 0; i < (strm.total_out - total_out_before); i++) file_buffer[start + i] = strm_out[i]; deflateEnd(&strm); @@ -866,7 +864,7 @@ class EditorExportUWP : public EditorExportPlatform { Vector<uint8_t> _get_image_data(const Ref<EditorExportPreset> &p_preset, const String &p_path) { Vector<uint8_t> data; - StreamTexture *image; + StreamTexture *image = NULL; if (p_path.find("StoreLogo") != -1) { image = p_preset->get("images/store_logo").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/store_logo"))); @@ -882,6 +880,8 @@ class EditorExportUWP : public EditorExportPlatform { image = p_preset->get("images/wide310x150_logo").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/wide310x150_logo"))); } else if (p_path.find("SplashScreen") != -1) { image = p_preset->get("images/splash_screen").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/splash_screen"))); + } else { + ERR_PRINT("Unable to load logo"); } if (!image) return data; diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index 328b987f1f..8640f27699 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -130,24 +130,28 @@ Error ContextGL_Win::initialize() { 0, 0, 0 // Layer Masks Ignored }; - if (!(hDC = GetDC(hWnd))) { + hDC = GetDC(hWnd); + if (!hDC) { MessageBox(NULL, "Can't Create A GL Device Context.", "ERROR", MB_OK | MB_ICONEXCLAMATION); return ERR_CANT_CREATE; // Return FALSE } - if (!(pixel_format = ChoosePixelFormat(hDC, &pfd))) // Did Windows Find A Matching Pixel Format? + pixel_format = ChoosePixelFormat(hDC, &pfd); + if (!pixel_format) // Did Windows Find A Matching Pixel Format? { MessageBox(NULL, "Can't Find A Suitable pixel_format.", "ERROR", MB_OK | MB_ICONEXCLAMATION); return ERR_CANT_CREATE; // Return FALSE } - if (!SetPixelFormat(hDC, pixel_format, &pfd)) // Are We Able To Set The Pixel Format? + BOOL ret = SetPixelFormat(hDC, pixel_format, &pfd); + if (!ret) // Are We Able To Set The Pixel Format? { MessageBox(NULL, "Can't Set The pixel_format.", "ERROR", MB_OK | MB_ICONEXCLAMATION); return ERR_CANT_CREATE; // Return FALSE } - if (!(hRC = wglCreateContext(hDC))) // Are We Able To Get A Rendering Context? + hRC = wglCreateContext(hDC); + if (!hRC) // Are We Able To Get A Rendering Context? { MessageBox(NULL, "Can't Create A Temporary GL Rendering Context.", "ERROR", MB_OK | MB_ICONEXCLAMATION); return ERR_CANT_CREATE; // Return FALSE @@ -175,8 +179,8 @@ Error ContextGL_Win::initialize() { return ERR_CANT_CREATE; } - HGLRC new_hRC; - if (!(new_hRC = wglCreateContextAttribsARB(hDC, 0, attribs))) { + HGLRC new_hRC = wglCreateContextAttribsARB(hDC, 0, attribs); + if (!new_hRC) { wglDeleteContext(hRC); MessageBox(NULL, "Can't Create An OpenGL 3.3 Rendering Context.", "ERROR", MB_OK | MB_ICONEXCLAMATION); return ERR_CANT_CREATE; // Return false diff --git a/platform/windows/joypad.cpp b/platform/windows/joypad.cpp index 00cfa812de..0c7358f499 100644 --- a/platform/windows/joypad.cpp +++ b/platform/windows/joypad.cpp @@ -379,7 +379,9 @@ void JoypadWindows::process_joypads() { IDirectInputDevice8_Acquire(joy->di_joy); joy->di_joy->Poll(); } - if (FAILED(hr = joy->di_joy->GetDeviceState(sizeof(DIJOYSTATE2), &js))) { + + hr = joy->di_joy->GetDeviceState(sizeof(DIJOYSTATE2), &js); + if (FAILED(hr)) { //printf("failed to read joy #%d\n", i); continue; diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index deb9c25576..5814d883cd 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -996,7 +996,16 @@ void OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int video_mode.fullscreen = false; } else { - if (!(hWnd = CreateWindowExW(dwExStyle, L"Engine", L"", dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, (GetSystemMetrics(SM_CXSCREEN) - WindowRect.right) / 2, (GetSystemMetrics(SM_CYSCREEN) - WindowRect.bottom) / 2, WindowRect.right - WindowRect.left, WindowRect.bottom - WindowRect.top, NULL, NULL, hInstance, NULL))) { + hWnd = CreateWindowExW( + dwExStyle, + L"Engine", L"", + dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, + (GetSystemMetrics(SM_CXSCREEN) - WindowRect.right) / 2, + (GetSystemMetrics(SM_CYSCREEN) - WindowRect.bottom) / 2, + WindowRect.right - WindowRect.left, + WindowRect.bottom - WindowRect.top, + NULL, NULL, hInstance, NULL); + if (!hWnd) { MessageBoxW(NULL, L"Window Creation Error.", L"ERROR", MB_OK | MB_ICONEXCLAMATION); return; // Return FALSE } diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 2d33d25773..f96343c92c 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1237,7 +1237,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) { unsigned int keycode = KeyMappingX11::get_keycode(keysym_keycode); - /* Phase 3, obtain an unicode character from the keysym */ + /* Phase 3, obtain a unicode character from the keysym */ // KeyMappingX11 also translates keysym to unicode. // It does a binary search on a table to translate diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 1124904963..9fc6c8d23a 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -596,7 +596,7 @@ void Area2D::_bind_methods() { ClassDB::bind_method(D_METHOD("_area_enter_tree", "id"), &Area2D::_area_enter_tree); ClassDB::bind_method(D_METHOD("_area_exit_tree", "id"), &Area2D::_area_exit_tree); - ClassDB::bind_method(D_METHOD("set_space_override_mode", "enable"), &Area2D::set_space_override_mode); + ClassDB::bind_method(D_METHOD("set_space_override_mode", "space_override_mode"), &Area2D::set_space_override_mode); ClassDB::bind_method(D_METHOD("get_space_override_mode"), &Area2D::get_space_override_mode); ClassDB::bind_method(D_METHOD("set_gravity_is_point", "enable"), &Area2D::set_gravity_is_point); @@ -680,6 +680,12 @@ void Area2D::_bind_methods() { ADD_GROUP("Audio Bus", "audio_bus_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "audio_bus_override"), "set_audio_bus_override", "is_overriding_audio_bus"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus", "get_audio_bus"); + + BIND_ENUM_CONSTANT(SPACE_OVERRIDE_DISABLED); + BIND_ENUM_CONSTANT(SPACE_OVERRIDE_COMBINE); + BIND_ENUM_CONSTANT(SPACE_OVERRIDE_COMBINE_REPLACE); + BIND_ENUM_CONSTANT(SPACE_OVERRIDE_REPLACE); + BIND_ENUM_CONSTANT(SPACE_OVERRIDE_REPLACE_COMBINE); } Area2D::Area2D() diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index eb186a8e1f..d2a8e3315a 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -217,13 +217,15 @@ void AudioStreamPlayer2D::_notification(int p_what) { setseek = setplay; active = true; setplay = -1; - _change_notify("playing"); //update property in editor + //do not update, this makes it easier to animate (will shut off otherise) + //_change_notify("playing"); //update property in editor } //stop playing if no longer active if (!active) { set_fixed_process_internal(false); - _change_notify("playing"); //update property in editor + //do not update, this makes it easier to animate (will shut off otherise) + //_change_notify("playing"); //update property in editor emit_signal("finished"); } } @@ -246,12 +248,12 @@ void AudioStreamPlayer2D::set_stream(Ref<AudioStream> p_stream) { stream = p_stream; stream_playback = p_stream->instance_playback(); + AudioServer::get_singleton()->unlock(); + if (stream_playback.is_null()) { stream.unref(); ERR_FAIL_COND(stream_playback.is_null()); } - - AudioServer::get_singleton()->unlock(); } Ref<AudioStream> AudioStreamPlayer2D::get_stream() const { @@ -437,7 +439,7 @@ void AudioStreamPlayer2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE, "-80,24"), "set_volume_db", "get_volume_db"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "_is_active"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "play", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "_is_active"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_RANGE, "1,65536,1"), "set_max_distance", "get_max_distance"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation", PROPERTY_HINT_EXP_EASING), "set_attenuation", "get_attenuation"); @@ -445,7 +447,6 @@ void AudioStreamPlayer2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "area_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_area_mask", "get_area_mask"); ADD_SIGNAL(MethodInfo("finished")); - } AudioStreamPlayer2D::AudioStreamPlayer2D() { diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 4f00966e75..ec1ea7df38 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -37,6 +37,7 @@ #include "scene/resources/style_box.h" #include "scene/resources/texture.h" #include "scene/scene_string_names.h" +#include "servers/visual/visual_server_raster.h" #include "servers/visual_server.h" Mutex *CanvasItemMaterial::material_mutex = NULL; @@ -337,7 +338,6 @@ void CanvasItem::_update_callback() { notification(NOTIFICATION_DRAW); emit_signal(SceneStringNames::get_singleton()->draw); if (get_script_instance()) { - Variant::CallError err; get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_draw, NULL, 0); } drawing = false; diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index ab8277ecf3..1bca2c6f37 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -435,7 +435,7 @@ void Light2D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color"), "set_shadow_color", "get_shadow_color"); ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_buffer_size", PROPERTY_HINT_RANGE, "32,16384,1"), "set_shadow_buffer_size", "get_shadow_buffer_size"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_gradient_length", PROPERTY_HINT_RANGE, "0,4096,0.1"), "set_shadow_gradient_length", "get_shadow_gradient_length"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_filter", PROPERTY_HINT_ENUM, "None,PCF3,PCF5,PCF9,PCF13"), "set_shadow_filter", "get_shadow_filter"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_filter", PROPERTY_HINT_ENUM, "None,PCF3,PCF5,PCF7,PCF9,PCF13"), "set_shadow_filter", "get_shadow_filter"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_filter_smooth", PROPERTY_HINT_RANGE, "0,64,0.1"), "set_shadow_smooth", "get_shadow_smooth"); ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_item_cull_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_item_shadow_cull_mask", "get_item_shadow_cull_mask"); diff --git a/scene/2d/light_2d.h b/scene/2d/light_2d.h index 66b0aa2299..f6bc943adb 100644 --- a/scene/2d/light_2d.h +++ b/scene/2d/light_2d.h @@ -48,6 +48,7 @@ public: SHADOW_FILTER_NONE, SHADOW_FILTER_PCF3, SHADOW_FILTER_PCF5, + SHADOW_FILTER_PCF7, SHADOW_FILTER_PCF9, SHADOW_FILTER_PCF13, }; diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index 9eea5191b9..53db30e3ce 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -139,7 +139,7 @@ void LineBuilder::build() { float current_distance0 = 0.f; float current_distance1 = 0.f; - float total_distance; + float total_distance = 0.f; _interpolate_color = gradient != NULL; bool distance_required = _interpolate_color || texture_mode == LINE_TEXTURE_TILE; if (distance_required) @@ -173,13 +173,15 @@ void LineBuilder::build() { strip_begin(pos_up0, pos_down0, color0, uvx0); - // pos_up0 ------------- pos_up1 -------------------- - // | | - // pos0 - - - - - - - - - pos1 - - - - - - - - - pos2 - // | | - // pos_down0 ------------ pos_down1 ------------------ - // - // i-1 i i+1 + /* + * pos_up0 ------------- pos_up1 -------------------- + * | | + * pos0 - - - - - - - - - pos1 - - - - - - - - - pos2 + * | | + * pos_down0 ------------ pos_down1 ------------------ + * + * i-1 i i+1 + */ // http://labs.hyperandroid.com/tag/opengl-lines // (not the same implementation but visuals help a lot) @@ -206,17 +208,19 @@ void LineBuilder::build() { inner_normal1 = -u1 * hw; } - // --------------------------- - // / - // 0 / 1 - // / / - // --------------------x------ / - // / / (here shown with orientation == DOWN) - // / / - // / / - // / / - // 2 / - // / + /* + * --------------------------- + * / + * 0 / 1 + * / / + * --------------------x------ / + * / / (here shown with orientation == DOWN) + * / / + * / / + * / / + * 2 / + * / + */ // Find inner intersection at the joint Vector2 corner_pos_in, corner_pos_out; @@ -315,13 +319,14 @@ void LineBuilder::build() { // Add joint geometry if (current_joint_mode != LINE_JOINT_SHARP) { - // ________________ cbegin - // / \ - // / \ - // ____________/_ _ _\ cend - // | | - // | | - // | | + /* ________________ cbegin + * / \ + * / \ + * ____________/_ _ _\ cend + * | | + * | | + * | | + */ Vector2 cbegin, cend; if (orientation == UP) { diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 1d7bd8fc2a..9bd5576d91 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -137,7 +137,8 @@ void PathFollow2D::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { - if ((path = Object::cast_to<Path2D>(get_parent()))) { + path = Object::cast_to<Path2D>(get_parent()); + if (path) { _update_transform(); } diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index caf313190b..966dd88a2c 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -31,7 +31,6 @@ #include "arvr_nodes.h" #include "core/os/input.h" #include "servers/arvr/arvr_interface.h" -#include "servers/arvr/arvr_positional_tracker.h" #include "servers/arvr_server.h" //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -142,6 +141,7 @@ void ARVRController::_bind_methods() { ClassDB::bind_method(D_METHOD("get_joystick_axis", "axis"), &ARVRController::get_joystick_axis); ClassDB::bind_method(D_METHOD("get_is_active"), &ARVRController::get_is_active); + ClassDB::bind_method(D_METHOD("get_hand"), &ARVRController::get_hand); ADD_SIGNAL(MethodInfo("button_pressed", PropertyInfo(Variant::INT, "button"))); ADD_SIGNAL(MethodInfo("button_release", PropertyInfo(Variant::INT, "button"))); @@ -204,6 +204,19 @@ bool ARVRController::get_is_active() const { return is_active; }; +ARVRPositionalTracker::TrackerHand ARVRController::get_hand() const { + // get our ARVRServer + ARVRServer *arvr_server = ARVRServer::get_singleton(); + ERR_FAIL_NULL_V(arvr_server, ARVRPositionalTracker::TRACKER_HAND_UNKNOWN); + + ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id); + if (tracker == NULL) { + return ARVRPositionalTracker::TRACKER_HAND_UNKNOWN; + }; + + return tracker->get_hand(); +}; + String ARVRController::get_configuration_warning() const { if (!is_visible() || !is_inside_tree()) return String(); diff --git a/scene/3d/arvr_nodes.h b/scene/3d/arvr_nodes.h index 4c14be71b5..5269ec0248 100644 --- a/scene/3d/arvr_nodes.h +++ b/scene/3d/arvr_nodes.h @@ -33,6 +33,7 @@ #include "scene/3d/camera.h" #include "scene/3d/spatial.h" +#include "servers/arvr/arvr_positional_tracker.h" /** @author Bastiaan Olij <mux213@gmail.com> @@ -84,6 +85,7 @@ public: float get_joystick_axis(int p_axis) const; bool get_is_active() const; + ARVRPositionalTracker::TrackerHand get_hand() const; String get_configuration_warning() const; diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 6efdf25f0d..2073ebf94e 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -183,7 +183,7 @@ void AudioStreamPlayer3D::_mix_audio() { float AudioStreamPlayer3D::_get_attenuation_db(float p_distance) const { - float att; + float att = 0; switch (attenuation_model) { case ATTENUATION_INVERSE_DISTANCE: { att = Math::linear2db(1.0 / ((p_distance / unit_size) + 000001)); @@ -196,6 +196,10 @@ float AudioStreamPlayer3D::_get_attenuation_db(float p_distance) const { case ATTENUATION_LOGARITHMIC: { att = -20 * Math::log(p_distance / unit_size + 000001); } break; + default: { + ERR_PRINT("Unknown attenuation type"); + break; + } } att += unit_db; @@ -526,13 +530,15 @@ void AudioStreamPlayer3D::_notification(int p_what) { setseek = setplay; active = true; setplay = -1; - _change_notify("playing"); //update property in editor + //do not update, this makes it easier to animate (will shut off otherise) + ///_change_notify("playing"); //update property in editor } //stop playing if no longer active if (!active) { set_fixed_process_internal(false); - _change_notify("playing"); //update property in editor + //do not update, this makes it easier to animate (will shut off otherise) + //_change_notify("playing"); //update property in editor emit_signal("finished"); } } @@ -555,12 +561,12 @@ void AudioStreamPlayer3D::set_stream(Ref<AudioStream> p_stream) { stream = p_stream; stream_playback = p_stream->instance_playback(); + AudioServer::get_singleton()->unlock(); + if (stream_playback.is_null()) { stream.unref(); ERR_FAIL_COND(stream_playback.is_null()); } - - AudioServer::get_singleton()->unlock(); } Ref<AudioStream> AudioStreamPlayer3D::get_stream() const { @@ -873,7 +879,7 @@ void AudioStreamPlayer3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_size", PROPERTY_HINT_RANGE, "0.1,100,0.1"), "set_unit_size", "get_unit_size"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_db", PROPERTY_HINT_RANGE, "-24,6"), "set_max_db", "get_max_db"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "_is_active"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "play", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "_is_active"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_RANGE, "0,65536,1"), "set_max_distance", "get_max_distance"); ADD_PROPERTY(PropertyInfo(Variant::INT, "out_of_range_mode", PROPERTY_HINT_ENUM, "Mix,Pause"), "set_out_of_range_mode", "get_out_of_range_mode"); diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp index e1a5329fb0..2580b645e2 100644 --- a/scene/3d/bone_attachment.cpp +++ b/scene/3d/bone_attachment.cpp @@ -71,7 +71,8 @@ void BoneAttachment::_get_property_list(List<PropertyInfo> *p_list) const { void BoneAttachment::_check_bind() { - if (Skeleton *sk = Object::cast_to<Skeleton>(get_parent())) { + Skeleton *sk = Object::cast_to<Skeleton>(get_parent()); + if (sk) { int idx = sk->find_bone(bone_name); if (idx != -1) { @@ -86,7 +87,8 @@ void BoneAttachment::_check_unbind() { if (bound) { - if (Skeleton *sk = Object::cast_to<Skeleton>(get_parent())) { + Skeleton *sk = Object::cast_to<Skeleton>(get_parent()); + if (sk) { int idx = sk->find_bone(bone_name); if (idx != -1) { diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp index 5f1151f8e9..f49d89122d 100644 --- a/scene/3d/collision_shape.cpp +++ b/scene/3d/collision_shape.cpp @@ -50,7 +50,8 @@ void CollisionShape::make_convex_from_brothers() { for (int i = 0; i < p->get_child_count(); i++) { Node *n = p->get_child(i); - if (MeshInstance *mi = Object::cast_to<MeshInstance>(n)) { + MeshInstance *mi = Object::cast_to<MeshInstance>(n); + if (mi) { Ref<Mesh> m = mi->get_mesh(); if (m.is_valid()) { diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 0232ce7653..66364d40f9 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -548,8 +548,8 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons //plot the face by guessing it's albedo and emission value //find best axis to map to, for scanning values - int closest_axis; - float closest_dot; + int closest_axis = 0; + float closest_dot = 0; Plane plane = Plane(p_vtx[0], p_vtx[1], p_vtx[2]); Vector3 normal = plane.normal; @@ -696,22 +696,6 @@ void GIProbe::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p_z, cons p_baker->bake_cells[p_idx].normal[2] += normal_accum.z; p_baker->bake_cells[p_idx].alpha += alpha; - static const Vector3 side_normals[6] = { - Vector3(-1, 0, 0), - Vector3(1, 0, 0), - Vector3(0, -1, 0), - Vector3(0, 1, 0), - Vector3(0, 0, -1), - Vector3(0, 0, 1), - }; - - /* - for(int i=0;i<6;i++) { - if (normal.dot(side_normals[i])>CMP_EPSILON) { - p_baker->bake_cells[p_idx].used_sides|=(1<<i); - } - }*/ - } else { //go down @@ -1092,7 +1076,7 @@ void GIProbe::_plot_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh, Baker *p_b void GIProbe::_find_meshes(Node *p_at_node, Baker *p_baker) { MeshInstance *mi = Object::cast_to<MeshInstance>(p_at_node); - if (mi && mi->get_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT)) { + if (mi && mi->get_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT) && mi->is_visible_in_tree()) { Ref<Mesh> mesh = mi->get_mesh(); if (mesh.is_valid()) { @@ -1113,25 +1097,29 @@ void GIProbe::_find_meshes(Node *p_at_node, Baker *p_baker) { } } - if (Spatial *s = Object::cast_to<Spatial>(p_at_node)) { + Spatial *s = Object::cast_to<Spatial>(p_at_node); + if (s) { - Array meshes = p_at_node->call("get_meshes"); - for (int i = 0; i < meshes.size(); i += 2) { + if (s->is_visible_in_tree()) { - Transform mxf = meshes[i]; - Ref<Mesh> mesh = meshes[i + 1]; - if (!mesh.is_valid()) - continue; + Array meshes = p_at_node->call("get_meshes"); + for (int i = 0; i < meshes.size(); i += 2) { - Rect3 aabb = mesh->get_aabb(); + Transform mxf = meshes[i]; + Ref<Mesh> mesh = meshes[i + 1]; + if (!mesh.is_valid()) + continue; - Transform xf = get_global_transform().affine_inverse() * (s->get_global_transform() * mxf); + Rect3 aabb = mesh->get_aabb(); - if (Rect3(-extents, extents * 2).intersects(xf.xform(aabb))) { - Baker::PlotMesh pm; - pm.local_xform = xf; - pm.mesh = mesh; - p_baker->mesh_list.push_back(pm); + Transform xf = get_global_transform().affine_inverse() * (s->get_global_transform() * mxf); + + if (Rect3(-extents, extents * 2).intersects(xf.xform(aabb))) { + Baker::PlotMesh pm; + pm.local_xform = xf; + pm.mesh = mesh; + p_baker->mesh_list.push_back(pm); + } } } } diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index 157ae42571..0f281b694d 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -55,8 +55,8 @@ void InterpolatedCamera::_notification(int p_what) { Transform local_transform = get_global_transform(); local_transform = local_transform.interpolate_with(target_xform, delta); set_global_transform(local_transform); - - if (Camera *cam = Object::cast_to<Camera>(node)) { + Camera *cam = Object::cast_to<Camera>(node); + if (cam) { if (cam->get_projection() == get_projection()) { diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 09b253b309..096f787873 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -230,7 +230,6 @@ void Light::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_shadow_color", "get_shadow_color"); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "shadow_bias", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "shadow_contact", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_param", "get_param", PARAM_CONTACT_SHADOW_SIZE); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "shadow_max_distance", PROPERTY_HINT_RANGE, "0,65536,0.1"), "set_param", "get_param", PARAM_SHADOW_MAX_DISTANCE); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_reverse_cull_face"), "set_shadow_reverse_cull_face", "get_shadow_reverse_cull_face"); ADD_GROUP("Editor", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_only"), "set_editor_only", "is_editor_only"); @@ -308,6 +307,16 @@ DirectionalLight::ShadowMode DirectionalLight::get_shadow_mode() const { return shadow_mode; } +void DirectionalLight::set_shadow_depth_range(ShadowDepthRange p_range) { + shadow_depth_range = p_range; + VS::get_singleton()->light_directional_set_shadow_depth_range_mode(light, VS::LightDirectionalShadowDepthRangeMode(p_range)); +} + +DirectionalLight::ShadowDepthRange DirectionalLight::get_shadow_depth_range() const { + + return shadow_depth_range; +} + void DirectionalLight::set_blend_splits(bool p_enable) { blend_splits = p_enable; @@ -324,6 +333,9 @@ void DirectionalLight::_bind_methods() { ClassDB::bind_method(D_METHOD("set_shadow_mode", "mode"), &DirectionalLight::set_shadow_mode); ClassDB::bind_method(D_METHOD("get_shadow_mode"), &DirectionalLight::get_shadow_mode); + ClassDB::bind_method(D_METHOD("set_shadow_depth_range", "mode"), &DirectionalLight::set_shadow_depth_range); + ClassDB::bind_method(D_METHOD("get_shadow_depth_range"), &DirectionalLight::get_shadow_depth_range); + ClassDB::bind_method(D_METHOD("set_blend_splits", "enabled"), &DirectionalLight::set_blend_splits); ClassDB::bind_method(D_METHOD("is_blend_splits_enabled"), &DirectionalLight::is_blend_splits_enabled); @@ -335,10 +347,15 @@ void DirectionalLight::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "directional_shadow_blend_splits"), "set_blend_splits", "is_blend_splits_enabled"); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_normal_bias", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_param", "get_param", PARAM_SHADOW_NORMAL_BIAS); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_bias_split_scale", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS_SPLIT_SCALE); + ADD_PROPERTY(PropertyInfo(Variant::INT, "directional_shadow_depth_range", PROPERTY_HINT_ENUM, "Stable,Optimized"), "set_shadow_depth_range", "get_shadow_depth_range"); + ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_max_distance", PROPERTY_HINT_RANGE, "0,65536,0.1"), "set_param", "get_param", PARAM_SHADOW_MAX_DISTANCE); BIND_ENUM_CONSTANT(SHADOW_ORTHOGONAL); BIND_ENUM_CONSTANT(SHADOW_PARALLEL_2_SPLITS); BIND_ENUM_CONSTANT(SHADOW_PARALLEL_4_SPLITS); + + BIND_ENUM_CONSTANT(SHADOW_DEPTH_RANGE_STABLE); + BIND_ENUM_CONSTANT(SHADOW_DEPTH_RANGE_OPTIMIZED); } DirectionalLight::DirectionalLight() @@ -349,6 +366,7 @@ DirectionalLight::DirectionalLight() set_param(PARAM_SHADOW_MAX_DISTANCE, 200); set_param(PARAM_SHADOW_BIAS_SPLIT_SCALE, 0.25); set_shadow_mode(SHADOW_PARALLEL_4_SPLITS); + set_shadow_depth_range(SHADOW_DEPTH_RANGE_STABLE); blend_splits = false; } diff --git a/scene/3d/light.h b/scene/3d/light.h index 5d589d33e5..6aa0220265 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -133,9 +133,15 @@ public: SHADOW_PARALLEL_4_SPLITS }; + enum ShadowDepthRange { + SHADOW_DEPTH_RANGE_STABLE = VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE, + SHADOW_DEPTH_RANGE_OPTIMIZED = VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED, + }; + private: bool blend_splits; ShadowMode shadow_mode; + ShadowDepthRange shadow_depth_range; protected: static void _bind_methods(); @@ -144,6 +150,9 @@ public: void set_shadow_mode(ShadowMode p_mode); ShadowMode get_shadow_mode() const; + void set_shadow_depth_range(ShadowDepthRange p_mode); + ShadowDepthRange get_shadow_depth_range() const; + void set_blend_splits(bool p_enable); bool is_blend_splits_enabled() const; @@ -151,6 +160,7 @@ public: }; VARIANT_ENUM_CAST(DirectionalLight::ShadowMode) +VARIANT_ENUM_CAST(DirectionalLight::ShadowDepthRange) class OmniLight : public Light { diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index ed4d88417c..60245fe6ce 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -155,8 +155,8 @@ void PathFollow::_notification(int p_what) { Node *parent = get_parent(); if (parent) { - - if ((path = Object::cast_to<Path>(parent))) { + path = Object::cast_to<Path>(parent); + if (path) { _update_transform(); } } diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 9590394211..6a8226c0e1 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -912,35 +912,24 @@ RigidBody::~RigidBody() { ////////////////////////////////////////////////////// ////////////////////////// -Dictionary KinematicBody::_move(const Vector3 &p_motion) { +Ref<KinematicCollision> KinematicBody::_move(const Vector3 &p_motion) { Collision col; - if (move(p_motion, col)) { - Dictionary d; - d["position"] = col.collision; - d["normal"] = col.normal; - d["local_shape"] = col.local_shape; - d["travel"] = col.travel; - d["remainder"] = col.remainder; - d["collider_id"] = col.collider; - if (col.collider) { - d["collider"] = ObjectDB::get_instance(col.collider); - } else { - d["collider"] = Variant(); + if (move_and_collide(p_motion, col)) { + if (motion_cache.is_null()) { + motion_cache.instance(); + motion_cache->owner = this; } - d["collider_velocity"] = col.collider_vel; - d["collider_shape_index"] = col.collider_shape; - d["collider_metadata"] = col.collider_metadata; - - return d; + motion_cache->collision = col; - } else { - return Dictionary(); + return motion_cache; } + + return Ref<KinematicCollision>(); } -bool KinematicBody::move(const Vector3 &p_motion, Collision &r_collision) { +bool KinematicBody::move_and_collide(const Vector3 &p_motion, Collision &r_collision) { Transform gt = get_global_transform(); PhysicsServer::MotionResult result; @@ -964,7 +953,7 @@ bool KinematicBody::move(const Vector3 &p_motion, Collision &r_collision) { return colliding; } -Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_bounces, float p_floor_max_angle) { +Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_slides, float p_floor_max_angle) { Vector3 motion = (floor_velocity + p_linear_velocity) * get_fixed_process_delta_time(); Vector3 lv = p_linear_velocity; @@ -975,11 +964,11 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve colliders.clear(); floor_velocity = Vector3(); - while (p_max_bounces) { + while (p_max_slides) { Collision collision; - bool collided = move(motion, collision); + bool collided = move_and_collide(motion, collision); if (collided) { @@ -1017,7 +1006,7 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve break; } - p_max_bounces--; + p_max_slides--; if (motion == Vector3()) break; } @@ -1059,79 +1048,36 @@ float KinematicBody::get_safe_margin() const { return margin; } - -int KinematicBody::get_collision_count() const { +int KinematicBody::get_slide_count() const { return colliders.size(); } -Vector3 KinematicBody::get_collision_position(int p_collision) const { - - ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); - return colliders[p_collision].collision; -} -Vector3 KinematicBody::get_collision_normal(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); - return colliders[p_collision].normal; +KinematicBody::Collision KinematicBody::get_slide_collision(int p_bounce) const { + ERR_FAIL_INDEX_V(p_bounce, colliders.size(), Collision()); + return colliders[p_bounce]; } -Vector3 KinematicBody::get_collision_travel(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); - return colliders[p_collision].travel; -} -Vector3 KinematicBody::get_collision_remainder(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); - return colliders[p_collision].remainder; -} -Object *KinematicBody::get_collision_local_shape(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL); - uint32_t owner = shape_find_owner(colliders[p_collision].local_shape); - return shape_owner_get_owner(owner); -} -Object *KinematicBody::get_collision_collider(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL); +Ref<KinematicCollision> KinematicBody::_get_slide_collision(int p_bounce) { - if (colliders[p_collision].collider) { - return ObjectDB::get_instance(colliders[p_collision].collider); + ERR_FAIL_INDEX_V(p_bounce, colliders.size(), Ref<KinematicCollision>()); + if (p_bounce > slide_colliders.size()) { + slide_colliders.resize(p_bounce + 1); } - return NULL; -} -ObjectID KinematicBody::get_collision_collider_id(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), 0); - - return colliders[p_collision].collider; -} -Object *KinematicBody::get_collision_collider_shape(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL); - Object *collider = get_collision_collider(p_collision); - if (collider) { - CollisionObject *obj2d = Object::cast_to<CollisionObject>(collider); - if (obj2d) { - uint32_t owner = shape_find_owner(colliders[p_collision].collider_shape); - return obj2d->shape_owner_get_owner(owner); - } + if (slide_colliders[p_bounce].is_null()) { + slide_colliders[p_bounce].instance(); + slide_colliders[p_bounce]->owner = this; } - return NULL; -} -int KinematicBody::get_collision_collider_shape_index(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), -1); - return colliders[p_collision].collider_shape; -} -Vector3 KinematicBody::get_collision_collider_velocity(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); - return colliders[p_collision].collider_vel; -} -Variant KinematicBody::get_collision_collider_metadata(int p_collision) const { - ERR_FAIL_INDEX_V(p_collision, colliders.size(), Variant()); - return colliders[p_collision].collider_metadata; + slide_colliders[p_bounce]->collision = colliders[p_bounce]; + return slide_colliders[p_bounce]; } void KinematicBody::_bind_methods() { - ClassDB::bind_method(D_METHOD("move", "rel_vec"), &KinematicBody::_move); - ClassDB::bind_method(D_METHOD("move_and_slide", "linear_velocity", "floor_normal", "slope_stop_min_velocity", "max_bounces", "floor_max_angle"), &KinematicBody::move_and_slide, DEFVAL(Vector3(0, 0, 0)), DEFVAL(0.05), DEFVAL(4), DEFVAL(Math::deg2rad((float)45))); + ClassDB::bind_method(D_METHOD("move_and_collide", "rel_vec"), &KinematicBody::_move); + ClassDB::bind_method(D_METHOD("move_and_slide", "linear_velocity", "floor_normal", "slope_stop_min_velocity", "max_slides", "floor_max_angle"), &KinematicBody::move_and_slide, DEFVAL(Vector3(0, 0, 0)), DEFVAL(0.05), DEFVAL(4), DEFVAL(Math::deg2rad((float)45))); ClassDB::bind_method(D_METHOD("test_move", "from", "rel_vec"), &KinematicBody::test_move); @@ -1143,18 +1089,8 @@ void KinematicBody::_bind_methods() { ClassDB::bind_method(D_METHOD("set_safe_margin", "pixels"), &KinematicBody::set_safe_margin); ClassDB::bind_method(D_METHOD("get_safe_margin"), &KinematicBody::get_safe_margin); - ClassDB::bind_method(D_METHOD("get_collision_count"), &KinematicBody::get_collision_count); - ClassDB::bind_method(D_METHOD("get_collision_position", "collision"), &KinematicBody::get_collision_position); - ClassDB::bind_method(D_METHOD("get_collision_normal", "collision"), &KinematicBody::get_collision_normal); - ClassDB::bind_method(D_METHOD("get_collision_travel", "collision"), &KinematicBody::get_collision_travel); - ClassDB::bind_method(D_METHOD("get_collision_remainder", "collision"), &KinematicBody::get_collision_remainder); - ClassDB::bind_method(D_METHOD("get_collision_local_shape", "collision"), &KinematicBody::get_collision_local_shape); - ClassDB::bind_method(D_METHOD("get_collision_collider", "collision"), &KinematicBody::get_collision_collider); - ClassDB::bind_method(D_METHOD("get_collision_collider_id", "collision"), &KinematicBody::get_collision_collider_id); - ClassDB::bind_method(D_METHOD("get_collision_collider_shape", "collision"), &KinematicBody::get_collision_collider_shape); - ClassDB::bind_method(D_METHOD("get_collision_collider_shape_index", "collision"), &KinematicBody::get_collision_collider_shape_index); - ClassDB::bind_method(D_METHOD("get_collision_collider_velocity", "collision"), &KinematicBody::get_collision_collider_velocity); - ClassDB::bind_method(D_METHOD("get_collision_collider_metadata", "collision"), &KinematicBody::get_collision_collider_metadata); + ClassDB::bind_method(D_METHOD("get_slide_count"), &KinematicBody::get_slide_count); + ClassDB::bind_method(D_METHOD("get_slide_collision", "slide_idx"), &KinematicBody::_get_slide_collision); ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin"); } @@ -1169,4 +1105,106 @@ KinematicBody::KinematicBody() on_wall = false; } KinematicBody::~KinematicBody() { + + if (motion_cache.is_valid()) { + motion_cache->owner = NULL; + } + + for (int i = 0; i < slide_colliders.size(); i++) { + if (slide_colliders[i].is_valid()) { + slide_colliders[i]->owner = NULL; + } + } +} +/////////////////////////////////////// + +Vector3 KinematicCollision::get_position() const { + + return collision.collision; +} +Vector3 KinematicCollision::get_normal() const { + return collision.normal; +} +Vector3 KinematicCollision::get_travel() const { + return collision.travel; +} +Vector3 KinematicCollision::get_remainder() const { + return collision.remainder; +} +Object *KinematicCollision::get_local_shape() const { + ERR_FAIL_COND_V(!owner, NULL); + uint32_t ownerid = owner->shape_find_owner(collision.local_shape); + return owner->shape_owner_get_owner(ownerid); +} + +Object *KinematicCollision::get_collider() const { + + if (collision.collider) { + return ObjectDB::get_instance(collision.collider); + } + + return NULL; +} +ObjectID KinematicCollision::get_collider_id() const { + + return collision.collider; +} +Object *KinematicCollision::get_collider_shape() const { + + Object *collider = get_collider(); + if (collider) { + CollisionObject *obj2d = Object::cast_to<CollisionObject>(collider); + if (obj2d) { + uint32_t ownerid = obj2d->shape_find_owner(collision.collider_shape); + return obj2d->shape_owner_get_owner(ownerid); + } + } + + return NULL; +} +int KinematicCollision::get_collider_shape_index() const { + + return collision.collider_shape; +} +Vector3 KinematicCollision::get_collider_velocity() const { + + return collision.collider_vel; +} +Variant KinematicCollision::get_collider_metadata() const { + + return Variant(); +} + +void KinematicCollision::_bind_methods() { + + ClassDB::bind_method(D_METHOD("get_position"), &KinematicCollision::get_position); + ClassDB::bind_method(D_METHOD("get_normal"), &KinematicCollision::get_normal); + ClassDB::bind_method(D_METHOD("get_travel"), &KinematicCollision::get_travel); + ClassDB::bind_method(D_METHOD("get_remainder"), &KinematicCollision::get_remainder); + ClassDB::bind_method(D_METHOD("get_local_shape"), &KinematicCollision::get_local_shape); + ClassDB::bind_method(D_METHOD("get_collider"), &KinematicCollision::get_collider); + ClassDB::bind_method(D_METHOD("get_collider_id"), &KinematicCollision::get_collider_id); + ClassDB::bind_method(D_METHOD("get_collider_shape"), &KinematicCollision::get_collider_shape); + ClassDB::bind_method(D_METHOD("get_collider_shape_index"), &KinematicCollision::get_collider_shape_index); + ClassDB::bind_method(D_METHOD("get_collider_velocity"), &KinematicCollision::get_collider_velocity); + ClassDB::bind_method(D_METHOD("get_collider_metadata"), &KinematicCollision::get_collider_metadata); + + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "position"), "", "get_position"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "normal"), "", "get_normal"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "travel"), "", "get_travel"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "remainder"), "", "get_remainder"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "local_shape"), "", "get_local_shape"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider"), "", "get_collider"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_id"), "", "get_collider_id"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "collider_shape"), "", "get_collider_shape"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "collider_shape_index"), "", "get_collider_shape_index"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "collider_velocity"), "", "get_collider_velocity"); + ADD_PROPERTY(PropertyInfo(Variant::NIL, "collider_metadata", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NIL_IS_VARIANT), "", "get_collider_metadata"); +} + +KinematicCollision::KinematicCollision() { + collision.collider = 0; + collision.collider_shape = 0; + collision.local_shape = 0; + owner = NULL; } diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index 23d752ad76..f88b3860dc 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -261,6 +261,8 @@ public: VARIANT_ENUM_CAST(RigidBody::Mode); VARIANT_ENUM_CAST(RigidBody::AxisLock); +class KinematicCollision; + class KinematicBody : public PhysicsBody { GDCLASS(KinematicBody, PhysicsBody); @@ -286,42 +288,62 @@ private: bool on_ceiling; bool on_wall; Vector<Collision> colliders; + Vector<Ref<KinematicCollision> > slide_colliders; + Ref<KinematicCollision> motion_cache; _FORCE_INLINE_ bool _ignores_mode(PhysicsServer::BodyMode) const; - Dictionary _move(const Vector3 &p_motion); + Ref<KinematicCollision> _move(const Vector3 &p_motion); + Ref<KinematicCollision> _get_slide_collision(int p_bounce); protected: static void _bind_methods(); public: - bool move(const Vector3 &p_motion, Collision &r_collision); + bool move_and_collide(const Vector3 &p_motion, Collision &r_collision); bool test_move(const Transform &p_from, const Vector3 &p_motion); void set_safe_margin(float p_margin); float get_safe_margin() const; - Vector3 move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction = Vector3(0, 0, 0), float p_slope_stop_min_velocity = 0.05, int p_max_bounces = 4, float p_floor_max_angle = Math::deg2rad((float)45)); + Vector3 move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction = Vector3(0, 0, 0), float p_slope_stop_min_velocity = 0.05, int p_max_slides = 4, float p_floor_max_angle = Math::deg2rad((float)45)); bool is_on_floor() const; bool is_on_wall() const; bool is_on_ceiling() const; Vector3 get_floor_velocity() const; - int get_collision_count() const; - Vector3 get_collision_position(int p_collision) const; - Vector3 get_collision_normal(int p_collision) const; - Vector3 get_collision_travel(int p_collision) const; - Vector3 get_collision_remainder(int p_collision) const; - Object *get_collision_local_shape(int p_collision) const; - Object *get_collision_collider(int p_collision) const; - ObjectID get_collision_collider_id(int p_collision) const; - Object *get_collision_collider_shape(int p_collision) const; - int get_collision_collider_shape_index(int p_collision) const; - Vector3 get_collision_collider_velocity(int p_collision) const; - Variant get_collision_collider_metadata(int p_collision) const; + int get_slide_count() const; + Collision get_slide_collision(int p_bounce) const; KinematicBody(); ~KinematicBody(); }; +class KinematicCollision : public Reference { + + GDCLASS(KinematicCollision, Reference); + + KinematicBody *owner; + friend class KinematicBody; + KinematicBody::Collision collision; + +protected: + static void _bind_methods(); + +public: + Vector3 get_position() const; + Vector3 get_normal() const; + Vector3 get_travel() const; + Vector3 get_remainder() const; + Object *get_local_shape() const; + Object *get_collider() const; + ObjectID get_collider_id() const; + Object *get_collider_shape() const; + int get_collider_shape_index() const; + Vector3 get_collider_velocity() const; + Variant get_collider_metadata() const; + + KinematicCollision(); +}; + #endif // PHYSICS_BODY__H diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 7db3bb18bd..91fe426b99 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -175,7 +175,6 @@ void Spatial::_notification(int p_what) { if (get_script_instance()) { - Variant::CallError err; get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_enter_world, NULL, 0); } #ifdef TOOLS_ENABLED @@ -207,7 +206,6 @@ void Spatial::_notification(int p_what) { if (get_script_instance()) { - Variant::CallError err; get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_world, NULL, 0); } diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index e2330eb0d4..7a5c7e450b 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -1156,6 +1156,7 @@ void AnimationTreePlayer::transition_node_set_xfade_time(const StringName &p_nod } void AnimationTreePlayer::TransitionNode::set_current(int p_current) { + ERR_FAIL_INDEX(p_current, inputs.size()); if (current == p_current) diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index 71d7277118..609430340b 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -347,7 +347,7 @@ public: void animation_node_set_master_animation(const StringName &p_node, const String &p_master_animation); String animation_node_get_master_animation(const StringName &p_node) const; - void animation_node_set_filter_path(const StringName &p_node, const NodePath &p_filter, bool p_enable); + void animation_node_set_filter_path(const StringName &p_node, const NodePath &p_track_path, bool p_filter); void animation_node_set_get_filtered_paths(const StringName &p_node, List<NodePath> *r_paths) const; bool animation_node_is_path_filtered(const StringName &p_node, const NodePath &p_path) const; diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp index 5d71f702df..341ae45ce8 100644 --- a/scene/audio/audio_player.cpp +++ b/scene/audio/audio_player.cpp @@ -139,12 +139,12 @@ void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) { stream = p_stream; stream_playback = p_stream->instance_playback(); + AudioServer::get_singleton()->unlock(); + if (stream_playback.is_null()) { stream.unref(); ERR_FAIL_COND(stream_playback.is_null()); } - - AudioServer::get_singleton()->unlock(); } Ref<AudioStream> AudioStreamPlayer::get_stream() const { @@ -304,7 +304,7 @@ void AudioStreamPlayer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE, "-80,24"), "set_volume_db", "get_volume_db"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "_is_active"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "play", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "_is_active"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled"); ADD_PROPERTY(PropertyInfo(Variant::INT, "mix_target", PROPERTY_HINT_ENUM, "Stereo,Surround,Center"), "set_mix_target", "get_mix_target"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 8fd19e8655..5713a35b7a 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -87,14 +87,14 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) { status.pressed = !status.pressed; pressed(); - if (get_script_instance()) { - Variant::CallError ce; - get_script_instance()->call(SceneStringNames::get_singleton()->_pressed, NULL, 0, ce); - } + emit_signal("pressed"); _unpress_group(); toggled(status.pressed); + if (get_script_instance()) { + get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, status.pressed); + } emit_signal("toggled", status.pressed); } @@ -143,10 +143,10 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) { emit_signal("pressed"); toggled(status.pressed); - emit_signal("toggled", status.pressed); if (get_script_instance()) { get_script_instance()->call(SceneStringNames::get_singleton()->_toggled, status.pressed); } + emit_signal("toggled", status.pressed); } _unpress_group(); diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp deleted file mode 100644 index 336c88fe9d..0000000000 --- a/scene/gui/button_group.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/*************************************************************************/ -/* button_group.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "button_group.h" - -#if 0 -#include "base_button.h" - -void ButtonGroup::_add_button(BaseButton *p_button) { - - buttons.insert(p_button); - p_button->set_toggle_mode(true); - p_button->set_click_on_press(true); - p_button->connect("pressed",this,"_pressed",make_binds(p_button)); - -} - -void ButtonGroup::_remove_button(BaseButton *p_button){ - - buttons.erase(p_button); - p_button->disconnect("pressed",this,"_pressed"); - -} - -void ButtonGroup::set_pressed_button(BaseButton *p_button) { - - _pressed(p_button); -} - -void ButtonGroup::_pressed(Object *p_button) { - - ERR_FAIL_NULL(p_button); - BaseButton *b=Object::cast_to<BaseButton>(p_button); - ERR_FAIL_COND(!b); - - for(Set<BaseButton*>::Element *E=buttons.front();E;E=E->next()) { - - BaseButton *bb=E->get(); - bb->set_pressed( b==bb ); - if (b==bb){ - emit_signal("button_selected", b); - } - } -} - -Array ButtonGroup::_get_button_list() const { - - List<BaseButton*> b; - get_button_list(&b); - - b.sort_custom<Node::Comparator>(); - - Array arr; - arr.resize(b.size()); - - int idx=0; - - for(List<BaseButton*>::Element *E=b.front();E;E=E->next(),idx++) { - - arr[idx]=E->get(); - } - - return arr; -} - -void ButtonGroup::get_button_list(List<BaseButton*> *p_buttons) const { - - for(Set<BaseButton*>::Element *E=buttons.front();E;E=E->next()) { - - p_buttons->push_back(E->get()); - } -} - -BaseButton *ButtonGroup::get_pressed_button() const { - - for(Set<BaseButton*>::Element *E=buttons.front();E;E=E->next()) { - - if (E->get()->is_pressed()) - return E->get(); - } - - return NULL; -} - -BaseButton *ButtonGroup::get_focused_button() const{ - - for(Set<BaseButton*>::Element *E=buttons.front();E;E=E->next()) { - - if (E->get()->has_focus()) - return E->get(); - } - - return NULL; - -} - -int ButtonGroup::get_pressed_button_index() const { - //in tree order, this is bizarre - - ERR_FAIL_COND_V(!is_inside_tree(),0); - - BaseButton *pressed = get_pressed_button(); - if (!pressed) - return -1; - - List<BaseButton*> blist; - for(Set<BaseButton*>::Element *E=buttons.front();E;E=E->next()) { - - blist.push_back(E->get()); - - } - - blist.sort_custom<Node::Comparator>(); - - int idx=0; - for(List<BaseButton*>::Element *E=blist.front();E;E=E->next()) { - - if (E->get()==pressed) - return idx; - - idx++; - } - - return -1; -} - -void ButtonGroup::_bind_methods() { - - ClassDB::bind_method(D_METHOD("get_pressed_button"),&ButtonGroup::get_pressed_button); - ClassDB::bind_method(D_METHOD("get_pressed_button_index"),&ButtonGroup::get_pressed_button_index); - ClassDB::bind_method(D_METHOD("get_focused_button"),&ButtonGroup::get_focused_button); - ClassDB::bind_method(D_METHOD("get_button_list"),&ButtonGroup::_get_button_list); - ClassDB::bind_method(D_METHOD("_pressed"),&ButtonGroup::_pressed); - ClassDB::bind_method(D_METHOD("set_pressed_button","button"),&ButtonGroup::_pressed); - - ADD_SIGNAL( MethodInfo("button_selected",PropertyInfo(Variant::OBJECT,"button",PROPERTY_HINT_RESOURCE_TYPE,"BaseButton"))); -} - -ButtonGroup::ButtonGroup() : BoxContainer(true) -{ -} -#endif diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index 21e2269141..e2b10a948f 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "check_box.h" -#include "button_group.h" #include "servers/visual_server.h" void CheckBox::_notification(int p_what) { diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 961fccc804..87dfd95724 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1249,6 +1249,10 @@ void Control::_size_changed() { new_size_cache.height = MAX(minimum_size.height, new_size_cache.height); } + if (get_viewport()->is_snap_controls_to_pixels_enabled()) { + new_size_cache = new_size_cache.floor(); + new_pos_cache = new_pos_cache.floor(); + } bool pos_changed = new_pos_cache != data.pos_cache; bool size_changed = new_size_cache != data.size_cache; diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 990c0f3d96..87a232e766 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -183,8 +183,8 @@ void FileDialog::_action_pressed() { String path = dir_access->get_current_dir(); path = path.replace("\\", "/"); - - if (TreeItem *item = tree->get_selected()) { + TreeItem *item = tree->get_selected(); + if (item) { Dictionary d = item->get_metadata(0); if (d["dir"]) { path = path.plus_file(d["name"]); diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 8730be0c06..bef0808fd0 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -270,7 +270,7 @@ void GraphNode::_notification(int p_what) { } } - if (resizeable) { + if (resizable) { draw_texture(resizer, get_size() - resizer->get_size()); } } @@ -594,7 +594,7 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) { Ref<Texture> resizer = get_icon("resizer"); - if (resizeable && mpos.x > get_size().x - resizer->get_width() && mpos.y > get_size().y - resizer->get_height()) { + if (resizable && mpos.x > get_size().x - resizer->get_width() && mpos.y > get_size().y - resizer->get_height()) { resizing = true; resizing_from = mpos; @@ -645,15 +645,15 @@ bool GraphNode::is_comment() const { return comment; } -void GraphNode::set_resizeable(bool p_enable) { +void GraphNode::set_resizable(bool p_enable) { - resizeable = p_enable; + resizable = p_enable; update(); } -bool GraphNode::is_resizeable() const { +bool GraphNode::is_resizable() const { - return resizeable; + return resizable; } void GraphNode::_bind_methods() { @@ -678,8 +678,8 @@ void GraphNode::_bind_methods() { ClassDB::bind_method(D_METHOD("set_comment", "comment"), &GraphNode::set_comment); ClassDB::bind_method(D_METHOD("is_comment"), &GraphNode::is_comment); - ClassDB::bind_method(D_METHOD("set_resizeable", "resizeable"), &GraphNode::set_resizeable); - ClassDB::bind_method(D_METHOD("is_resizeable"), &GraphNode::is_resizeable); + ClassDB::bind_method(D_METHOD("set_resizable", "resizable"), &GraphNode::set_resizable); + ClassDB::bind_method(D_METHOD("is_resizable"), &GraphNode::is_resizable); ClassDB::bind_method(D_METHOD("set_selected", "selected"), &GraphNode::set_selected); ClassDB::bind_method(D_METHOD("is_selected"), &GraphNode::is_selected); @@ -702,7 +702,7 @@ void GraphNode::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING, "title"), "set_title", "get_title"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_close"), "set_show_close_button", "is_close_button_visible"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "resizeable"), "set_resizeable", "is_resizeable"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "resizable"), "set_resizable", "is_resizable"); ADD_SIGNAL(MethodInfo("offset_changed")); ADD_SIGNAL(MethodInfo("dragged", PropertyInfo(Variant::VECTOR2, "from"), PropertyInfo(Variant::VECTOR2, "to"))); @@ -722,7 +722,7 @@ GraphNode::GraphNode() { connpos_dirty = true; set_mouse_filter(MOUSE_FILTER_STOP); comment = false; - resizeable = false; + resizable = false; resizing = false; selected = false; } diff --git a/scene/gui/graph_node.h b/scene/gui/graph_node.h index 416d711aab..a606e47acd 100644 --- a/scene/gui/graph_node.h +++ b/scene/gui/graph_node.h @@ -68,7 +68,7 @@ private: bool show_close; Vector2 offset; bool comment; - bool resizeable; + bool resizable; bool resizing; Vector2 resizing_from; @@ -151,8 +151,8 @@ public: void set_comment(bool p_enable); bool is_comment() const; - void set_resizeable(bool p_enable); - bool is_resizeable() const; + void set_resizable(bool p_enable); + bool is_resizable() const; virtual Size2 get_minimum_size() const; diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 9bad871ef9..9a605c98f3 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -151,6 +151,20 @@ Color ItemList::get_item_custom_bg_color(int p_idx) const { return items[p_idx].custom_bg; } +void ItemList::set_item_custom_fg_color(int p_idx, const Color &p_custom_fg_color) { + + ERR_FAIL_INDEX(p_idx, items.size()); + + items[p_idx].custom_fg = p_custom_fg_color; +} + +Color ItemList::get_item_custom_fg_color(int p_idx) const { + + ERR_FAIL_INDEX_V(p_idx, items.size(), Color()); + + return items[p_idx].custom_fg; +} + void ItemList::set_item_tag_icon(int p_idx, const Ref<Texture> &p_tag_icon) { ERR_FAIL_INDEX(p_idx, items.size()); @@ -534,7 +548,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { uint64_t now = OS::get_singleton()->get_ticks_msec(); uint64_t diff = now - search_time_msec; - if (diff < int(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) { + if (diff < uint64_t(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) { for (int i = current - 1; i >= 0; i--) { @@ -569,7 +583,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) { uint64_t now = OS::get_singleton()->get_ticks_msec(); uint64_t diff = now - search_time_msec; - if (diff < int(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) { + if (diff < uint64_t(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) { for (int i = current + 1; i < items.size(); i++) { @@ -1021,7 +1035,7 @@ void ItemList::_notification(int p_what) { else max_len = size.x; - Color modulate = items[i].selected ? font_color_selected : font_color; + Color modulate = items[i].selected ? font_color_selected : (items[i].custom_fg != Color() ? items[i].custom_fg : font_color); if (items[i].disabled) modulate.a *= 0.5; diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h index 8166975408..673b7d8956 100644 --- a/scene/gui/item_list.h +++ b/scene/gui/item_list.h @@ -61,6 +61,7 @@ private: bool tooltip_enabled; Variant metadata; String tooltip; + Color custom_fg; Color custom_bg; Rect2 rect_cache; @@ -150,6 +151,9 @@ public: void set_item_custom_bg_color(int p_idx, const Color &p_custom_bg_color); Color get_item_custom_bg_color(int p_idx) const; + void set_item_custom_fg_color(int p_idx, const Color &p_custom_fg_color); + Color get_item_custom_fg_color(int p_idx) const; + void select(int p_idx, bool p_single = true); void unselect(int p_idx); bool is_selected(int p_idx) const; diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 5ed5463f65..e1f77594da 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -401,7 +401,7 @@ void Label::regenerate_word_cache() { bool separatable = (current >= 0x2E08 && current <= 0xFAFF) || (current >= 0xFE30 && current <= 0xFE4F); //current>=33 && (current < 65||current >90) && (current<97||current>122) && (current<48||current>57); bool insert_newline = false; - int char_width; + int char_width = 0; if (current < 33) { diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 66b4e6cec1..6a5f56c78c 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -631,7 +631,7 @@ void LineEdit::_notification(int p_what) { if (has_icon("right_icon")) { Ref<Texture> r_icon = Control::get_icon("right_icon"); ofs_max -= r_icon->get_width(); - r_icon->draw(ci, Point2(width - r_icon->get_width() - x_ofs, y_ofs), Color(1, 1, 1, disabled_alpha * .9)); + r_icon->draw(ci, Point2(width - r_icon->get_width() - x_ofs, height / 2 - r_icon->get_height() / 2), Color(1, 1, 1, disabled_alpha * .9)); } int caret_height = font->get_height() > y_area ? y_area : font->get_height(); diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index a3f116c883..ab2c2f445f 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -80,6 +80,10 @@ RichTextLabel::Item *RichTextLabel::_get_next_item(Item *p_item, bool p_free) { return NULL; } +Rect2 RichTextLabel::_get_text_rect() { + Ref<StyleBox> style = get_stylebox("normal"); + return Rect2(style->get_offset(), get_size() - style->get_minimum_size()); +} void RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &y, int p_width, int p_line, ProcessMode p_mode, const Ref<Font> &p_base_font, const Color &p_base_color, const Point2i &p_click_pos, Item **r_click_item, int *r_click_char, bool *r_outside, int p_char_count) { RID ci; @@ -583,7 +587,7 @@ void RichTextLabel::_update_scroll() { int total_height = 0; if (main->lines.size()) - total_height = main->lines[main->lines.size() - 1].height_accum_cache; + total_height = main->lines[main->lines.size() - 1].height_accum_cache + get_stylebox("normal")->get_minimum_size().height; bool exceeds = total_height > get_size().height && scroll_active; @@ -641,7 +645,11 @@ void RichTextLabel::_notification(int p_what) { _update_scroll(); RID ci = get_canvas_item(); + Size2 size = get_size(); + Rect2 text_rect = _get_text_rect(); + + draw_style_box(get_stylebox("normal"), Rect2(Point2(), size)); if (has_focus()) { VisualServer::get_singleton()->canvas_item_add_clip_ignore(ci, true); @@ -657,10 +665,10 @@ void RichTextLabel::_notification(int p_what) { int total_chars = 0; while (from_line < main->lines.size()) { - if (main->lines[from_line].height_accum_cache >= ofs) + if (main->lines[from_line].height_accum_cache + _get_text_rect().get_position().y >= ofs) break; - from_line++; total_chars += main->lines[from_line].char_count; + from_line++; } if (from_line >= main->lines.size()) @@ -672,7 +680,7 @@ void RichTextLabel::_notification(int p_what) { while (y < size.height && from_line < main->lines.size()) { - _process_line(main, Point2(), y, size.width - scroll_w, from_line, PROCESS_DRAW, base_font, base_color, Point2i(), NULL, NULL, NULL, total_chars); + _process_line(main, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, from_line, PROCESS_DRAW, base_font, base_color, Point2i(), NULL, NULL, NULL, total_chars); total_chars += main->lines[from_line].char_count; from_line++; } @@ -686,7 +694,7 @@ void RichTextLabel::_find_click(ItemFrame *p_frame, const Point2i &p_click, Item *r_click_item = NULL; Size2 size = get_size(); - + Rect2 text_rect = _get_text_rect(); int ofs = vscroll->get_value(); //todo, change to binary search @@ -706,9 +714,9 @@ void RichTextLabel::_find_click(ItemFrame *p_frame, const Point2i &p_click, Item Ref<Font> base_font = get_font("normal_font"); Color base_color = get_color("default_color"); - while (y < size.height && from_line < p_frame->lines.size()) { + while (y < text_rect.get_size().height && from_line < p_frame->lines.size()) { - _process_line(p_frame, Point2(), y, size.width - scroll_w, from_line, PROCESS_POINTER, base_font, base_color, p_click, r_click_item, r_click_char, r_outside); + _process_line(p_frame, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, from_line, PROCESS_POINTER, base_font, base_color, p_click, r_click_item, r_click_char, r_outside); if (r_click_item && *r_click_item) return; from_line++; @@ -791,7 +799,7 @@ void RichTextLabel::_gui_input(Ref<InputEvent> p_event) { Ref<InputEventKey> k = p_event; if (k.is_valid()) { - if (k->is_pressed() && !k->get_alt() && !k->get_shift() && !k->get_metakey()) { + if (k->is_pressed() && !k->get_alt() && !k->get_shift()) { bool handled = true; switch (k->get_scancode()) { case KEY_PAGEUP: { @@ -1015,13 +1023,14 @@ void RichTextLabel::_validate_line_caches(ItemFrame *p_frame) { //validate invalid lines!s Size2 size = get_size(); + Rect2 text_rect = _get_text_rect(); Ref<Font> base_font = get_font("normal_font"); for (int i = p_frame->first_invalid_line; i < p_frame->lines.size(); i++) { int y = 0; - _process_line(p_frame, Point2(), y, size.width - scroll_w, i, PROCESS_CACHE, base_font, Color()); + _process_line(p_frame, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, i, PROCESS_CACHE, base_font, Color()); p_frame->lines[i].height_cache = y; p_frame->lines[i].height_accum_cache = y; @@ -1031,7 +1040,7 @@ void RichTextLabel::_validate_line_caches(ItemFrame *p_frame) { int total_height = 0; if (p_frame->lines.size()) - total_height = p_frame->lines[p_frame->lines.size() - 1].height_accum_cache; + total_height = p_frame->lines[p_frame->lines.size() - 1].height_accum_cache + get_stylebox("normal")->get_minimum_size().height; main->first_invalid_line = p_frame->lines.size(); diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 74bf180b5d..4db2c3a8e9 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -276,6 +276,8 @@ private: void _gui_input(Ref<InputEvent> p_event); Item *_get_next_item(Item *p_item, bool p_free = false); + Rect2 _get_text_rect(); + bool use_bbcode; String bbcode; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 7b93393851..1738e303aa 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -430,7 +430,7 @@ void TextEdit::_notification(int p_what) { double dist = sqrt(target_y * target_y); double vel = ((target_y / dist) * v_scroll_speed) * get_fixed_process_delta_time(); - if (vel >= dist) { + if (Math::abs(vel) >= dist) { v_scroll->set_value(target_v_scroll); scrolling = false; set_fixed_process(false); @@ -2136,15 +2136,25 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { break; } } - if (auto_indent) { - // indent once again if previous line will end with ':' - // (i.e. colon precedes current cursor position) - if (cursor.column > 0 && text[cursor.line][cursor.column - 1] == ':') { + + bool brace_indent = false; + + // no need to indent if we are going upwards. + if (auto_indent && !(k->get_command() && k->get_shift())) { + // indent once again if previous line will end with ':' or '{' + // (i.e. colon/brace precedes current cursor position) + if (cursor.column > 0 && (text[cursor.line][cursor.column - 1] == ':' || text[cursor.line][cursor.column - 1] == '{')) { if (indent_using_spaces) { ins += space_indent; } else { ins += "\t"; } + + // no need to move the brace below if we are not taking the text with us. + if (text[cursor.line][cursor.column] == '}' && !k->get_command()) { + brace_indent = true; + ins += "\n" + ins.substr(1, ins.length() - 2); + } } } @@ -2168,6 +2178,9 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) { if (first_line) { cursor_set_line(0); + } else if (brace_indent) { + cursor_set_line(cursor.line - 1); + cursor_set_column(text[cursor.line].length()); } } break; @@ -4531,7 +4544,7 @@ String TextEdit::get_word_at_pos(const Vector2 &p_pos) const { bool symbol = beg < s.length() && _is_symbol(s[beg]); //not sure if right but most editors behave like this bool inside_quotes = false; - int qbegin, qend; + int qbegin = 0, qend = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == '"') { if (inside_quotes) { diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 5e15bceb7d..db282262ec 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1116,7 +1116,8 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 cache.selected->draw(ci, r); } if (text_editor->is_visible_in_tree()) { - text_editor->set_position(get_global_position() + r.position); + Vector2 ofs(0, (text_editor->get_size().height - r.size.height) / 2); + text_editor->set_position(get_global_position() + r.position - ofs); } } @@ -2303,7 +2304,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { int col, h, section; TreeItem *it = _find_item_at_pos(root, mpos, col, h, section); - if (drop_mode_flags && it != drop_mode_over || section != drop_mode_section) { + if ((drop_mode_flags && it != drop_mode_over) || section != drop_mode_section) { drop_mode_over = it; drop_mode_section = section; update(); @@ -2477,7 +2478,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { pressing_for_editor = false; blocked++; - bool handled = propagate_mouse_event(pos + cache.offset, 0, 0, b->is_doubleclick(), root, b->get_button_index(), b); + propagate_mouse_event(pos + cache.offset, 0, 0, b->is_doubleclick(), root, b->get_button_index(), b); blocked--; if (pressing_for_editor) { @@ -2572,7 +2573,8 @@ bool Tree::edit_selected() { } else if (c.mode == TreeItem::CELL_MODE_STRING || c.mode == TreeItem::CELL_MODE_RANGE || c.mode == TreeItem::CELL_MODE_RANGE_EXPRESSION) { - Point2i textedpos = get_global_position() + rect.position; + Vector2 ofs(0, (text_editor->get_size().height - rect.size.height) / 2); + Point2i textedpos = get_global_position() + rect.position - ofs; text_editor->set_position(textedpos); text_editor->set_size(rect.size); text_editor->clear(); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 1fb1eb2792..06d6d3ad5a 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -54,7 +54,7 @@ public: CELL_MODE_CHECK, ///< string + check CELL_MODE_RANGE, ///< Contains a range CELL_MODE_RANGE_EXPRESSION, ///< Contains a range - CELL_MODE_ICON, ///< Contains a icon, not editable + CELL_MODE_ICON, ///< Contains an icon, not editable CELL_MODE_CUSTOM, ///< Contains a custom value, show a string, and an edit button }; diff --git a/scene/main/node.cpp b/scene/main/node.cpp index c3d9d97c5a..a30fc03aa9 100755 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -50,7 +50,6 @@ void Node::_notification(int p_notification) { Variant time = get_process_delta_time(); const Variant *ptr[1] = { &time }; - Variant::CallError err; get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_process, ptr, 1); } } break; @@ -60,7 +59,6 @@ void Node::_notification(int p_notification) { Variant time = get_fixed_process_delta_time(); const Variant *ptr[1] = { &time }; - Variant::CallError err; get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_fixed_process, ptr, 1); } @@ -134,7 +132,6 @@ void Node::_notification(int p_notification) { set_fixed_process(true); } - Variant::CallError err; get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_ready, NULL, 0); } //emit_signal(SceneStringNames::get_singleton()->enter_tree); @@ -209,7 +206,6 @@ void Node::_propagate_enter_tree() { if (get_script_instance()) { - Variant::CallError err; get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_enter_tree, NULL, 0); } @@ -273,7 +269,6 @@ void Node::_propagate_exit_tree() { if (get_script_instance()) { - Variant::CallError err; get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_tree, NULL, 0); } emit_signal(SceneStringNames::get_singleton()->tree_exited); @@ -2117,7 +2112,15 @@ Node *Node::_duplicate(int p_flags) const { if (!(p_flags & DUPLICATE_SCRIPTS) && name == "script/script") continue; - node->set(name, get(name)); + Variant value = get(name); + // Duplicate dictionaries and arrays, mainly needed for __meta__ + if (value.get_type() == Variant::DICTIONARY) { + value = Dictionary(value).copy(); + } else if (value.get_type() == Variant::ARRAY) { + value = Array(value).duplicate(); + } + + node->set(name, value); } node->set_name(get_name()); @@ -2199,7 +2202,16 @@ void Node::_duplicate_and_reown(Node *p_new_parent, const Map<Node *, Node *> &p if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) continue; String name = E->get().name; - node->set(name, get(name)); + + Variant value = get(name); + // Duplicate dictionaries and arrays, mainly needed for __meta__ + if (value.get_type() == Variant::DICTIONARY) { + value = Dictionary(value).copy(); + } else if (value.get_type() == Variant::ARRAY) { + value = Array(value).duplicate(); + } + + node->set(name, value); } node->set_name(get_name()); @@ -2657,7 +2669,7 @@ void Node::_bind_methods() { GLOBAL_DEF("node/name_casing", NAME_CASING_PASCAL_CASE); ProjectSettings::get_singleton()->set_custom_property_info("node/name_casing", PropertyInfo(Variant::INT, "node/name_casing", PROPERTY_HINT_ENUM, "PascalCase,camelCase,snake_case")); - ClassDB::bind_method(D_METHOD("_add_child_below_node", "node", "child_node", "legible_unique_name"), &Node::add_child_below_node, DEFVAL(false)); + ClassDB::bind_method(D_METHOD("add_child_below_node", "node", "child_node", "legible_unique_name"), &Node::add_child_below_node, DEFVAL(false)); ClassDB::bind_method(D_METHOD("set_name", "name"), &Node::set_name); ClassDB::bind_method(D_METHOD("get_name"), &Node::get_name); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index a71b491bae..4f62d88934 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -870,7 +870,6 @@ void SceneTree::_call_input_pause(const StringName &p_group, const StringName &p if (!n->can_process()) continue; - Variant::CallError ce; n->call_multilevel(p_method, (const Variant **)v, 1); //ERR_FAIL_COND(node_count != g.nodes.size()); } diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 36dbd14b40..567b1dd7a1 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -491,7 +491,7 @@ void Viewport::_notification(int p_what) { if (physics_object_picking && (to_screen_rect == Rect2() || Input::get_singleton()->get_mouse_mode() != Input::MOUSE_MODE_CAPTURED)) { Vector2 last_pos(1e20, 1e20); - CollisionObject *last_object; + CollisionObject *last_object = NULL; ObjectID last_id = 0; PhysicsDirectSpaceState::RayResult result; Physics2DDirectSpaceState *ss2d = Physics2DServer::get_singleton()->space_get_direct_state(find_world_2d()->get_space()); @@ -604,7 +604,7 @@ void Viewport::_notification(int p_what) { } else if (pos == last_pos) { if (last_id) { - if (ObjectDB::get_instance(last_id)) { + if (ObjectDB::get_instance(last_id) && last_object) { //good, exists last_object->_input_event(camera, ev, result.position, result.normal, result.shape); if (last_object->get_capture_input_on_drag() && mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) { @@ -2578,6 +2578,16 @@ int Viewport::get_render_info(RenderInfo p_info) { return VS::get_singleton()->viewport_get_render_info(viewport, VS::ViewportRenderInfo(p_info)); } +void Viewport::set_snap_controls_to_pixels(bool p_enable) { + + snap_controls_to_pixels = p_enable; +} + +bool Viewport::is_snap_controls_to_pixels_enabled() const { + + return snap_controls_to_pixels; +} + void Viewport::_bind_methods() { ClassDB::bind_method(D_METHOD("set_use_arvr", "use"), &Viewport::set_use_arvr); @@ -2680,6 +2690,9 @@ void Viewport::_bind_methods() { ClassDB::bind_method(D_METHOD("set_shadow_atlas_size", "size"), &Viewport::set_shadow_atlas_size); ClassDB::bind_method(D_METHOD("get_shadow_atlas_size"), &Viewport::get_shadow_atlas_size); + ClassDB::bind_method(D_METHOD("set_snap_controls_to_pixels", "enabled"), &Viewport::set_snap_controls_to_pixels); + ClassDB::bind_method(D_METHOD("is_snap_controls_to_pixels_enabled"), &Viewport::is_snap_controls_to_pixels_enabled); + ClassDB::bind_method(D_METHOD("set_shadow_atlas_quadrant_subdiv", "quadrant", "subdiv"), &Viewport::set_shadow_atlas_quadrant_subdiv); ClassDB::bind_method(D_METHOD("get_shadow_atlas_quadrant_subdiv", "quadrant"), &Viewport::get_shadow_atlas_quadrant_subdiv); @@ -2707,6 +2720,7 @@ void Viewport::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "physics_object_picking"), "set_physics_object_picking", "get_physics_object_picking"); ADD_GROUP("GUI", "gui_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "gui_disable_input"), "set_disable_input", "is_input_disabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "gui_snap_controls_to_pixels"), "set_snap_controls_to_pixels", "is_snap_controls_to_pixels_enabled"); ADD_GROUP("Shadow Atlas", "shadow_atlas_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_atlas_size"), "set_shadow_atlas_size", "get_shadow_atlas_size"); ADD_PROPERTYI(PropertyInfo(Variant::INT, "shadow_atlas_quad_0", PROPERTY_HINT_ENUM, "Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), "set_shadow_atlas_quadrant_subdiv", "get_shadow_atlas_quadrant_subdiv", 0); @@ -2822,6 +2836,8 @@ Viewport::Viewport() { usage = USAGE_3D; debug_draw = DEBUG_DRAW_DISABLED; clear_mode = CLEAR_MODE_ALWAYS; + + snap_controls_to_pixels = true; } Viewport::~Viewport() { diff --git a/scene/main/viewport.h b/scene/main/viewport.h index ce2bc991f5..6bbd4b26b5 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -1,3 +1,4 @@ + /*************************************************************************/ /* viewport.h */ /*************************************************************************/ @@ -193,6 +194,8 @@ private: bool filter; bool gen_mipmaps; + bool snap_controls_to_pixels; + bool physics_object_picking; List<Ref<InputEvent> > physics_picking_events; ObjectID physics_object_capture; @@ -463,6 +466,9 @@ public: int get_render_info(RenderInfo p_info); + void set_snap_controls_to_pixels(bool p_enable); + bool is_snap_controls_to_pixels_enabled() const; + Viewport(); ~Viewport(); }; diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index e01f5e3cdf..9ed3734a36 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -66,7 +66,6 @@ #include "scene/audio/audio_player.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" -#include "scene/gui/button_group.h" #include "scene/gui/center_container.h" #include "scene/gui/check_box.h" #include "scene/gui/check_button.h" @@ -378,6 +377,7 @@ void register_scene_types() { ClassDB::register_virtual_class<CollisionObject>(); ClassDB::register_class<StaticBody>(); ClassDB::register_class<RigidBody>(); + ClassDB::register_class<KinematicCollision>(); ClassDB::register_class<KinematicBody>(); ClassDB::register_class<VehicleBody>(); diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 1a2c8333ef..eae95d9247 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -970,7 +970,12 @@ int Animation::_find(const Vector<K> &p_keys, float p_time) const { int low = 0; int high = len - 1; - int middle; + int middle = 0; + +#if DEBUG_ENABLED + if (low > high) + ERR_PRINT("low > high, this may be a bug"); +#endif const K *keys = &p_keys[0]; @@ -1289,7 +1294,7 @@ Error Animation::transform_track_interpolate(int p_track, float p_time, Vector3 TransformTrack *tt = static_cast<TransformTrack *>(t); - bool ok; + bool ok = false; TransformKey tk = _interpolate(tt->transforms, p_time, tt->interpolation, tt->loop_wrap, &ok); @@ -1315,7 +1320,7 @@ Variant Animation::value_track_interpolate(int p_track, float p_time) const { ERR_FAIL_COND_V(t->type != TYPE_VALUE, Variant()); ValueTrack *vt = static_cast<ValueTrack *>(t); - bool ok; + bool ok = false; Variant res = _interpolate(vt->values, p_time, vt->update_mode == UPDATE_CONTINUOUS ? vt->interpolation : INTERPOLATION_NEAREST, vt->loop_wrap, &ok); diff --git a/scene/resources/color_ramp.h b/scene/resources/color_ramp.h index 816152d51f..316c188d59 100644 --- a/scene/resources/color_ramp.h +++ b/scene/resources/color_ramp.h @@ -88,7 +88,12 @@ public: //binary search int low = 0; int high = points.size() - 1; - int middle; + int middle = 0; + +#if DEBUG_ENABLED + if (low > high) + ERR_PRINT("low > high, this may be a bug"); +#endif while (low <= high) { middle = (low + high) / 2; diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 7fbaa1f73c..2e89a739bd 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -84,15 +84,6 @@ int Curve::add_point(Vector2 p_pos, real_t left_tangent, real_t right_tangent, T int i = get_index(p_pos.x); - int nearest_index = i; - if (i + 1 < _points.size()) { - real_t diff0 = p_pos.x - _points[i].pos.x; - real_t diff1 = _points[i + 1].pos.x - p_pos.x; - - if (diff1 < diff0) - nearest_index = i + 1; - } - if (i == 0 && p_pos.x < _points[0].pos.x) { // Insert before anything else _points.insert(0, Point(p_pos, left_tangent, right_tangent, left_mode, right_mode)); @@ -331,18 +322,19 @@ real_t Curve::interpolate_local_nocheck(int index, real_t local_offset) const { const Point a = _points[index]; const Point b = _points[index + 1]; - // Cubic bezier - - // ac-----bc - // / \ - // / \ Here with a.right_tangent > 0 - // / \ and b.left_tangent < 0 - // / \ - // a b - // - // |-d1--|-d2--|-d3--| - // - // d1 == d2 == d3 == d / 3 + /* Cubic bezier + * + * ac-----bc + * / \ + * / \ Here with a.right_tangent > 0 + * / \ and b.left_tangent < 0 + * / \ + * a b + * + * |-d1--|-d2--|-d3--| + * + * d1 == d2 == d3 == d / 3 + */ // Control points are chosen at equal distances real_t d = b.pos.x - a.pos.x; diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 4ff635edeb..fdea5960e5 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -794,6 +794,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const // RichTextLabel theme->set_stylebox("focus", "RichTextLabel", focus); + theme->set_stylebox("normal", "RichTextLabel", make_stylebox(tree_bg_png, 3, 3, 3, 3)); theme->set_font("normal_font", "RichTextLabel", default_font); theme->set_font("bold_font", "RichTextLabel", default_font); diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 14225d945d..da3bc6a95b 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -269,13 +269,13 @@ Ref<Texture> Environment::get_adjustment_color_correction() const { void Environment::_validate_property(PropertyInfo &property) const { if (property.name == "background_sky" || property.name == "background_sky_scale" || property.name == "ambient_light/sky_contribution") { - if (bg_mode != BG_SKY) { + if (bg_mode != BG_SKY && bg_mode != BG_COLOR_SKY) { property.usage = PROPERTY_USAGE_NOEDITOR; } } if (property.name == "background_color") { - if (bg_mode != BG_COLOR) { + if (bg_mode != BG_COLOR && bg_mode != BG_COLOR_SKY) { property.usage = PROPERTY_USAGE_NOEDITOR; } } @@ -839,7 +839,7 @@ void Environment::_bind_methods() { ClassDB::bind_method(D_METHOD("get_ambient_light_sky_contribution"), &Environment::get_ambient_light_sky_contribution); ADD_GROUP("Background", "background_"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "background_mode", PROPERTY_HINT_ENUM, "Clear Color,Custom Color,Sky,Canvas,Keep"), "set_background", "get_background"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "background_mode", PROPERTY_HINT_ENUM, "Clear Color,Custom Color,Sky,Color+Sky,Canvas,Keep"), "set_background", "get_background"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "background_sky", PROPERTY_HINT_RESOURCE_TYPE, "Sky"), "set_sky", "get_sky"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "background_sky_scale", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_sky_scale", "get_sky_scale"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "background_color"), "set_bg_color", "get_bg_color"); @@ -1118,6 +1118,7 @@ void Environment::_bind_methods() { BIND_ENUM_CONSTANT(BG_CLEAR_COLOR); BIND_ENUM_CONSTANT(BG_COLOR); BIND_ENUM_CONSTANT(BG_SKY); + BIND_ENUM_CONSTANT(BG_COLOR_SKY); BIND_ENUM_CONSTANT(BG_CANVAS); BIND_ENUM_CONSTANT(BG_MAX); diff --git a/scene/resources/environment.h b/scene/resources/environment.h index 6337981b95..9046ec1e49 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -45,6 +45,7 @@ public: BG_CLEAR_COLOR, BG_COLOR, BG_SKY, + BG_COLOR_SKY, BG_CANVAS, BG_KEEP, BG_MAX diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index d9ccd31f88..ea75748b3d 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -40,7 +40,7 @@ void Font::draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, f return; } - float ofs; + float ofs = 0.f; switch (p_align) { case HALIGN_LEFT: { ofs = 0; @@ -51,6 +51,9 @@ void Font::draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, f case HALIGN_RIGHT: { ofs = p_width - length; } break; + default: { + ERR_PRINT("Unknown halignment type"); + } break; } draw(p_canvas_item, p_pos + Point2(ofs, 0), p_text, p_modulate, p_width); } diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 63b7fe4a86..abe9a00c3f 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -65,6 +65,12 @@ RID Material::get_rid() const { return material; } +void Material::_validate_property(PropertyInfo &property) const { + + if (!_can_do_next_pass() && property.name == "next_pass") { + property.usage = 0; + } +} void Material::_bind_methods() { @@ -74,7 +80,7 @@ void Material::_bind_methods() { ClassDB::bind_method(D_METHOD("set_render_priority", "priority"), &Material::set_render_priority); ClassDB::bind_method(D_METHOD("get_render_priority"), &Material::get_render_priority); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "render_priority", PROPERTY_HINT_RANGE, itos(RENDER_PRIORITY_MIN) + "," + itos(RENDER_PRIORITY_MAX) + ",1"), "set_render_priority", "get_render_priority"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "render_priority", PROPERTY_HINT_RANGE, itos(RENDER_PRIORITY_MIN) + "," + itos(RENDER_PRIORITY_MAX) + ",1"), "set_render_priority", "get_render_priority"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "next_pass", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_next_pass", "get_next_pass"); BIND_CONSTANT(RENDER_PRIORITY_MAX); @@ -204,6 +210,11 @@ void ShaderMaterial::get_argument_options(const StringName &p_function, int p_id Resource::get_argument_options(p_function, p_idx, r_options); } +bool ShaderMaterial::_can_do_next_pass() const { + + return shader.is_valid() && shader->get_mode() == Shader::MODE_SPATIAL; +} + ShaderMaterial::ShaderMaterial() { } @@ -239,6 +250,7 @@ void SpatialMaterial::init_shaders() { shader_names->anisotropy = "anisotropy_ratio"; shader_names->depth_scale = "depth_scale"; shader_names->subsurface_scattering_strength = "subsurface_scattering_strength"; + shader_names->transmission = "transmission"; shader_names->refraction = "refraction"; shader_names->point_size = "point_size"; shader_names->uv1_scale = "uv1_scale"; @@ -276,6 +288,7 @@ void SpatialMaterial::init_shaders() { shader_names->texture_names[TEXTURE_AMBIENT_OCCLUSION] = "texture_ambient_occlusion"; shader_names->texture_names[TEXTURE_DEPTH] = "texture_depth"; shader_names->texture_names[TEXTURE_SUBSURFACE_SCATTERING] = "texture_subsurface_scattering"; + shader_names->texture_names[TEXTURE_TRANSMISSION] = "texture_transmission"; shader_names->texture_names[TEXTURE_REFRACTION] = "texture_refraction"; shader_names->texture_names[TEXTURE_DETAIL_MASK] = "texture_detail_mask"; shader_names->texture_names[TEXTURE_DETAIL_ALBEDO] = "texture_detail_albedo"; @@ -352,7 +365,7 @@ void SpatialMaterial::_update_shader() { } switch (diffuse_mode) { case DIFFUSE_LAMBERT: code += ",diffuse_lambert"; break; - case DIFFUSE_HALF_LAMBERT: code += ",diffuse_half_lambert"; break; + case DIFFUSE_LAMBERT_WRAP: code += ",diffuse_lambert_wrap"; break; case DIFFUSE_OREN_NAYAR: code += ",diffuse_oren_nayar"; break; case DIFFUSE_BURLEY: code += ",diffuse_burley"; break; case DIFFUSE_TOON: code += ",diffuse_toon"; break; @@ -375,7 +388,7 @@ void SpatialMaterial::_update_shader() { code += ",vertex_lighting"; } - if (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR]) { + if (flags[FLAG_TRIPLANAR_USE_WORLD] && (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR])) { code += ",world_vertex_coords"; } code += ";\n"; @@ -451,6 +464,12 @@ void SpatialMaterial::_update_shader() { code += "uniform sampler2D texture_subsurface_scattering : hint_white;\n"; } + if (features[FEATURE_TRANSMISSION]) { + + code += "uniform vec4 transmission : hint_color;\n"; + code += "uniform sampler2D texture_transmission : hint_black;\n"; + } + if (features[FEATURE_DEPTH_MAPPING]) { code += "uniform sampler2D texture_depth : hint_black;\n"; code += "uniform float depth_scale;\n"; @@ -458,10 +477,10 @@ void SpatialMaterial::_update_shader() { code += "uniform int depth_max_layers;\n"; } if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "varying vec3 uv1_world_pos;\n"; + code += "varying vec3 uv1_triplanar_pos;\n"; } if (flags[FLAG_UV2_USE_TRIPLANAR]) { - code += "varying vec3 uv2_world_pos;\n"; + code += "varying vec3 uv2_triplanar_pos;\n"; } if (flags[FLAG_UV1_USE_TRIPLANAR]) { code += "uniform float uv1_blend_sharpness;\n"; @@ -570,16 +589,16 @@ void SpatialMaterial::_update_shader() { code += "\tuv1_power_normal=pow(abs(NORMAL),vec3(uv1_blend_sharpness));\n"; code += "\tuv1_power_normal/=dot(uv1_power_normal,vec3(1.0));\n"; - code += "\tuv1_world_pos = VERTEX * uv1_scale + uv1_offset;\n"; - code += "\tuv1_world_pos *= vec3(1.0,-1.0, 1.0);\n"; + code += "\tuv1_triplanar_pos = VERTEX * uv1_scale + uv1_offset;\n"; + code += "\tuv1_triplanar_pos *= vec3(1.0,-1.0, 1.0);\n"; } if (flags[FLAG_UV2_USE_TRIPLANAR]) { code += "\tuv2_power_normal=pow(abs(NORMAL), vec3(uv2_blend_sharpness));\n"; code += "\tuv2_power_normal/=dot(uv2_power_normal,vec3(1.0));\n"; - code += "\tuv2_world_pos = VERTEX * uv2_scale + uv2_offset;\n"; - code += "\tuv2_world_pos *= vec3(1.0,-1.0, 1.0);\n"; + code += "\tuv2_triplanar_pos = VERTEX * uv2_scale + uv2_offset;\n"; + code += "\tuv2_triplanar_pos *= vec3(1.0,-1.0, 1.0);\n"; } if (grow_enabled) { @@ -589,11 +608,11 @@ void SpatialMaterial::_update_shader() { code += "}\n"; code += "\n\n"; if (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR]) { - code += "vec4 triplanar_texture(sampler2D p_sampler,vec3 p_weights,vec3 p_world_pos) {\n"; + code += "vec4 triplanar_texture(sampler2D p_sampler,vec3 p_weights,vec3 p_triplanar_pos) {\n"; code += "\tvec4 samp=vec4(0.0);\n"; - code += "\tsamp+= texture(p_sampler,p_world_pos.xy) * p_weights.z;\n"; - code += "\tsamp+= texture(p_sampler,p_world_pos.xz) * p_weights.y;\n"; - code += "\tsamp+= texture(p_sampler,p_world_pos.zy * vec2(-1.0,1.0)) * p_weights.x;\n"; + code += "\tsamp+= texture(p_sampler,p_triplanar_pos.xy) * p_weights.z;\n"; + code += "\tsamp+= texture(p_sampler,p_triplanar_pos.xz) * p_weights.y;\n"; + code += "\tsamp+= texture(p_sampler,p_triplanar_pos.zy * vec2(-1.0,1.0)) * p_weights.x;\n"; code += "\treturn samp;\n"; code += "}\n"; } @@ -649,7 +668,7 @@ void SpatialMaterial::_update_shader() { code += "\tvec4 albedo_tex = texture(texture_albedo,POINT_COORD);\n"; } else { if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tvec4 albedo_tex = triplanar_texture(texture_albedo,uv1_power_normal,uv1_world_pos);\n"; + code += "\tvec4 albedo_tex = triplanar_texture(texture_albedo,uv1_power_normal,uv1_triplanar_pos);\n"; } else { code += "\tvec4 albedo_tex = texture(texture_albedo,base_uv);\n"; } @@ -661,13 +680,13 @@ void SpatialMaterial::_update_shader() { code += "\tALBEDO = albedo.rgb * albedo_tex.rgb;\n"; if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tfloat metallic_tex = dot(triplanar_texture(texture_metallic,uv1_power_normal,uv1_world_pos),metallic_texture_channel);\n"; + code += "\tfloat metallic_tex = dot(triplanar_texture(texture_metallic,uv1_power_normal,uv1_triplanar_pos),metallic_texture_channel);\n"; } else { code += "\tfloat metallic_tex = dot(texture(texture_metallic,base_uv),metallic_texture_channel);\n"; } code += "\tMETALLIC = metallic_tex * metallic;\n"; if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tfloat roughness_tex = dot(triplanar_texture(texture_roughness,uv1_power_normal,uv1_world_pos),roughness_texture_channel);\n"; + code += "\tfloat roughness_tex = dot(triplanar_texture(texture_roughness,uv1_power_normal,uv1_triplanar_pos),roughness_texture_channel);\n"; } else { code += "\tfloat roughness_tex = dot(texture(texture_roughness,base_uv),roughness_texture_channel);\n"; } @@ -676,7 +695,7 @@ void SpatialMaterial::_update_shader() { if (features[FEATURE_NORMAL_MAPPING]) { if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tNORMALMAP = triplanar_texture(texture_normal,uv1_power_normal,uv1_world_pos).rgb;\n"; + code += "\tNORMALMAP = triplanar_texture(texture_normal,uv1_power_normal,uv1_triplanar_pos).rgb;\n"; } else { code += "\tNORMALMAP = texture(texture_normal,base_uv).rgb;\n"; } @@ -685,7 +704,7 @@ void SpatialMaterial::_update_shader() { if (features[FEATURE_EMISSION]) { if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tvec3 emission_tex = triplanar_texture(texture_emission,uv1_power_normal,uv1_world_pos).rgb;\n"; + code += "\tvec3 emission_tex = triplanar_texture(texture_emission,uv1_power_normal,uv1_triplanar_pos).rgb;\n"; } else { code += "\tvec3 emission_tex = texture(texture_emission,base_uv).rgb;\n"; } @@ -712,7 +731,7 @@ void SpatialMaterial::_update_shader() { if (features[FEATURE_RIM]) { if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tvec2 rim_tex = triplanar_texture(texture_rim,uv1_power_normal,uv1_world_pos).xy;\n"; + code += "\tvec2 rim_tex = triplanar_texture(texture_rim,uv1_power_normal,uv1_triplanar_pos).xy;\n"; } else { code += "\tvec2 rim_tex = texture(texture_rim,base_uv).xy;\n"; } @@ -722,7 +741,7 @@ void SpatialMaterial::_update_shader() { if (features[FEATURE_CLEARCOAT]) { if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tvec2 clearcoat_tex = triplanar_texture(texture_clearcoat,uv1_power_normal,uv1_world_pos).xy;\n"; + code += "\tvec2 clearcoat_tex = triplanar_texture(texture_clearcoat,uv1_power_normal,uv1_triplanar_pos).xy;\n"; } else { code += "\tvec2 clearcoat_tex = texture(texture_clearcoat,base_uv).xy;\n"; } @@ -732,7 +751,7 @@ void SpatialMaterial::_update_shader() { if (features[FEATURE_ANISOTROPY]) { if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tvec3 anisotropy_tex = triplanar_texture(texture_flowmap,uv1_power_normal,uv1_world_pos).rga;\n"; + code += "\tvec3 anisotropy_tex = triplanar_texture(texture_flowmap,uv1_power_normal,uv1_triplanar_pos).rga;\n"; } else { code += "\tvec3 anisotropy_tex = texture(texture_flowmap,base_uv).rga;\n"; } @@ -743,13 +762,13 @@ void SpatialMaterial::_update_shader() { if (features[FEATURE_AMBIENT_OCCLUSION]) { if (flags[FLAG_AO_ON_UV2]) { if (flags[FLAG_UV2_USE_TRIPLANAR]) { - code += "\tAO = dot(triplanar_texture(texture_ambient_occlusion,uv2_power_normal,uv2_world_pos),ao_texture_channel);\n"; + code += "\tAO = dot(triplanar_texture(texture_ambient_occlusion,uv2_power_normal,uv2_triplanar_pos),ao_texture_channel);\n"; } else { code += "\tAO = dot(texture(texture_ambient_occlusion,base_uv2),ao_texture_channel);\n"; } } else { if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tAO = dot(triplanar_texture(texture_ambient_occlusion,uv1_power_normal,uv1_world_pos),ao_texture_channel);\n"; + code += "\tAO = dot(triplanar_texture(texture_ambient_occlusion,uv1_power_normal,uv1_triplanar_pos),ao_texture_channel);\n"; } else { code += "\tAO = dot(texture(texture_ambient_occlusion,base_uv),ao_texture_channel);\n"; } @@ -759,21 +778,30 @@ void SpatialMaterial::_update_shader() { if (features[FEATURE_SUBSURACE_SCATTERING]) { if (flags[FLAG_UV1_USE_TRIPLANAR]) { - code += "\tfloat sss_tex = triplanar_texture(texture_subsurface_scattering,uv1_power_normal,uv1_world_pos).r;\n"; + code += "\tfloat sss_tex = triplanar_texture(texture_subsurface_scattering,uv1_power_normal,uv1_triplanar_pos).r;\n"; } else { code += "\tfloat sss_tex = texture(texture_subsurface_scattering,base_uv).r;\n"; } code += "\tSSS_STRENGTH=subsurface_scattering_strength*sss_tex;\n"; } + if (features[FEATURE_TRANSMISSION]) { + if (flags[FLAG_UV1_USE_TRIPLANAR]) { + code += "\tvec3 transmission_tex = triplanar_texture(texture_transmission,uv1_power_normal,uv1_triplanar_pos).rgb;\n"; + } else { + code += "\tvec3 transmission_tex = texture(texture_transmission,base_uv).rgb;\n"; + } + code += "\tTRANSMISSION = (transmission.rgb+transmission_tex);\n"; + } + if (features[FEATURE_DETAIL]) { bool triplanar = (flags[FLAG_UV1_USE_TRIPLANAR] && detail_uv == DETAIL_UV_1) || (flags[FLAG_UV2_USE_TRIPLANAR] && detail_uv == DETAIL_UV_2); if (triplanar) { String tp_uv = detail_uv == DETAIL_UV_1 ? "uv1" : "uv2"; - code += "\tvec4 detail_tex = triplanar_texture(texture_detail_albedo," + tp_uv + "_power_normal," + tp_uv + "_world_pos);\n"; - code += "\tvec4 detail_norm_tex = triplanar_texture(texture_detail_normal," + tp_uv + "_power_normal," + tp_uv + "_world_pos);\n"; + code += "\tvec4 detail_tex = triplanar_texture(texture_detail_albedo," + tp_uv + "_power_normal," + tp_uv + "_triplanar_pos);\n"; + code += "\tvec4 detail_norm_tex = triplanar_texture(texture_detail_normal," + tp_uv + "_power_normal," + tp_uv + "_triplanar_pos);\n"; } else { String det_uv = detail_uv == DETAIL_UV_1 ? "base_uv" : "base_uv2"; @@ -1015,6 +1043,17 @@ float SpatialMaterial::get_subsurface_scattering_strength() const { return subsurface_scattering_strength; } +void SpatialMaterial::set_transmission(const Color &p_transmission) { + + transmission = p_transmission; + VS::get_singleton()->material_set_param(_get_material(), shader_names->transmission, transmission); +} + +Color SpatialMaterial::get_transmission() const { + + return transmission; +} + void SpatialMaterial::set_refraction(float p_refraction) { refraction = p_refraction; @@ -1180,6 +1219,7 @@ void SpatialMaterial::_validate_property(PropertyInfo &property) const { _validate_feature("ao", FEATURE_AMBIENT_OCCLUSION, property); _validate_feature("depth", FEATURE_DEPTH_MAPPING, property); _validate_feature("subsurf_scatter", FEATURE_SUBSURACE_SCATTERING, property); + _validate_feature("transmission", FEATURE_TRANSMISSION, property); _validate_feature("refraction", FEATURE_REFRACTION, property); _validate_feature("detail", FEATURE_DETAIL, property); @@ -1530,6 +1570,9 @@ void SpatialMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_subsurface_scattering_strength", "strength"), &SpatialMaterial::set_subsurface_scattering_strength); ClassDB::bind_method(D_METHOD("get_subsurface_scattering_strength"), &SpatialMaterial::get_subsurface_scattering_strength); + ClassDB::bind_method(D_METHOD("set_transmission", "transmission"), &SpatialMaterial::set_transmission); + ClassDB::bind_method(D_METHOD("get_transmission"), &SpatialMaterial::get_transmission); + ClassDB::bind_method(D_METHOD("set_refraction", "refraction"), &SpatialMaterial::set_refraction); ClassDB::bind_method(D_METHOD("get_refraction"), &SpatialMaterial::get_refraction); @@ -1635,6 +1678,7 @@ void SpatialMaterial::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_vertex_lighting"), "set_flag", "get_flag", FLAG_USE_VERTEX_LIGHTING); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_no_depth_test"), "set_flag", "get_flag", FLAG_DISABLE_DEPTH_TEST); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_use_point_size"), "set_flag", "get_flag", FLAG_USE_POINT_SIZE); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_world_triplanar"), "set_flag", "get_flag", FLAG_TRIPLANAR_USE_WORLD); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_fixed_size"), "set_flag", "get_flag", FLAG_FIXED_SIZE); ADD_GROUP("Vertex Color", "vertex_color"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "vertex_color_use_as_albedo"), "set_flag", "get_flag", FLAG_ALBEDO_FROM_VERTEX_COLOR); @@ -1720,6 +1764,11 @@ void SpatialMaterial::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "subsurf_scatter_strength", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_subsurface_scattering_strength", "get_subsurface_scattering_strength"); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "subsurf_scatter_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_SUBSURFACE_SCATTERING); + ADD_GROUP("Transmission", "transmission_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "transmission_enabled"), "set_feature", "get_feature", FEATURE_TRANSMISSION); + ADD_PROPERTY(PropertyInfo(Variant::COLOR, "transmission", PROPERTY_HINT_COLOR_NO_ALPHA), "set_transmission", "get_transmission"); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "transmission_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_TRANSMISSION); + ADD_GROUP("Refraction", "refraction_"); ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "refraction_enabled"), "set_feature", "get_feature", FEATURE_REFRACTION); ADD_PROPERTY(PropertyInfo(Variant::REAL, "refraction_scale", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_refraction", "get_refraction"); @@ -1757,6 +1806,7 @@ void SpatialMaterial::_bind_methods() { BIND_ENUM_CONSTANT(TEXTURE_AMBIENT_OCCLUSION); BIND_ENUM_CONSTANT(TEXTURE_DEPTH); BIND_ENUM_CONSTANT(TEXTURE_SUBSURFACE_SCATTERING); + BIND_ENUM_CONSTANT(TEXTURE_TRANSMISSION); BIND_ENUM_CONSTANT(TEXTURE_REFRACTION); BIND_ENUM_CONSTANT(TEXTURE_DETAIL_MASK); BIND_ENUM_CONSTANT(TEXTURE_DETAIL_ALBEDO); @@ -1775,6 +1825,7 @@ void SpatialMaterial::_bind_methods() { BIND_ENUM_CONSTANT(FEATURE_AMBIENT_OCCLUSION); BIND_ENUM_CONSTANT(FEATURE_DEPTH_MAPPING); BIND_ENUM_CONSTANT(FEATURE_SUBSURACE_SCATTERING); + BIND_ENUM_CONSTANT(FEATURE_TRANSMISSION); BIND_ENUM_CONSTANT(FEATURE_REFRACTION); BIND_ENUM_CONSTANT(FEATURE_DETAIL); BIND_ENUM_CONSTANT(FEATURE_MAX); @@ -1804,10 +1855,11 @@ void SpatialMaterial::_bind_methods() { BIND_ENUM_CONSTANT(FLAG_UV2_USE_TRIPLANAR); BIND_ENUM_CONSTANT(FLAG_AO_ON_UV2); BIND_ENUM_CONSTANT(FLAG_USE_ALPHA_SCISSOR); + BIND_ENUM_CONSTANT(FLAG_TRIPLANAR_USE_WORLD); BIND_ENUM_CONSTANT(FLAG_MAX); BIND_ENUM_CONSTANT(DIFFUSE_LAMBERT); - BIND_ENUM_CONSTANT(DIFFUSE_HALF_LAMBERT); + BIND_ENUM_CONSTANT(DIFFUSE_LAMBERT_WRAP); BIND_ENUM_CONSTANT(DIFFUSE_OREN_NAYAR); BIND_ENUM_CONSTANT(DIFFUSE_BURLEY); BIND_ENUM_CONSTANT(DIFFUSE_TOON); @@ -1848,6 +1900,7 @@ SpatialMaterial::SpatialMaterial() set_anisotropy(0); set_depth_scale(0.05); set_subsurface_scattering_strength(0); + set_transmission(Color(0, 0, 0)); set_refraction(0.05); set_line_width(1); set_point_size(1); diff --git a/scene/resources/material.h b/scene/resources/material.h index 4977e5dd70..fdb11982a8 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -53,6 +53,9 @@ class Material : public Resource { protected: _FORCE_INLINE_ RID _get_material() const { return material; } static void _bind_methods(); + virtual bool _can_do_next_pass() const { return false; } + + void _validate_property(PropertyInfo &property) const; public: enum { @@ -84,6 +87,8 @@ protected: void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const; + virtual bool _can_do_next_pass() const; + public: void set_shader(const Ref<Shader> &p_shader); Ref<Shader> get_shader() const; @@ -112,6 +117,7 @@ public: TEXTURE_AMBIENT_OCCLUSION, TEXTURE_DEPTH, TEXTURE_SUBSURFACE_SCATTERING, + TEXTURE_TRANSMISSION, TEXTURE_REFRACTION, TEXTURE_DETAIL_MASK, TEXTURE_DETAIL_ALBEDO, @@ -135,6 +141,7 @@ public: FEATURE_AMBIENT_OCCLUSION, FEATURE_DEPTH_MAPPING, FEATURE_SUBSURACE_SCATTERING, + FEATURE_TRANSMISSION, FEATURE_REFRACTION, FEATURE_DETAIL, FEATURE_MAX @@ -171,6 +178,7 @@ public: FLAG_FIXED_SIZE, FLAG_UV1_USE_TRIPLANAR, FLAG_UV2_USE_TRIPLANAR, + FLAG_TRIPLANAR_USE_WORLD, FLAG_AO_ON_UV2, FLAG_USE_ALPHA_SCISSOR, FLAG_MAX @@ -178,7 +186,7 @@ public: enum DiffuseMode { DIFFUSE_LAMBERT, - DIFFUSE_HALF_LAMBERT, + DIFFUSE_LAMBERT_WRAP, DIFFUSE_OREN_NAYAR, DIFFUSE_BURLEY, DIFFUSE_TOON, @@ -211,12 +219,12 @@ private: union MaterialKey { struct { - uint64_t feature_mask : 11; + uint64_t feature_mask : 12; uint64_t detail_uv : 1; uint64_t blend_mode : 2; uint64_t depth_draw_mode : 2; uint64_t cull_mode : 2; - uint64_t flags : 11; + uint64_t flags : 12; uint64_t detail_blend_mode : 2; uint64_t diffuse_mode : 3; uint64_t specular_mode : 2; @@ -285,6 +293,7 @@ private: StringName anisotropy; StringName depth_scale; StringName subsurface_scattering_strength; + StringName transmission; StringName refraction; StringName point_size; StringName uv1_scale; @@ -336,6 +345,7 @@ private: float anisotropy; float depth_scale; float subsurface_scattering_strength; + Color transmission; float refraction; float line_width; float point_size; @@ -389,6 +399,7 @@ private: protected: static void _bind_methods(); void _validate_property(PropertyInfo &property) const; + virtual bool _can_do_next_pass() const { return true; } public: void set_albedo(const Color &p_albedo); @@ -442,6 +453,9 @@ public: void set_subsurface_scattering_strength(float p_subsurface_scattering_strength); float get_subsurface_scattering_strength() const; + void set_transmission(const Color &p_transmission); + Color get_transmission() const; + void set_refraction(float p_refraction); float get_refraction() const; diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index aa7827a61a..04efe88102 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -761,7 +761,7 @@ Array ArrayMesh::surface_get_arrays(int p_surface) const { Array ArrayMesh::surface_get_blend_shape_arrays(int p_surface) const { ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Array()); - return Array(); + return VisualServer::get_singleton()->mesh_surface_get_blend_shape_arrays(mesh, p_surface); } int ArrayMesh::get_surface_count() const { @@ -1010,6 +1010,8 @@ void ArrayMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("surface_get_material", "surf_idx"), &ArrayMesh::surface_get_material); ClassDB::bind_method(D_METHOD("surface_set_name", "surf_idx", "name"), &ArrayMesh::surface_set_name); ClassDB::bind_method(D_METHOD("surface_get_name", "surf_idx"), &ArrayMesh::surface_get_name); + ClassDB::bind_method(D_METHOD("surface_get_arrays", "surf_idx"), &ArrayMesh::surface_get_arrays); + ClassDB::bind_method(D_METHOD("surface_get_blend_shape_arrays", "surf_idx"), &ArrayMesh::surface_get_blend_shape_arrays); ClassDB::bind_method(D_METHOD("create_trimesh_shape"), &ArrayMesh::create_trimesh_shape); ClassDB::bind_method(D_METHOD("create_convex_shape"), &ArrayMesh::create_convex_shape); ClassDB::bind_method(D_METHOD("create_outline", "margin"), &ArrayMesh::create_outline); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index 53c6eb2d89..f4edb258b6 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -120,6 +120,7 @@ public: virtual int surface_get_array_len(int p_idx) const = 0; virtual int surface_get_array_index_len(int p_idx) const = 0; virtual Array surface_get_arrays(int p_surface) const = 0; + virtual Array surface_get_blend_shape_arrays(int p_surface) const = 0; virtual uint32_t surface_get_format(int p_idx) const = 0; virtual PrimitiveType surface_get_primitive_type(int p_idx) const = 0; virtual Ref<Material> surface_get_material(int p_idx) const = 0; @@ -174,7 +175,7 @@ public: void add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const Rect3 &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes = Vector<PoolVector<uint8_t> >(), const Vector<Rect3> &p_bone_aabbs = Vector<Rect3>()); Array surface_get_arrays(int p_surface) const; - virtual Array surface_get_blend_shape_arrays(int p_surface) const; + Array surface_get_blend_shape_arrays(int p_surface) const; void add_blend_shape(const StringName &p_name); int get_blend_shape_count() const; diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp index 4e1ffd2ab3..833a4c3d22 100644 --- a/scene/resources/mesh_library.cpp +++ b/scene/resources/mesh_library.cpp @@ -214,7 +214,7 @@ Vector<int> MeshLibrary::get_item_list() const { return ret; } -int MeshLibrary::find_item_name(const String &p_name) const { +int MeshLibrary::find_item_by_name(const String &p_name) const { for (Map<int, Item>::Element *E = item_map.front(); E; E = E->next()) { @@ -275,6 +275,8 @@ void MeshLibrary::_bind_methods() { ClassDB::bind_method(D_METHOD("get_item_shapes", "id"), &MeshLibrary::_get_item_shapes); ClassDB::bind_method(D_METHOD("get_item_preview", "id"), &MeshLibrary::get_item_preview); ClassDB::bind_method(D_METHOD("remove_item", "id"), &MeshLibrary::remove_item); + ClassDB::bind_method(D_METHOD("find_item_by_name", "name"), &MeshLibrary::find_item_by_name); + ClassDB::bind_method(D_METHOD("clear"), &MeshLibrary::clear); ClassDB::bind_method(D_METHOD("get_item_list"), &MeshLibrary::get_item_list); ClassDB::bind_method(D_METHOD("get_last_unused_item_id"), &MeshLibrary::get_last_unused_item_id); diff --git a/scene/resources/mesh_library.h b/scene/resources/mesh_library.h index 99b6b48d61..c5d23ce50f 100644 --- a/scene/resources/mesh_library.h +++ b/scene/resources/mesh_library.h @@ -84,7 +84,7 @@ public: void clear(); - int find_item_name(const String &p_name) const; + int find_item_by_name(const String &p_name) const; Vector<int> get_item_list() const; int get_last_unused_item_id() const; diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 19fab5d587..5d6f44dfef 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -92,7 +92,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { NODE_FROM_ID(nparent, n.parent); #ifdef DEBUG_ENABLED - if (!nparent && n.parent & FLAG_ID_IS_PATH) { + if (!nparent && (n.parent & FLAG_ID_IS_PATH)) { WARN_PRINT(String("Parent path '" + String(node_paths[n.parent & FLAG_MASK]) + "' for node '" + String(snames[n.name]) + "' has vanished when instancing: '" + get_path() + "'.").ascii().get_data()); } @@ -145,7 +145,7 @@ Node *SceneState::instance(GenEditState p_edit_state) const { node = parent->_get_child_by_name(snames[n.name]); #ifdef DEBUG_ENABLED if (!node) { - WARN_PRINT(String("Node '" + String(ret_nodes[0]->get_path_to(parent)) + "/" + String(snames[n.name]) + "' was modified from inside a instance, but it has vanished.").ascii().get_data()); + WARN_PRINT(String("Node '" + String(ret_nodes[0]->get_path_to(parent)) + "/" + String(snames[n.name]) + "' was modified from inside an instance, but it has vanished.").ascii().get_data()); } #endif } @@ -489,7 +489,7 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map // only save what has been changed // only save changed properties in instance - if (E->get().usage & PROPERTY_USAGE_NO_INSTANCE_STATE || E->get().name == "__meta__") { + if ((E->get().usage & PROPERTY_USAGE_NO_INSTANCE_STATE) || E->get().name == "__meta__") { //property has requested that no instance state is saved, sorry //also, meta won't be overridden or saved continue; @@ -1288,7 +1288,7 @@ bool SceneState::is_node_instance_placeholder(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, nodes.size(), false); - return nodes[p_idx].instance >= 0 && nodes[p_idx].instance & FLAG_INSTANCE_IS_PLACEHOLDER; + return nodes[p_idx].instance >= 0 && (nodes[p_idx].instance & FLAG_INSTANCE_IS_PLACEHOLDER); } Ref<PackedScene> SceneState::get_node_instance(int p_idx) const { @@ -1313,7 +1313,7 @@ String SceneState::get_node_instance_placeholder(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, nodes.size(), String()); - if (nodes[p_idx].instance >= 0 && nodes[p_idx].instance & FLAG_INSTANCE_IS_PLACEHOLDER) { + if (nodes[p_idx].instance >= 0 && (nodes[p_idx].instance & FLAG_INSTANCE_IS_PLACEHOLDER)) { return variants[nodes[p_idx].instance & FLAG_MASK]; } diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index cfc1468533..ba356d89b1 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -105,6 +105,15 @@ Array PrimitiveMesh::surface_get_arrays(int p_surface) const { return VisualServer::get_singleton()->mesh_surface_get_arrays(mesh, 0); } +Array PrimitiveMesh::surface_get_blend_shape_arrays(int p_surface) const { + ERR_FAIL_INDEX_V(p_surface, 1, Array()); + if (pending_request) { + _update(); + } + + return Array(); +} + uint32_t PrimitiveMesh::surface_get_format(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, 1, 0); if (pending_request) { @@ -119,6 +128,8 @@ Mesh::PrimitiveType PrimitiveMesh::surface_get_primitive_type(int p_idx) const { } Ref<Material> PrimitiveMesh::surface_get_material(int p_idx) const { + ERR_FAIL_INDEX_V(p_idx, 1, NULL); + return material; } @@ -151,6 +162,8 @@ void PrimitiveMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_material", "material"), &PrimitiveMesh::set_material); ClassDB::bind_method(D_METHOD("get_material"), &PrimitiveMesh::get_material); + ClassDB::bind_method(D_METHOD("get_mesh_arrays"), &PrimitiveMesh::get_mesh_arrays); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_material", "get_material"); } @@ -168,6 +181,10 @@ Ref<Material> PrimitiveMesh::get_material() const { return material; } +Array PrimitiveMesh::get_mesh_arrays() const { + return surface_get_arrays(0); +} + PrimitiveMesh::PrimitiveMesh() { // defaults mesh = VisualServer::get_singleton()->mesh_create(); @@ -213,7 +230,6 @@ void CapsuleMesh::_create_mesh_array(Array &p_arr) const { prevrow = 0; for (j = 0; j <= (rings + 1); j++) { v = j; - w; v /= (rings + 1); w = sin(0.5 * Math_PI * v); @@ -292,7 +308,6 @@ void CapsuleMesh::_create_mesh_array(Array &p_arr) const { prevrow = 0; for (j = 0; j <= (rings + 1); j++) { v = j; - w; v /= (rings + 1); v += 1.0; diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index 34fb75a196..38a5695883 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -67,6 +67,7 @@ public: virtual int surface_get_array_len(int p_idx) const; virtual int surface_get_array_index_len(int p_idx) const; virtual Array surface_get_arrays(int p_surface) const; + virtual Array surface_get_blend_shape_arrays(int p_surface) const; virtual uint32_t surface_get_format(int p_idx) const; virtual Mesh::PrimitiveType surface_get_primitive_type(int p_idx) const; virtual Ref<Material> surface_get_material(int p_idx) const; @@ -78,6 +79,8 @@ public: void set_material(const Ref<Material> &p_material); Ref<Material> get_material() const; + Array get_mesh_arrays() const; + PrimitiveMesh(); ~PrimitiveMesh(); }; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 9751d6e711..6a9ded9ea3 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -501,9 +501,9 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla Vector<Ref<Image> > mipmap_images; int total_size = 0; - for (int i = 0; i < mipmaps; i++) { + for (uint32_t i = 0; i < mipmaps; i++) { - if (i > 0) { + if (i) { size = f->get_32(); } diff --git a/servers/arvr/arvr_positional_tracker.cpp b/servers/arvr/arvr_positional_tracker.cpp index 539bac6703..4ecd7a3898 100644 --- a/servers/arvr/arvr_positional_tracker.cpp +++ b/servers/arvr/arvr_positional_tracker.cpp @@ -31,6 +31,10 @@ #include "core/os/input.h" void ARVRPositionalTracker::_bind_methods() { + BIND_ENUM_CONSTANT(TRACKER_HAND_UNKNOWN); + BIND_ENUM_CONSTANT(TRACKER_LEFT_HAND); + BIND_ENUM_CONSTANT(TRACKER_RIGHT_HAND); + // this class is read only from GDScript, so we only have access to getters.. ClassDB::bind_method(D_METHOD("get_type"), &ARVRPositionalTracker::get_type); ClassDB::bind_method(D_METHOD("get_name"), &ARVRPositionalTracker::get_name); @@ -39,6 +43,7 @@ void ARVRPositionalTracker::_bind_methods() { ClassDB::bind_method(D_METHOD("get_orientation"), &ARVRPositionalTracker::get_orientation); ClassDB::bind_method(D_METHOD("get_tracks_position"), &ARVRPositionalTracker::get_tracks_position); ClassDB::bind_method(D_METHOD("get_position"), &ARVRPositionalTracker::get_position); + ClassDB::bind_method(D_METHOD("get_hand"), &ARVRPositionalTracker::get_hand); ClassDB::bind_method(D_METHOD("get_transform", "adjust_by_reference_frame"), &ARVRPositionalTracker::get_transform); // these functions we don't want to expose to normal users but do need to be callable from GDNative @@ -141,6 +146,14 @@ Vector3 ARVRPositionalTracker::get_rw_position() const { return rw_position; }; +ARVRPositionalTracker::TrackerHand ARVRPositionalTracker::get_hand() const { + return hand; +}; + +void ARVRPositionalTracker::set_hand(const ARVRPositionalTracker::TrackerHand p_hand) { + hand = p_hand; +}; + Transform ARVRPositionalTracker::get_transform(bool p_adjust_by_reference_frame) const { Transform new_transform; @@ -164,6 +177,7 @@ ARVRPositionalTracker::ARVRPositionalTracker() { tracker_id = 0; tracks_orientation = false; tracks_position = false; + hand = TRACKER_HAND_UNKNOWN; }; ARVRPositionalTracker::~ARVRPositionalTracker(){ diff --git a/servers/arvr/arvr_positional_tracker.h b/servers/arvr/arvr_positional_tracker.h index f91f862ba3..ff0c150f89 100644 --- a/servers/arvr/arvr_positional_tracker.h +++ b/servers/arvr/arvr_positional_tracker.h @@ -48,6 +48,13 @@ class ARVRPositionalTracker : public Object { GDCLASS(ARVRPositionalTracker, Object); _THREAD_SAFE_CLASS_ +public: + enum TrackerHand { + TRACKER_HAND_UNKNOWN, /* unknown or not applicable */ + TRACKER_LEFT_HAND, /* controller is the left hand controller */ + TRACKER_RIGHT_HAND /* controller is the right hand controller */ + }; + private: ARVRServer::TrackerType type; // type of tracker StringName name; // (unique) name of the tracker @@ -57,6 +64,7 @@ private: Basis orientation; // our orientation bool tracks_position; // do we track position? Vector3 rw_position; // our position "in the real world, so without world_scale applied" + TrackerHand hand; // if known, the hand this tracker is held in protected: static void _bind_methods(); @@ -77,6 +85,8 @@ public: Vector3 get_position() const; // get position with world_scale applied void set_rw_position(const Vector3 &p_rw_position); Vector3 get_rw_position() const; + ARVRPositionalTracker::TrackerHand get_hand() const; + void set_hand(const ARVRPositionalTracker::TrackerHand p_hand); Transform get_transform(bool p_adjust_by_reference_frame) const; @@ -84,4 +94,6 @@ public: ~ARVRPositionalTracker(); }; +VARIANT_ENUM_CAST(ARVRPositionalTracker::TrackerHand); + #endif diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp index bac24f6438..5d8cf20c92 100644 --- a/servers/arvr_server.cpp +++ b/servers/arvr_server.cpp @@ -68,8 +68,8 @@ void ARVRServer::_bind_methods() { ADD_SIGNAL(MethodInfo("interface_added", PropertyInfo(Variant::STRING, "name"))); ADD_SIGNAL(MethodInfo("interface_removed", PropertyInfo(Variant::STRING, "name"))); - ADD_SIGNAL(MethodInfo("tracker_added", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::INT, "type"))); - ADD_SIGNAL(MethodInfo("tracker_removed", PropertyInfo(Variant::STRING, "name"))); + ADD_SIGNAL(MethodInfo("tracker_added", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); + ADD_SIGNAL(MethodInfo("tracker_removed", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); }; real_t ARVRServer::get_world_scale() const { @@ -130,7 +130,6 @@ void ARVRServer::request_reference_frame(bool p_ignore_tilt, bool p_keep_height) void ARVRServer::add_interface(const Ref<ARVRInterface> &p_interface) { ERR_FAIL_COND(p_interface.is_null()); - int idx = -1; for (int i = 0; i < interfaces.size(); i++) { if (interfaces[i] == p_interface) { @@ -232,7 +231,7 @@ void ARVRServer::add_tracker(ARVRPositionalTracker *p_tracker) { ERR_FAIL_NULL(p_tracker); trackers.push_back(p_tracker); - emit_signal("tracker_added", p_tracker->get_name(), p_tracker->get_type()); + emit_signal("tracker_added", p_tracker->get_name(), p_tracker->get_type(), p_tracker->get_tracker_id()); }; void ARVRServer::remove_tracker(ARVRPositionalTracker *p_tracker) { @@ -250,7 +249,7 @@ void ARVRServer::remove_tracker(ARVRPositionalTracker *p_tracker) { ERR_FAIL_COND(idx == -1); - emit_signal("tracker_removed", p_tracker->get_name()); + emit_signal("tracker_removed", p_tracker->get_name(), p_tracker->get_type(), p_tracker->get_tracker_id()); trackers.remove(idx); }; diff --git a/servers/audio/audio_driver_dummy.cpp b/servers/audio/audio_driver_dummy.cpp index 992fece85f..1ae0e7b96b 100644 --- a/servers/audio/audio_driver_dummy.cpp +++ b/servers/audio/audio_driver_dummy.cpp @@ -37,17 +37,16 @@ Error AudioDriverDummy::init() { active = false; thread_exited = false; exit_thread = false; - pcm_open = false; samples_in = NULL; - mix_rate = 44100; + mix_rate = DEFAULT_MIX_RATE; speaker_mode = SPEAKER_MODE_STEREO; channels = 2; - int latency = GLOBAL_DEF("audio/output_latency", 25); - buffer_size = next_power_of_2(latency * mix_rate / 1000); + int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY); + buffer_frames = closest_power_of_2(latency * mix_rate / 1000); - samples_in = memnew_arr(int32_t, buffer_size * channels); + samples_in = memnew_arr(int32_t, buffer_frames * channels); mutex = Mutex::create(); thread = Thread::create(AudioDriverDummy::thread_func, this); @@ -59,17 +58,15 @@ void AudioDriverDummy::thread_func(void *p_udata) { AudioDriverDummy *ad = (AudioDriverDummy *)p_udata; - uint64_t usdelay = (ad->buffer_size / float(ad->mix_rate)) * 1000000; + uint64_t usdelay = (ad->buffer_frames / float(ad->mix_rate)) * 1000000; while (!ad->exit_thread) { - if (!ad->active) { - - } else { + if (ad->active) { ad->lock(); - ad->audio_server_process(ad->buffer_size, ad->samples_in); + ad->audio_server_process(ad->buffer_frames, ad->samples_in); ad->unlock(); }; diff --git a/servers/audio/audio_driver_dummy.h b/servers/audio/audio_driver_dummy.h index b3fea59389..90af1961b7 100644 --- a/servers/audio/audio_driver_dummy.h +++ b/servers/audio/audio_driver_dummy.h @@ -43,8 +43,8 @@ class AudioDriverDummy : public AudioDriver { int32_t *samples_in; static void thread_func(void *p_udata); - int buffer_size; + unsigned int buffer_frames; unsigned int mix_rate; SpeakerMode speaker_mode; @@ -53,7 +53,6 @@ class AudioDriverDummy : public AudioDriver { bool active; bool thread_exited; mutable bool exit_thread; - bool pcm_open; public: const char *get_name() const { diff --git a/servers/audio/audio_rb_resampler.cpp b/servers/audio/audio_rb_resampler.cpp index 2f160fd7cd..113e356612 100644 --- a/servers/audio/audio_rb_resampler.cpp +++ b/servers/audio/audio_rb_resampler.cpp @@ -176,7 +176,7 @@ bool AudioRBResampler::mix(int32_t *p_dest, int p_frames) { { - uint32_t read = 0; + int read = 0; switch (channels) { case 1: read = _resample<1>(p_dest, todo, increment); break; case 2: read = _resample<2>(p_dest, todo, increment); break; @@ -189,7 +189,7 @@ bool AudioRBResampler::mix(int32_t *p_dest, int p_frames) { if (remaining && todo > 0) { //print_line("fadeout"); - for (int c = 0; c < channels; c++) { + for (uint32_t c = 0; c < channels; c++) { for (int i = 0; i < todo; i++) { @@ -202,7 +202,7 @@ bool AudioRBResampler::mix(int32_t *p_dest, int p_frames) { } //zero out what remains there to avoid glitches - for (int i = todo * channels; i < int(p_frames) * channels; i++) { + for (uint32_t i = todo * channels; i < int(p_frames) * channels; i++) { p_dest[i] = 0; } @@ -250,7 +250,7 @@ Error AudioRBResampler::setup(int p_channels, int p_src_mix_rate, int p_target_m rb_write_pos = 0; //avoid maybe strange noises upon load - for (int i = 0; i < (rb_len * channels); i++) { + for (unsigned int i = 0; i < (rb_len * channels); i++) { rb[i] = 0; read_buf[i] = 0; diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp index 4075bc3e63..76dd585ffa 100644 --- a/servers/audio/effects/audio_effect_chorus.cpp +++ b/servers/audio/effects/audio_effect_chorus.cpp @@ -78,7 +78,7 @@ void AudioEffectChorusInstance::_process_chunk(const AudioFrame *p_src_frames, A uint64_t increment = llrint(cycles_to_mix / (double)p_frame_count * (double)(1 << AudioEffectChorus::CYCLES_FRAC)); //check the LFO doesn't read ahead of the write pos - if ((((int)max_depth_frames) + 10) > delay_frames) { //10 as some threshold to avoid precision stuff + if ((((unsigned int)max_depth_frames) + 10) > delay_frames) { //10 as some threshold to avoid precision stuff delay_frames += (int)max_depth_frames - delay_frames; delay_frames += 10; //threshold to avoid precision stuff } diff --git a/servers/audio/effects/audio_effect_limiter.cpp b/servers/audio/effects/audio_effect_limiter.cpp index 391e5db639..9787ba8109 100644 --- a/servers/audio/effects/audio_effect_limiter.cpp +++ b/servers/audio/effects/audio_effect_limiter.cpp @@ -31,18 +31,13 @@ void AudioEffectLimiterInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) { - float thresh = Math::db2linear(base->threshold); float threshdb = base->threshold; float ceiling = Math::db2linear(base->ceiling); float ceildb = base->ceiling; float makeup = Math::db2linear(ceildb - threshdb); - float makeupdb = ceildb - threshdb; float sc = -base->soft_clip; float scv = Math::db2linear(sc); - float sccomp = Math::db2linear(-sc); float peakdb = ceildb + 25; - float peaklvl = Math::db2linear(peakdb); - float scratio = base->soft_clip_ratio; float scmult = Math::abs((ceildb - sc) / (peakdb - sc)); for (int i = 0; i < p_frame_count; i++) { diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index c0343399c3..29014a7ced 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -155,6 +155,29 @@ void AudioServer::_driver_process(int p_frames, int32_t *p_buffer) { todo -= to_copy; to_mix -= to_copy; } + +#ifdef DEBUG_ENABLED + if (OS::get_singleton() && OS::get_singleton()->is_stdout_verbose()) { + static uint64_t first_ticks = 0; + static uint64_t last_ticks = 0; + static uint64_t ticks = 0; + static int count = 0; + static int total = 0; + + ticks = OS::get_singleton()->get_ticks_msec(); + if ((ticks - first_ticks) > 10 * 1000) { + print_line("Audio Driver " + String(AudioDriver::get_singleton()->get_name()) + " average latency: " + itos(total / count) + "ms (frame=" + itos(p_frames) + ")"); + first_ticks = ticks; + total = 0; + count = 0; + } + + total += ticks - last_ticks; + count++; + + last_ticks = ticks; + } +#endif } void AudioServer::_mix_step() { @@ -180,8 +203,9 @@ void AudioServer::_mix_step() { if (!bus_map.has(bus->send)) { bus = buses[0]; //send to master } else { + int prev_index_cache = bus->index_cache; bus = bus_map[bus->send]; - if (bus->index_cache >= bus->index_cache) { //invalid, send to master + if (prev_index_cache >= bus->index_cache) { //invalid, send to master bus = buses[0]; } } diff --git a/servers/audio_server.h b/servers/audio_server.h index 05e92ceaf0..13a74856c8 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -54,6 +54,9 @@ public: SPEAKER_SURROUND_71, }; + static const int DEFAULT_MIX_RATE = 44100; + static const int DEFAULT_OUTPUT_LATENCY = 15; + static AudioDriver *get_singleton(); void set_singleton(); diff --git a/servers/physics/broad_phase_basic.cpp b/servers/physics/broad_phase_basic.cpp index 959718a252..c6565ac2e9 100644 --- a/servers/physics/broad_phase_basic.cpp +++ b/servers/physics/broad_phase_basic.cpp @@ -30,9 +30,10 @@ #include "broad_phase_basic.h" #include "list.h" #include "print_string.h" + BroadPhaseSW::ID BroadPhaseBasic::create(CollisionObjectSW *p_object, int p_subindex) { - ERR_FAIL_COND_V(p_object == NULL, NULL); + ERR_FAIL_COND_V(p_object == NULL, 0); current++; diff --git a/servers/physics/collision_object_sw.cpp b/servers/physics/collision_object_sw.cpp index ab716a8f6e..3af8b542fa 100644 --- a/servers/physics/collision_object_sw.cpp +++ b/servers/physics/collision_object_sw.cpp @@ -28,6 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "collision_object_sw.h" +#include "servers/physics/physics_server_sw.h" #include "space_sw.h" void CollisionObjectSW::add_shape(ShapeSW *p_shape, const Transform &p_transform) { @@ -39,8 +40,12 @@ void CollisionObjectSW::add_shape(ShapeSW *p_shape, const Transform &p_transform s.bpid = 0; //needs update shapes.push_back(s); p_shape->add_owner(this); - _update_shapes(); - _shapes_changed(); + + if (!pending_shape_update_list.in_list()) { + PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list); + } + //_update_shapes(); + //_shapes_changed(); } void CollisionObjectSW::set_shape(int p_index, ShapeSW *p_shape) { @@ -50,8 +55,11 @@ void CollisionObjectSW::set_shape(int p_index, ShapeSW *p_shape) { shapes[p_index].shape = p_shape; p_shape->add_owner(this); - _update_shapes(); - _shapes_changed(); + if (!pending_shape_update_list.in_list()) { + PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list); + } + //_update_shapes(); + //_shapes_changed(); } void CollisionObjectSW::set_shape_transform(int p_index, const Transform &p_transform) { @@ -59,8 +67,11 @@ void CollisionObjectSW::set_shape_transform(int p_index, const Transform &p_tran shapes[p_index].xform = p_transform; shapes[p_index].xform_inv = p_transform.affine_inverse(); - _update_shapes(); - _shapes_changed(); + if (!pending_shape_update_list.in_list()) { + PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list); + } + //_update_shapes(); + //_shapes_changed(); } void CollisionObjectSW::remove_shape(ShapeSW *p_shape) { @@ -90,7 +101,11 @@ void CollisionObjectSW::remove_shape(int p_index) { shapes[p_index].shape->remove_owner(this); shapes.remove(p_index); - _shapes_changed(); + if (!pending_shape_update_list.in_list()) { + PhysicsServerSW::singleton->pending_shape_update_list.add(&pending_shape_update_list); + } + //_update_shapes(); + //_shapes_changed(); } void CollisionObjectSW::_set_static(bool p_static) { @@ -202,7 +217,8 @@ void CollisionObjectSW::_shape_changed() { _shapes_changed(); } -CollisionObjectSW::CollisionObjectSW(Type p_type) { +CollisionObjectSW::CollisionObjectSW(Type p_type) + : pending_shape_update_list(this) { _static = true; type = p_type; diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h index dc988aae86..67a8a44944 100644 --- a/servers/physics/collision_object_sw.h +++ b/servers/physics/collision_object_sw.h @@ -75,6 +75,8 @@ private: Transform inv_transform; bool _static; + SelfList<CollisionObjectSW> pending_shape_update_list; + void _update_shapes(); protected: diff --git a/servers/physics/collision_solver_sw.cpp b/servers/physics/collision_solver_sw.cpp index c7f66cb7fc..7bef208237 100644 --- a/servers/physics/collision_solver_sw.cpp +++ b/servers/physics/collision_solver_sw.cpp @@ -271,7 +271,7 @@ bool CollisionSolverSW::solve_distance_plane(const ShapeSW *p_shape_A, const Tra bool collided = false; Vector3 closest; - real_t closest_d; + real_t closest_d = 0; for (int i = 0; i < support_count; i++) { diff --git a/servers/physics/gjk_epa.cpp b/servers/physics/gjk_epa.cpp index 6cea5b003d..0f03bd917a 100644 --- a/servers/physics/gjk_epa.cpp +++ b/servers/physics/gjk_epa.cpp @@ -410,8 +410,8 @@ struct GJK if(l>GJK_SIMPLEX3_EPS) { real_t mindist=-1; - real_t subw[2]; - U subm; + real_t subw[2] = { 0 , 0}; + U subm = 0; for(U i=0;i<3;++i) { if(vec3_dot(*vt[i],vec3_cross(dl[i],n))>0) @@ -458,7 +458,7 @@ struct GJK { real_t mindist=-1; real_t subw[3]; - U subm; + U subm=0; for(U i=0;i<3;++i) { const U j=imd3[i]; diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index 8d6f7b3fd8..2d46770924 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -763,6 +763,8 @@ void PhysicsServerSW::body_apply_impulse(RID p_body, const Vector3 &p_pos, const BodySW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); + _update_shapes(); + body->apply_impulse(p_pos, p_impulse); body->wakeup(); }; @@ -772,6 +774,8 @@ void PhysicsServerSW::body_apply_torque_impulse(RID p_body, const Vector3 &p_imp BodySW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); + _update_shapes(); + body->apply_torque_impulse(p_impulse); body->wakeup(); }; @@ -781,6 +785,8 @@ void PhysicsServerSW::body_set_axis_velocity(RID p_body, const Vector3 &p_axis_v BodySW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); + _update_shapes(); + Vector3 v = body->get_linear_velocity(); Vector3 axis = p_axis_velocity.normalized(); v -= axis * axis.dot(v); @@ -793,6 +799,7 @@ void PhysicsServerSW::body_set_axis_lock(RID p_body, BodyAxisLock p_lock) { BodySW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); + body->set_axis_lock(p_lock); body->wakeup(); } @@ -902,6 +909,8 @@ bool PhysicsServerSW::body_test_motion(RID p_body, const Transform &p_from, cons ERR_FAIL_COND_V(!body->get_space(), false); ERR_FAIL_COND_V(body->get_space()->is_locked(), false); + _update_shapes(); + return body->get_space()->test_body_motion(body, p_from, p_motion, p_margin, r_result); } @@ -1209,6 +1218,8 @@ bool PhysicsServerSW::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_a void PhysicsServerSW::free(RID p_rid) { + _update_shapes(); //just in case + if (shape_owner.owns(p_rid)) { ShapeSW *shape = shape_owner.get(p_rid); @@ -1312,6 +1323,8 @@ void PhysicsServerSW::step(real_t p_step) { if (!active) return; + _update_shapes(); + doing_sync = false; last_step = p_step; @@ -1409,6 +1422,14 @@ int PhysicsServerSW::get_process_info(ProcessInfo p_info) { return 0; } +void PhysicsServerSW::_update_shapes() { + + while (pending_shape_update_list.first()) { + pending_shape_update_list.first()->self()->_shape_changed(); + pending_shape_update_list.remove(pending_shape_update_list.first()); + } +} + void PhysicsServerSW::_shape_col_cbk(const Vector3 &p_point_A, const Vector3 &p_point_B, void *p_userdata) { CollCbkData *cbk = (CollCbkData *)p_userdata; diff --git a/servers/physics/physics_server_sw.h b/servers/physics/physics_server_sw.h index 2e1fa7065a..99ba302acd 100644 --- a/servers/physics/physics_server_sw.h +++ b/servers/physics/physics_server_sw.h @@ -62,6 +62,10 @@ class PhysicsServerSW : public PhysicsServer { mutable RID_Owner<JointSW> joint_owner; //void _clear_query(QuerySW *p_query); + friend class CollisionObjectSW; + SelfList<CollisionObjectSW>::List pending_shape_update_list; + void _update_shapes(); + public: static PhysicsServerSW *singleton; diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index f02ff03fcf..80eeff93d0 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -734,7 +734,7 @@ Vector3 ConvexPolygonShapeSW::get_support(const Vector3 &p_normal) const { Vector3 n = p_normal; int vert_support_idx = -1; - real_t support_max; + real_t support_max = 0; int vertex_count = mesh.vertices.size(); if (vertex_count == 0) @@ -767,8 +767,8 @@ void ConvexPolygonShapeSW::get_supports(const Vector3 &p_normal, int p_max, Vect int vc = mesh.vertices.size(); //find vertex first - real_t max; - int vtx; + real_t max = 0; + int vtx = 0; for (int i = 0; i < vc; i++) { @@ -954,6 +954,9 @@ Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(real_t p_mass) const { void ConvexPolygonShapeSW::_setup(const Vector<Vector3> &p_vertices) { Error err = QuickHull::build(p_vertices, mesh); + if (err != OK) + ERR_PRINT("Failed to build QuickHull"); + Rect3 _aabb; for (int i = 0; i < mesh.vertices.size(); i++) { @@ -1000,7 +1003,7 @@ void FaceShapeSW::project_range(const Vector3 &p_normal, const Transform &p_tran Vector3 FaceShapeSW::get_support(const Vector3 &p_normal) const { int vert_support_idx = -1; - real_t support_max; + real_t support_max = 0; for (int i = 0; i < 3; i++) { @@ -1154,7 +1157,7 @@ Vector3 ConcavePolygonShapeSW::get_support(const Vector3 &p_normal) const { Vector3 n = p_normal; int vert_support_idx = -1; - real_t support_max; + real_t support_max = 0; for (int i = 0; i < count; i++) { diff --git a/servers/physics/step_sw.cpp b/servers/physics/step_sw.cpp index 79a55e0af1..76b097dda6 100644 --- a/servers/physics/step_sw.cpp +++ b/servers/physics/step_sw.cpp @@ -62,7 +62,7 @@ void StepSW::_setup_island(ConstraintSW *p_island, real_t p_delta) { ConstraintSW *ci = p_island; while (ci) { - bool process = ci->setup(p_delta); + ci->setup(p_delta); //todo remove from island if process fails ci = ci->get_island_next(); } diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index 6c800a4b49..db18995bee 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -640,7 +640,7 @@ BroadPhase2DHashGrid::BroadPhase2DHashGrid() { cell_size = GLOBAL_DEF("physics/2d/cell_size", 128); large_object_min_surface = GLOBAL_DEF("physics/2d/large_object_surface_threshold_in_cells", 512); - for (int i = 0; i < hash_table_size; i++) + for (uint32_t i = 0; i < hash_table_size; i++) hash_table[i] = NULL; pass = 1; @@ -649,7 +649,7 @@ BroadPhase2DHashGrid::BroadPhase2DHashGrid() { BroadPhase2DHashGrid::~BroadPhase2DHashGrid() { - for (int i = 0; i < hash_table_size; i++) { + for (uint32_t i = 0; i < hash_table_size; i++) { while (hash_table[i]) { PosBin *pb = hash_table[i]; hash_table[i] = pb->next; diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 187a0b180b..344c10089a 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -335,6 +335,8 @@ public: virtual void light_directional_set_shadow_mode(RID p_light, VS::LightDirectionalShadowMode p_mode) = 0; virtual void light_directional_set_blend_splits(RID p_light, bool p_enable) = 0; virtual bool light_directional_get_blend_splits(RID p_light) const = 0; + virtual void light_directional_set_shadow_depth_range_mode(RID p_light, VS::LightDirectionalShadowDepthRangeMode p_range_mode) = 0; + virtual VS::LightDirectionalShadowDepthRangeMode light_directional_get_shadow_depth_range_mode(RID p_light) const = 0; virtual VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) = 0; virtual VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) = 0; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index d17cf472b3..6ad433268f 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -79,7 +79,11 @@ String ShaderLanguage::get_operator_text(Operator p_op) { "|", "^", "~", - "++" + "++", + "--", + "?", + ":", + "++", "--", "()", "construct", @@ -2586,7 +2590,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons } bool index_valid = false; - DataType member_type; + DataType member_type = TYPE_VOID; switch (expr->get_datatype()) { case TYPE_BVEC2: @@ -2953,7 +2957,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons if (expression[next_op + 1].is_op) { // this is not invalid and can really appear // but it becomes invalid anyway because no binary op - // can be followed by an unary op in a valid combination, + // can be followed by a unary op in a valid combination, // due to how precedence works, unaries will always disappear first _set_error("Parser bug.."); @@ -2996,8 +3000,6 @@ ShaderLanguage::Node *ShaderLanguage::_reduce_expression(BlockNode *p_block, Sha if (op->op == OP_CONSTRUCT) { ERR_FAIL_COND_V(op->arguments[0]->type != Node::TYPE_VARIABLE, p_node); - VariableNode *vn = static_cast<VariableNode *>(op->arguments[0]); - //StringName name=vn->name; DataType base = get_scalar_type(op->get_datatype()); @@ -3116,6 +3118,12 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat tk = _get_token(); + VariableDeclarationNode *vardecl = alloc_node<VariableDeclarationNode>(); + vardecl->datatype = type; + vardecl->precision = precision; + + p_block->statements.push_back(vardecl); + while (true) { if (tk.type != TK_IDENTIFIER) { @@ -3133,8 +3141,14 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat var.type = type; var.precision = precision; var.line = tk_line; + p_block->variables[name] = var; + VariableDeclarationNode::Declaration decl; + + decl.name = name; + decl.initializer = NULL; + tk = _get_token(); if (tk.type == TK_OP_ASSIGN) { @@ -3143,22 +3157,17 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat if (!n) return ERR_PARSE_ERROR; - OperatorNode *assign = alloc_node<OperatorNode>(); - VariableNode *vnode = alloc_node<VariableNode>(); - vnode->name = name; - vnode->datatype_cache = type; - assign->arguments.push_back(vnode); - assign->arguments.push_back(n); - assign->op = OP_ASSIGN; - p_block->statements.push_back(assign); - tk = _get_token(); + decl.initializer = n; - if (!_validate_operator(assign)) { - _set_error("Invalid assignment of '" + get_datatype_name(n->get_datatype()) + "' to '" + get_datatype_name(type) + "'"); + if (var.type != n->get_datatype()) { + _set_error("Invalid assignment of '" + get_datatype_name(n->get_datatype()) + "' to '" + get_datatype_name(var.type) + "'"); return ERR_PARSE_ERROR; } + tk = _get_token(); } + vardecl->declarations.push_back(decl); + if (tk.type == TK_COMMA) { tk = _get_token(); //another variable @@ -3221,7 +3230,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat //if () {} tk = _get_token(); if (tk.type != TK_PARENTHESIS_OPEN) { - _set_error("Expected '(' after if"); + _set_error("Expected '(' after while"); return ERR_PARSE_ERROR; } @@ -3243,7 +3252,63 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat cf->blocks.push_back(block); p_block->statements.push_back(cf); - Error err = _parse_block(block, p_builtin_types, true, p_can_break, p_can_continue); + Error err = _parse_block(block, p_builtin_types, true, true, true); + if (err) + return err; + } else if (tk.type == TK_CF_FOR) { + //if () {} + tk = _get_token(); + if (tk.type != TK_PARENTHESIS_OPEN) { + _set_error("Expected '(' after for"); + return ERR_PARSE_ERROR; + } + + ControlFlowNode *cf = alloc_node<ControlFlowNode>(); + cf->flow_op = FLOW_OP_FOR; + + BlockNode *init_block = alloc_node<BlockNode>(); + init_block->parent_block = p_block; + init_block->single_statement = true; + cf->blocks.push_back(init_block); + if (_parse_block(init_block, p_builtin_types, true, false, false) != OK) { + return ERR_PARSE_ERROR; + } + + Node *n = _parse_and_reduce_expression(init_block, p_builtin_types); + if (!n) + return ERR_PARSE_ERROR; + + if (n->get_datatype() != TYPE_BOOL) { + _set_error("Middle expression is expected to be boolean."); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + if (tk.type != TK_SEMICOLON) { + _set_error("Expected ';' after middle expression"); + return ERR_PARSE_ERROR; + } + + cf->expressions.push_back(n); + + n = _parse_and_reduce_expression(init_block, p_builtin_types); + if (!n) + return ERR_PARSE_ERROR; + + cf->expressions.push_back(n); + + tk = _get_token(); + if (tk.type != TK_PARENTHESIS_CLOSE) { + _set_error("Expected ')' after third expression"); + return ERR_PARSE_ERROR; + } + + BlockNode *block = alloc_node<BlockNode>(); + block->parent_block = p_block; + cf->blocks.push_back(block); + p_block->statements.push_back(cf); + + Error err = _parse_block(block, p_builtin_types, true, true, true); if (err) return err; @@ -3320,6 +3385,42 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat } p_block->statements.push_back(flow); + } else if (tk.type == TK_CF_BREAK) { + + if (!p_can_break) { + //all is good + _set_error("Breaking is not allowed here"); + } + + ControlFlowNode *flow = alloc_node<ControlFlowNode>(); + flow->flow_op = FLOW_OP_BREAK; + + pos = _get_tkpos(); + tk = _get_token(); + if (tk.type != TK_SEMICOLON) { + //all is good + _set_error("Expected ';' after break"); + } + + p_block->statements.push_back(flow); + } else if (tk.type == TK_CF_CONTINUE) { + + if (!p_can_break) { + //all is good + _set_error("Contiuning is not allowed here"); + } + + ControlFlowNode *flow = alloc_node<ControlFlowNode>(); + flow->flow_op = FLOW_OP_CONTINUE; + + pos = _get_tkpos(); + tk = _get_token(); + if (tk.type != TK_SEMICOLON) { + //all is good + _set_error("Expected ';' after continue"); + } + + p_block->statements.push_back(flow); } else { @@ -3349,7 +3450,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct Token tk = _get_token(); if (tk.type != TK_SHADER_TYPE) { - _set_error("Expected 'shader_type' at the begining of shader."); + _set_error("Expected 'shader_type' at the beginning of shader."); return ERR_PARSE_ERROR; } @@ -3872,6 +3973,8 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct shader = alloc_node<ShaderNode>(); Error err = _parse_shader(p_functions, p_render_modes, p_shader_types); + if (err != OK) + ERR_PRINT("Failed to parse shader"); switch (completion_type) { diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h index f00b4c5a97..50f5cebeaa 100644 --- a/servers/visual/shader_language.h +++ b/servers/visual/shader_language.h @@ -266,6 +266,7 @@ public: TYPE_FUNCTION, TYPE_BLOCK, TYPE_VARIABLE, + TYPE_VARIABLE_DECLARATION, TYPE_CONSTANT, TYPE_OPERATOR, TYPE_CONTROL_FLOW, @@ -315,6 +316,25 @@ public: } }; + struct VariableDeclarationNode : public Node { + + DataPrecision precision; + DataType datatype; + + struct Declaration { + + StringName name; + Node *initializer; + }; + + Vector<Declaration> declarations; + virtual DataType get_datatype() const { return datatype; } + + VariableDeclarationNode() { + type = TYPE_VARIABLE_DECLARATION; + } + }; + struct ConstantNode : public Node { DataType datatype; @@ -346,10 +366,12 @@ public: Map<StringName, Variable> variables; List<Node *> statements; + bool single_statement; BlockNode() { type = TYPE_BLOCK; parent_block = NULL; parent_function = NULL; + single_statement=false; } }; diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp index ef0d063f83..91c5d430f5 100644 --- a/servers/visual/shader_types.cpp +++ b/servers/visual/shader_types.cpp @@ -102,6 +102,7 @@ ShaderTypes::ShaderTypes() { shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["ANISOTROPY"] = ShaderLanguage::TYPE_FLOAT; shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["ANISOTROPY_FLOW"] = ShaderLanguage::TYPE_VEC2; shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["SSS_STRENGTH"] = ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["TRANSMISSION"] = ShaderLanguage::TYPE_VEC3; shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["AO"] = ShaderLanguage::TYPE_FLOAT; shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["EMISSION"] = ShaderLanguage::TYPE_VEC3; shader_modes[VS::SHADER_SPATIAL].functions["fragment"].built_ins["SCREEN_TEXTURE"] = ShaderLanguage::TYPE_SAMPLER2D; @@ -137,7 +138,7 @@ ShaderTypes::ShaderTypes() { shader_modes[VS::SHADER_SPATIAL].modes.insert("unshaded"); shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_lambert"); - shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_half_lambert"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_lambert_wrap"); shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_oren_nayar"); shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_burley"); shader_modes[VS::SHADER_SPATIAL].modes.insert("diffuse_toon"); diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 3953bc5f48..7c7ce46268 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -795,6 +795,7 @@ public: BIND2(light_directional_set_shadow_mode, RID, LightDirectionalShadowMode) BIND2(light_directional_set_blend_splits, RID, bool) + BIND2(light_directional_set_shadow_depth_range_mode, RID, LightDirectionalShadowDepthRangeMode) /* PROBE API */ diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 2a6cba453c..9fb4dc524d 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -101,7 +101,7 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance SWAP(A, B); //lesser always first } - if (B->base_type == VS::INSTANCE_LIGHT && (1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK) { + if (B->base_type == VS::INSTANCE_LIGHT && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) { InstanceLightData *light = static_cast<InstanceLightData *>(B->base_data); InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data); @@ -119,7 +119,7 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance geom->lighting_dirty = true; return E; //this element should make freeing faster - } else if (B->base_type == VS::INSTANCE_REFLECTION_PROBE && (1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK) { + } else if (B->base_type == VS::INSTANCE_REFLECTION_PROBE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) { InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(B->base_data); InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data); @@ -133,7 +133,7 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance geom->reflection_dirty = true; return E; //this element should make freeing faster - } else if (B->base_type == VS::INSTANCE_GI_PROBE && (1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK) { + } else if (B->base_type == VS::INSTANCE_GI_PROBE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) { InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data); InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data); @@ -151,8 +151,6 @@ void *VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance } else if (B->base_type == VS::INSTANCE_GI_PROBE && A->base_type == VS::INSTANCE_LIGHT) { InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data); - InstanceLightData *light = static_cast<InstanceLightData *>(A->base_data); - return gi_probe->lights.insert(A); } @@ -169,7 +167,7 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance SWAP(A, B); //lesser always first } - if (B->base_type == VS::INSTANCE_LIGHT && (1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK) { + if (B->base_type == VS::INSTANCE_LIGHT && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) { InstanceLightData *light = static_cast<InstanceLightData *>(B->base_data); InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data); @@ -184,7 +182,7 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance } geom->lighting_dirty = true; - } else if (B->base_type == VS::INSTANCE_REFLECTION_PROBE && (1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK) { + } else if (B->base_type == VS::INSTANCE_REFLECTION_PROBE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) { InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData *>(B->base_data); InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data); @@ -196,7 +194,7 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance geom->reflection_dirty = true; - } else if (B->base_type == VS::INSTANCE_GI_PROBE && (1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK) { + } else if (B->base_type == VS::INSTANCE_GI_PROBE && ((1 << A->base_type) & VS::INSTANCE_GEOMETRY_MASK)) { InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data); InstanceGeometryData *geom = static_cast<InstanceGeometryData *>(A->base_data); @@ -211,8 +209,6 @@ void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance } else if (B->base_type == VS::INSTANCE_GI_PROBE && A->base_type == VS::INSTANCE_LIGHT) { InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData *>(B->base_data); - InstanceLightData *light = static_cast<InstanceLightData *>(A->base_data); - Set<Instance *>::Element *E = reinterpret_cast<Set<Instance *>::Element *>(udata); gi_probe->lights.erase(E); @@ -886,12 +882,53 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons float max_distance = p_cam_projection.get_z_far(); float shadow_max = VSG::storage->light_get_param(p_instance->base, VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE); - if (shadow_max > 0) { + if (shadow_max > 0 && !p_cam_orthogonal) { //its impractical (and leads to unwanted behaviors) to set max distance in orthogonal camera max_distance = MIN(shadow_max, max_distance); } max_distance = MAX(max_distance, p_cam_projection.get_z_near() + 0.001); + float min_distance = MIN(p_cam_projection.get_z_near(), max_distance); + + VS::LightDirectionalShadowDepthRangeMode depth_range_mode = VSG::storage->light_directional_get_shadow_depth_range_mode(p_instance->base); + + if (depth_range_mode == VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED) { + //optimize min/max + Vector<Plane> planes = p_cam_projection.get_projection_planes(p_cam_transform); + int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK); + Plane base(p_cam_transform.origin, -p_cam_transform.basis.get_axis(2)); + //check distance max and min + + bool found_items = false; + float z_max = -1e20; + float z_min = 1e20; + + for (int i = 0; i < cull_count; i++) { + + Instance *instance = instance_shadow_cull_result[i]; + if (!instance->visible || !((1 << instance->base_type) & VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData *>(instance->base_data)->can_cast_shadows) { + continue; + } + + float max, min; + instance->transformed_aabb.project_range_in_plane(base, min, max); + + if (max > z_max) { + z_max = max; + } + + if (min < z_min) { + z_min = min; + } - float range = max_distance - p_cam_projection.get_z_near(); + found_items = true; + } + + if (found_items) { + min_distance = MAX(min_distance, z_min); + max_distance = MIN(max_distance, z_max); + } + } + + float range = max_distance - min_distance; int splits = 0; switch (VSG::storage->light_directional_get_shadow_mode(p_instance->base)) { @@ -902,9 +939,9 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons float distances[5]; - distances[0] = p_cam_projection.get_z_near(); + distances[0] = min_distance; for (int i = 0; i < splits; i++) { - distances[i + 1] = p_cam_projection.get_z_near() + VSG::storage->light_get_param(p_instance->base, VS::LightParam(VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET + i)) * range; + distances[i + 1] = min_distance + VSG::storage->light_get_param(p_instance->base, VS::LightParam(VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET + i)) * range; }; distances[splits] = max_distance; @@ -948,13 +985,13 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons Vector3 z_vec = transform.basis.get_axis(Vector3::AXIS_Z).normalized(); //z_vec points agsint the camera, like in default opengl - float x_min, x_max; - float y_min, y_max; - float z_min, z_max; + float x_min = 0.f, x_max = 0.f; + float y_min = 0.f, y_max = 0.f; + float z_min = 0.f, z_max = 0.f; - float x_min_cam, x_max_cam; - float y_min_cam, y_max_cam; - float z_min_cam, z_max_cam; + float x_min_cam = 0.f, x_max_cam = 0.f; + float y_min_cam = 0.f, y_max_cam = 0.f; + float z_min_cam = 0.f, z_max_cam = 0.f; float bias_scale = 1.0; @@ -984,8 +1021,6 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons { //camera viewport stuff - //this trick here is what stabilizes the shadow (make potential jaggies to not move) - //at the cost of some wasted resolution. Still the quality increase is very well worth it Vector3 center; @@ -1006,7 +1041,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons radius = d; } - radius *= texture_size / (texture_size - 2.0); //add a texel by each side, so stepified texture will always fit + radius *= texture_size / (texture_size - 2.0); //add a texel by each side if (i == 0) { first_radius = radius; @@ -1021,12 +1056,17 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons z_max_cam = z_vec.dot(center) + radius; z_min_cam = z_vec.dot(center) - radius; - float unit = radius * 2.0 / texture_size; + if (depth_range_mode == VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE) { + //this trick here is what stabilizes the shadow (make potential jaggies to not move) + //at the cost of some wasted resolution. Still the quality increase is very well worth it + + float unit = radius * 2.0 / texture_size; - x_max_cam = Math::stepify(x_max_cam, unit); - x_min_cam = Math::stepify(x_min_cam, unit); - y_max_cam = Math::stepify(y_max_cam, unit); - y_min_cam = Math::stepify(y_min_cam, unit); + x_max_cam = Math::stepify(x_max_cam, unit); + x_min_cam = Math::stepify(x_min_cam, unit); + y_max_cam = Math::stepify(y_max_cam, unit); + y_min_cam = Math::stepify(y_min_cam, unit); + } } //now that we now all ranges, we can proceed to make the light frustum planes, for culling octree @@ -1069,6 +1109,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons } { + CameraMatrix ortho_camera; real_t half_x = (x_max_cam - x_min_cam) * 0.5; real_t half_y = (y_max_cam - y_min_cam) * 0.5; @@ -1375,7 +1416,7 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform, const Cam gi_probe_update_list.add(&gi_probe->update_element); } - } else if ((1 << ins->base_type) & VS::INSTANCE_GEOMETRY_MASK && ins->visible && ins->cast_shadows != VS::SHADOW_CASTING_SETTING_SHADOWS_ONLY) { + } else if (((1 << ins->base_type) & VS::INSTANCE_GEOMETRY_MASK) && ins->visible && ins->cast_shadows != VS::SHADOW_CASTING_SETTING_SHADOWS_ONLY) { keep = true; @@ -1503,7 +1544,7 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform, const Cam InstanceLightData *light = static_cast<InstanceLightData *>(ins->base_data); - float coverage; + float coverage = 0.f; { //compute coverage @@ -1687,7 +1728,7 @@ bool VisualServerScene::_render_reflection_probe_step(Instance *p_instance, int void VisualServerScene::_gi_probe_fill_local_data(int p_idx, int p_level, int p_x, int p_y, int p_z, const GIProbeDataCell *p_cell, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data, Vector<uint32_t> *prev_cell) { - if (p_level == p_header->cell_subdiv - 1) { + if ((uint32_t)p_level == p_header->cell_subdiv - 1) { Vector3 emission; emission.x = (p_cell[p_idx].emission >> 24) / 255.0; @@ -1798,9 +1839,9 @@ void VisualServerScene::_setup_gi_probe(Instance *p_instance) { } for (int i = 0; i < (int)header->cell_subdiv; i++) { - uint32_t x = header->width >> i; - uint32_t y = header->height >> i; - uint32_t z = header->depth >> i; + int x = header->width >> i; + int y = header->height >> i; + int z = header->depth >> i; //create and clear mipmap PoolVector<uint8_t> mipmap; @@ -1896,7 +1937,7 @@ void VisualServerScene::_setup_gi_probe(Instance *p_instance) { uint8_t alpha_block[4][4] = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } }; - for (int j = 0; j < k.source_count; j++) { + for (uint32_t j = 0; j < k.source_count; j++) { int alpha = (cells[k.sources[j]].level_alpha >> 8) & 0xFF; if (alpha < min_alpha) @@ -2085,7 +2126,7 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co int success_count = 0; - uint64_t us = OS::get_singleton()->get_ticks_usec(); + // uint64_t us = OS::get_singleton()->get_ticks_usec(); for (int i = 0; i < p_leaf_count; i++) { @@ -2138,14 +2179,15 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co success_count++; } } - //print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0)); - //print_line("valid cells: " + itos(success_count)); + + // print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0)); + // print_line("valid cells: " + itos(success_count)); } break; case VS::LIGHT_OMNI: case VS::LIGHT_SPOT: { - uint64_t us = OS::get_singleton()->get_ticks_usec(); + // uint64_t us = OS::get_singleton()->get_ticks_usec(); Vector3 light_pos = light_cache.transform.origin; Vector3 spot_axis = -light_cache.transform.basis.get_axis(2).normalized(); @@ -2244,8 +2286,7 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co light->energy[2] += int32_t(light_b * att * ((cell->albedo) & 0xFF) / 255.0); } } - //print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0)); - + // print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0)); } break; } } @@ -2389,7 +2430,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { Vector3 colors[16]; - for (int j = 0; j < b.source_count; j++) { + for (uint32_t j = 0; j < b.source_count; j++) { colors[j].x = (local_data[b.sources[j]].energy[0] / float(probe_data->dynamic.bake_dynamic_range)) / 1024.0; colors[j].y = (local_data[b.sources[j]].energy[1] / float(probe_data->dynamic.bake_dynamic_range)) / 1024.0; @@ -2403,8 +2444,8 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { if (b.source_count == 16) { //all cells are used so, find minmax between them int further_apart[2] = { 0, 0 }; - for (int j = 0; j < b.source_count; j++) { - for (int k = j + 1; k < b.source_count; k++) { + for (uint32_t j = 0; j < b.source_count; j++) { + for (uint32_t k = j + 1; k < b.source_count; k++) { float d = colors[j].distance_squared_to(colors[k]); if (d > distance) { distance = d; @@ -2424,12 +2465,12 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { //average all colors first Vector3 average; - for (int j = 0; j < b.source_count; j++) { + for (uint32_t j = 0; j < b.source_count; j++) { average += colors[j]; } average.normalize(); //find max distance in normal from average - for (int j = 0; j < b.source_count; j++) { + for (uint32_t j = 0; j < b.source_count; j++) { float d = average.dot(colors[j]); distance = MAX(d, distance); } @@ -2459,7 +2500,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { Vector3 dir = (to - from).normalized(); - for (int j = 0; j < b.source_count; j++) { + for (uint32_t j = 0; j < b.source_count; j++) { float d = (colors[j] - from).dot(dir) / distance; indices[j] = int(d * 3 + 0.5); @@ -2469,7 +2510,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { indices[j] = index_swap[CLAMP(indices[j], 0, 3)]; } } else { - for (int j = 0; j < b.source_count; j++) { + for (uint32_t j = 0; j < b.source_count; j++) { indices[j] = 0; } } @@ -2478,7 +2519,7 @@ void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { uint32_t index_block[16] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; - for (int j = 0; j < b.source_count; j++) { + for (uint32_t j = 0; j < b.source_count; j++) { int x = local_data[b.sources[j]].pos[0] % 4; int y = local_data[b.sources[j]].pos[1] % 4; @@ -2657,18 +2698,17 @@ void VisualServerScene::render_probes() { } break; case GI_UPDATE_STAGE_UPLOADING: { - uint64_t us = OS::get_singleton()->get_ticks_usec(); + // uint64_t us = OS::get_singleton()->get_ticks_usec(); for (int i = 0; i < (int)probe->dynamic.mipmaps_3d.size(); i++) { - int mmsize = probe->dynamic.mipmaps_3d[i].size(); PoolVector<uint8_t>::Read r = probe->dynamic.mipmaps_3d[i].read(); VSG::storage->gi_probe_dynamic_data_update(probe->dynamic.probe_data, 0, probe->dynamic.grid_size[2] >> i, i, r.ptr()); } probe->dynamic.updating_stage = GI_UPDATE_STAGE_CHECK; - //print_line("UPLOAD TIME: "+rtos((OS::get_singleton()->get_ticks_usec()-us)/1000000.0)); + // print_line("UPLOAD TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0)); } break; } } diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index f24049be92..5cf941b93d 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -233,6 +233,7 @@ public: FUNC2(light_directional_set_shadow_mode, RID, LightDirectionalShadowMode) FUNC2(light_directional_set_blend_splits, RID, bool) + FUNC2(light_directional_set_shadow_depth_range_mode, RID, LightDirectionalShadowDepthRangeMode) /* PROBE API */ diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 67b847d127..47a5f4c7f3 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -1420,6 +1420,29 @@ Array VisualServer::mesh_surface_get_arrays(RID p_mesh, int p_surface) const { return _get_array_from_surface(format, vertex_data, vertex_len, index_data, index_len); } +Array VisualServer::mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_surface) const { + + Vector<PoolVector<uint8_t> > blend_shape_data = mesh_surface_get_blend_shapes(p_mesh, p_surface); + if (blend_shape_data.size() > 0) { + int vertex_len = mesh_surface_get_array_len(p_mesh, p_surface); + + PoolVector<uint8_t> index_data = mesh_surface_get_index_array(p_mesh, p_surface); + int index_len = mesh_surface_get_array_index_len(p_mesh, p_surface); + + uint32_t format = mesh_surface_get_format(p_mesh, p_surface); + + Array blend_shape_array; + blend_shape_array.resize(blend_shape_data.size()); + for (int i = 0; i < blend_shape_data.size(); i++) { + blend_shape_array.set(i, _get_array_from_surface(format, blend_shape_data[i], vertex_len, index_data, index_len)); + } + + return blend_shape_array; + } else { + return Array(); + } +} + void VisualServer::_bind_methods() { ClassDB::bind_method(D_METHOD("force_draw"), &VisualServer::draw); diff --git a/servers/visual_server.h b/servers/visual_server.h index 45eaeeea25..72f36f6b65 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -267,6 +267,7 @@ public: virtual PoolVector<uint8_t> mesh_surface_get_index_array(RID p_mesh, int p_surface) const = 0; virtual Array mesh_surface_get_arrays(RID p_mesh, int p_surface) const; + virtual Array mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_surface) const; virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const = 0; virtual PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const = 0; @@ -406,6 +407,14 @@ public: virtual void light_directional_set_shadow_mode(RID p_light, LightDirectionalShadowMode p_mode) = 0; virtual void light_directional_set_blend_splits(RID p_light, bool p_enable) = 0; + enum LightDirectionalShadowDepthRangeMode { + LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE, + LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED, + + }; + + virtual void light_directional_set_shadow_depth_range_mode(RID p_light, LightDirectionalShadowDepthRangeMode p_range_mode) = 0; + /* PROBE API */ virtual RID reflection_probe_create() = 0; @@ -620,6 +629,7 @@ public: ENV_BG_CLEAR_COLOR, ENV_BG_COLOR, ENV_BG_SKY, + ENV_BG_COLOR_SKY, ENV_BG_CANVAS, ENV_BG_KEEP, ENV_BG_MAX @@ -831,6 +841,7 @@ public: CANVAS_LIGHT_FILTER_NONE, CANVAS_LIGHT_FILTER_PCF3, CANVAS_LIGHT_FILTER_PCF5, + CANVAS_LIGHT_FILTER_PCF7, CANVAS_LIGHT_FILTER_PCF9, CANVAS_LIGHT_FILTER_PCF13, }; |