diff --git a/.gitignore b/.gitignore index d9473065585..a6d5a2d4127 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,8 @@ tools/editor/editor_icons.cpp make.bat log.txt -# Doxygen generated documentation -doc/doxygen/* +# Documentation generated by doxygen or from classes.xml +doc/_build/ # Javascript specific *.bc @@ -189,9 +189,6 @@ AutoTest.Net/ # Installshield output folder [Ee]xpress/ -# dumpdoc generated files -doc/html/class_list - # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 94557d149d1..30c90bd71cf 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1977,7 +1977,7 @@ void _Thread::_bind_methods() { ObjectTypeDB::bind_method(_MD("start:Error","instance","method","userdata","priority"),&_Thread::start,DEFVAL(Variant()),DEFVAL(PRIORITY_NORMAL)); ObjectTypeDB::bind_method(_MD("get_id"),&_Thread::get_id); ObjectTypeDB::bind_method(_MD("is_active"),&_Thread::is_active); - ObjectTypeDB::bind_method(_MD("wait_to_finish:var"),&_Thread::wait_to_finish); + ObjectTypeDB::bind_method(_MD("wait_to_finish:Variant"),&_Thread::wait_to_finish); BIND_CONSTANT( PRIORITY_LOW ); BIND_CONSTANT( PRIORITY_NORMAL ); diff --git a/core/dictionary.cpp b/core/dictionary.cpp index b2d31f230d1..c544573629e 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -160,7 +160,20 @@ void Dictionary::_unref() const { } uint32_t Dictionary::hash() const { - return hash_djb2_one_64(make_uint64_t(_p)); + uint32_t h=hash_djb2_one_32(Variant::DICTIONARY); + + List keys; + get_key_list(&keys); + + for (List::Element *E=keys.front();E;E=E->next()) { + + h = hash_djb2_one_32( E->get().hash(), h); + h = hash_djb2_one_32( operator[](E->get()).hash(), h); + + } + + + return h; } Array Dictionary::keys() const { diff --git a/core/globals.cpp b/core/globals.cpp index aee708d0cdd..0a6a1876b34 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -309,7 +309,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) { print_line("has res dir: "+resource_path); if (!_load_resource_pack("res://data.pck")) - _load_resource_pack("res://data.pcz"); + _load_resource_pack("res://data.zip"); // make sure this is load from the resource path print_line("exists engine cfg? "+itos(FileAccess::exists("/engine.cfg"))); if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { @@ -340,7 +340,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) { //try to load settings in ascending through dirs shape! //tries to open pack, but only first time - if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".pcz") )) { + if (first_time && (_load_resource_pack(current_dir+"/"+exec_name+".pck") || _load_resource_pack(current_dir+"/"+exec_name+".zip") )) { if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { _load_settings("res://override.cfg"); @@ -349,7 +349,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) { } break; - } else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.pcz") )) { + } else if (first_time && (_load_resource_pack(current_dir+"/data.pck") || _load_resource_pack(current_dir+"/data.zip") )) { if (_load_settings("res://engine.cfg")==OK || _load_settings_binary("res://engine.cfb")==OK) { _load_settings("res://override.cfg"); diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index f6d526b512e..fc9e51f0006 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -127,7 +127,7 @@ Error PacketPeer::_get_packet_error() const { void PacketPeer::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_var"),&PacketPeer::_bnd_get_var); - ObjectTypeDB::bind_method(_MD("put_var", "var:var"),&PacketPeer::put_var); + ObjectTypeDB::bind_method(_MD("put_var", "var:Variant"),&PacketPeer::put_var); ObjectTypeDB::bind_method(_MD("get_packet"),&PacketPeer::_get_packet); ObjectTypeDB::bind_method(_MD("put_packet:Error", "buffer"),&PacketPeer::_put_packet); ObjectTypeDB::bind_method(_MD("get_packet_error:Error"),&PacketPeer::_get_packet_error); diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index b00b462eb63..1b39286bf79 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "stream_peer.h" - +#include "io/marshalls.h" Error StreamPeer::_put_data(const DVector& p_data) { @@ -115,6 +115,271 @@ Array StreamPeer::_get_partial_data(int p_bytes) { } +void StreamPeer::set_big_endian(bool p_enable) { + + big_endian=p_enable; +} + +bool StreamPeer::is_big_endian_enabled() const { + + return big_endian; +} + + +void StreamPeer::put_u8(uint8_t p_val) { + put_data((const uint8_t*)&p_val,1); + +} + +void StreamPeer::put_8(int8_t p_val){ + + put_data((const uint8_t*)&p_val,1); +} +void StreamPeer::put_u16(uint16_t p_val){ + + if (big_endian) { + p_val=BSWAP16(p_val); + } + uint8_t buf[2]; + encode_uint16(p_val,buf); + put_data(buf,2); + +} +void StreamPeer::put_16(int16_t p_val){ + + if (big_endian) { + p_val=BSWAP16(p_val); + } + uint8_t buf[2]; + encode_uint16(p_val,buf); + put_data(buf,2); + +} +void StreamPeer::put_u32(uint32_t p_val){ + + if (big_endian) { + p_val=BSWAP32(p_val); + } + uint8_t buf[4]; + encode_uint32(p_val,buf); + put_data(buf,4); + +} +void StreamPeer::put_32(int32_t p_val){ + + if (big_endian) { + p_val=BSWAP32(p_val); + } + uint8_t buf[4]; + encode_uint32(p_val,buf); + put_data(buf,4); + +} +void StreamPeer::put_u64(uint64_t p_val){ + + if (big_endian) { + p_val=BSWAP64(p_val); + } + uint8_t buf[8]; + encode_uint64(p_val,buf); + put_data(buf,8); + +} +void StreamPeer::put_64(int64_t p_val){ + + if (big_endian) { + p_val=BSWAP64(p_val); + } + uint8_t buf[8]; + encode_uint64(p_val,buf); + put_data(buf,8); + +} +void StreamPeer::put_float(float p_val){ + + uint8_t buf[4]; + + encode_float(p_val,buf); + if (big_endian) { + uint32_t *p32=(uint32_t *)buf; + *p32=BSWAP32(*p32); + } + + put_data(buf,4); + +} +void StreamPeer::put_double(double p_val){ + + uint8_t buf[8]; + encode_double(p_val,buf); + if (big_endian) { + uint64_t *p64=(uint64_t *)buf; + *p64=BSWAP64(*p64); + } + put_data(buf,8); + +} +void StreamPeer::put_utf8_string(const String& p_string) { + + CharString cs=p_string.utf8(); + put_data((const uint8_t*)cs.get_data(),cs.length()); + +} +void StreamPeer::put_var(const Variant& p_variant){ + + int len=0; + Vector buf; + encode_variant(p_variant,NULL,len); + buf.resize(len); + put_32(len); + encode_variant(p_variant,buf.ptr(),len); + put_data(buf.ptr(),buf.size()); + + +} + +uint8_t StreamPeer::get_u8(){ + + uint8_t buf[1]; + get_data(buf,1); + return buf[0]; +} +int8_t StreamPeer::get_8(){ + + uint8_t buf[1]; + get_data(buf,1); + return buf[0]; + +} +uint16_t StreamPeer::get_u16(){ + + uint8_t buf[2]; + get_data(buf,2); + uint16_t r = decode_uint16(buf); + if (big_endian) { + r=BSWAP16(r); + } + return r; + +} +int16_t StreamPeer::get_16(){ + + uint8_t buf[2]; + get_data(buf,2); + uint16_t r = decode_uint16(buf); + if (big_endian) { + r=BSWAP16(r); + } + return r; + +} +uint32_t StreamPeer::get_u32(){ + + uint8_t buf[4]; + get_data(buf,4); + uint32_t r = decode_uint32(buf); + if (big_endian) { + r=BSWAP32(r); + } + return r; + +} +int32_t StreamPeer::get_32(){ + + uint8_t buf[4]; + get_data(buf,4); + uint32_t r = decode_uint32(buf); + if (big_endian) { + r=BSWAP32(r); + } + return r; + +} +uint64_t StreamPeer::get_u64(){ + + uint8_t buf[8]; + get_data(buf,8); + uint64_t r = decode_uint64(buf); + if (big_endian) { + r=BSWAP64(r); + } + return r; + +} +int64_t StreamPeer::get_64(){ + + uint8_t buf[8]; + get_data(buf,8); + uint64_t r = decode_uint64(buf); + if (big_endian) { + r=BSWAP64(r); + } + return r; + +} +float StreamPeer::get_float(){ + + uint8_t buf[4]; + get_data(buf,4); + + if (big_endian) { + uint32_t *p32=(uint32_t *)buf; + *p32=BSWAP32(*p32); + } + + return decode_float(buf); +} + +float StreamPeer::get_double(){ + + uint8_t buf[8]; + get_data(buf,8); + + if (big_endian) { + uint64_t *p64=(uint64_t *)buf; + *p64=BSWAP64(*p64); + } + + return decode_double(buf); + +} +String StreamPeer::get_string(int p_bytes){ + + ERR_FAIL_COND_V(p_bytes<0,String()); + + Vector buf; + buf.resize(p_bytes+1); + get_data((uint8_t*)&buf[0],p_bytes); + buf[p_bytes]=0; + return buf.ptr(); + +} +String StreamPeer::get_utf8_string(int p_bytes){ + + ERR_FAIL_COND_V(p_bytes<0,String()); + ERR_FAIL_COND_V(p_bytes<0,String()); + + Vector buf; + buf.resize(p_bytes); + get_data(buf.ptr(),p_bytes); + + String ret; + ret.parse_utf8((const char*)buf.ptr(),buf.size()); + return ret; + +} +Variant StreamPeer::get_var(){ + + int len = get_32(); + Vector var; + var.resize(len); + get_data(var.ptr(),len); + + Variant ret; + decode_variant(ret,var.ptr(),len); + return ret; +} + void StreamPeer::_bind_methods() { @@ -123,4 +388,36 @@ void StreamPeer::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_data","bytes"),&StreamPeer::_get_data); ObjectTypeDB::bind_method(_MD("get_partial_data","bytes"),&StreamPeer::_get_partial_data); + + ObjectTypeDB::bind_method(_MD("get_available_bytes"),&StreamPeer::get_available_bytes); + + ObjectTypeDB::bind_method(_MD("set_big_endian","enable"),&StreamPeer::set_big_endian); + ObjectTypeDB::bind_method(_MD("is_big_endian_enabled"),&StreamPeer::is_big_endian_enabled); + + ObjectTypeDB::bind_method(_MD("put_8","val"),&StreamPeer::put_8); + ObjectTypeDB::bind_method(_MD("put_u8","val"),&StreamPeer::put_u8); + ObjectTypeDB::bind_method(_MD("put_16","val"),&StreamPeer::put_16); + ObjectTypeDB::bind_method(_MD("put_u16","val"),&StreamPeer::put_u16); + ObjectTypeDB::bind_method(_MD("put_32","val"),&StreamPeer::put_32); + ObjectTypeDB::bind_method(_MD("put_u32","val"),&StreamPeer::put_u32); + ObjectTypeDB::bind_method(_MD("put_64","val"),&StreamPeer::put_64); + ObjectTypeDB::bind_method(_MD("put_u64","val"),&StreamPeer::put_u64); + ObjectTypeDB::bind_method(_MD("put_float","val"),&StreamPeer::put_float); + ObjectTypeDB::bind_method(_MD("put_double","val"),&StreamPeer::put_double); + ObjectTypeDB::bind_method(_MD("put_utf8_string","val"),&StreamPeer::put_utf8_string); + ObjectTypeDB::bind_method(_MD("put_var","val:Variant"),&StreamPeer::put_var); + + ObjectTypeDB::bind_method(_MD("get_8"),&StreamPeer::get_8); + ObjectTypeDB::bind_method(_MD("get_u8"),&StreamPeer::get_u8); + ObjectTypeDB::bind_method(_MD("get_16"),&StreamPeer::get_16); + ObjectTypeDB::bind_method(_MD("get_u16"),&StreamPeer::get_u16); + ObjectTypeDB::bind_method(_MD("get_32"),&StreamPeer::get_32); + ObjectTypeDB::bind_method(_MD("get_u32"),&StreamPeer::get_u32); + ObjectTypeDB::bind_method(_MD("get_64"),&StreamPeer::get_64); + ObjectTypeDB::bind_method(_MD("get_u64"),&StreamPeer::get_u64); + ObjectTypeDB::bind_method(_MD("get_float"),&StreamPeer::get_float); + ObjectTypeDB::bind_method(_MD("get_double"),&StreamPeer::get_double); + ObjectTypeDB::bind_method(_MD("get_string","bytes"),&StreamPeer::get_string); + ObjectTypeDB::bind_method(_MD("get_utf8_string","bytes"),&StreamPeer::get_utf8_string); + ObjectTypeDB::bind_method(_MD("get_var:Variant"),&StreamPeer::get_var); } diff --git a/core/io/stream_peer.h b/core/io/stream_peer.h index e83fc71b930..2bb8f731b23 100644 --- a/core/io/stream_peer.h +++ b/core/io/stream_peer.h @@ -44,6 +44,8 @@ protected: Array _get_data(int p_bytes); Array _get_partial_data(int p_bytes); + bool big_endian; + public: virtual Error put_data(const uint8_t* p_data,int p_bytes)=0; ///< put a whole chunk of data, blocking until it sent @@ -52,7 +54,41 @@ public: virtual Error get_data(uint8_t* p_buffer, int p_bytes)=0; ///< read p_bytes of data, if p_bytes > available, it will block virtual Error get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_received)=0; ///< read as much data as p_bytes into buffer, if less was read, return in r_received - StreamPeer() {} + virtual int get_available_bytes() const=0; + + void set_big_endian(bool p_enable); + bool is_big_endian_enabled() const; + + void put_8(int8_t p_val); + void put_u8(uint8_t p_val); + void put_16(int16_t p_val); + void put_u16(uint16_t p_val); + void put_32(int32_t p_val); + void put_u32(uint32_t p_val); + void put_64(int64_t p_val); + void put_u64(uint64_t p_val); + void put_float(float p_val); + void put_double(double p_val); + void put_utf8_string(const String& p_string); + void put_var(const Variant& p_variant); + + uint8_t get_u8(); + int8_t get_8(); + uint16_t get_u16(); + int16_t get_16(); + uint32_t get_u32(); + int32_t get_32(); + uint64_t get_u64(); + int64_t get_64(); + float get_float(); + float get_double(); + String get_string(int p_bytes); + String get_utf8_string(int p_bytes); + Variant get_var(); + + + + StreamPeer() { big_endian=false; } }; #endif // STREAM_PEER_H diff --git a/core/math/geometry.h b/core/math/geometry.h index b438b41d61e..82148956760 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -886,7 +886,38 @@ public: } + static double vec2_cross(const Point2 &O, const Point2 &A, const Point2 &B) + { + return (double)(A.x - O.x) * (B.y - O.y) - (double)(A.y - O.y) * (B.x - O.x); + } + // Returns a list of points on the convex hull in counter-clockwise order. + // Note: the last point in the returned list is the same as the first one. + static Vector convex_hull_2d(Vector P) + { + int n = P.size(), k = 0; + Vector H; + H.resize(2*n); + + // Sort points lexicographically + P.sort(); + + + // Build lower hull + for (int i = 0; i < n; ++i) { + while (k >= 2 && vec2_cross(H[k-2], H[k-1], P[i]) <= 0) k--; + H[k++] = P[i]; + } + + // Build upper hull + for (int i = n-2, t = k+1; i >= 0; i--) { + while (k >= t && vec2_cross(H[k-2], H[k-1], P[i]) <= 0) k--; + H[k++] = P[i]; + } + + H.resize(k); + return H; + } static MeshData build_convex_mesh(const DVector &p_planes); static DVector build_sphere_planes(float p_radius, int p_lats, int p_lons, Vector3::Axis p_axis=Vector3::AXIS_Z); diff --git a/core/object.cpp b/core/object.cpp index f6ba76a0b56..9fdd11eb2e4 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1613,7 +1613,7 @@ void Object::_bind_methods() { ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"call_deferred",&Object::_call_deferred_bind,mi,defargs); } - ObjectTypeDB::bind_method(_MD("callv:var","method","arg_array"),&Object::callv); + ObjectTypeDB::bind_method(_MD("callv:Variant","method","arg_array"),&Object::callv); ObjectTypeDB::bind_method(_MD("has_method"),&Object::has_method); diff --git a/core/resource.h b/core/resource.h index 3596abe6731..cd28a517553 100644 --- a/core/resource.h +++ b/core/resource.h @@ -144,7 +144,7 @@ public: #ifdef TOOLS_ENABLED - void set_last_modified_time(uint64_t p_time) { last_modified_time=p_time; } + virtual void set_last_modified_time(uint64_t p_time) { last_modified_time=p_time; } uint64_t get_last_modified_time() const { return last_modified_time; } #endif diff --git a/core/typedefs.h b/core/typedefs.h index 6ca31fd1374..460b2e21109 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -197,10 +197,22 @@ static inline int get_shift_from_power_of_2( unsigned int p_pixel ) { return -1; } +/** Swap 16 bits value for endianness */ +static inline uint16_t BSWAP16(uint16_t x) { + return (x>>8)|(x<<8); +} /** Swap 32 bits value for endianness */ static inline uint32_t BSWAP32(uint32_t x) { return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)); } +/** Swap 64 bits value for endianness */ + +static inline uint64_t BSWAP64(uint64_t x) { + x = (x & 0x00000000FFFFFFFF) << 32 | (x & 0xFFFFFFFF00000000) >> 32; + x = (x & 0x0000FFFF0000FFFF) << 16 | (x & 0xFFFF0000FFFF0000) >> 16; + x = (x & 0x00FF00FF00FF00FF) << 8 | (x & 0xFF00FF00FF00FF00) >> 8; + return x; +} /** When compiling with RTTI, we can add an "extra" * layer of safeness in many operations, so dynamic_cast diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index 85cc2bbc7f8..ece9a02e243 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -482,8 +482,8 @@ void UndoRedo::_bind_methods() { ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"add_undo_method",&UndoRedo::_add_undo_method,mi,defargs); } - ObjectTypeDB::bind_method(_MD("add_do_property","object", "property", "value:var"),&UndoRedo::add_do_property); - ObjectTypeDB::bind_method(_MD("add_undo_property","object", "property", "value:var"),&UndoRedo::add_undo_property); + ObjectTypeDB::bind_method(_MD("add_do_property","object", "property", "value:Variant"),&UndoRedo::add_do_property); + ObjectTypeDB::bind_method(_MD("add_undo_property","object", "property", "value:Variant"),&UndoRedo::add_undo_property); ObjectTypeDB::bind_method(_MD("add_do_reference","object"),&UndoRedo::add_do_reference); ObjectTypeDB::bind_method(_MD("add_undo_reference","object"),&UndoRedo::add_undo_reference); ObjectTypeDB::bind_method(_MD("clear_history"),&UndoRedo::clear_history); diff --git a/demos/misc/autoload/global.gd b/demos/misc/autoload/global.gd index 2671b6f4128..735995e8069 100644 --- a/demos/misc/autoload/global.gd +++ b/demos/misc/autoload/global.gd @@ -1,7 +1,9 @@ extends Node -# Member variables -var current_scene = null + +# Changing scenes is most easily done using the functions `change_scene` +# and `change_scene_to` of the SceneTree. This script demonstrates how to +# change scenes without those helpers. func goto_scene(path): @@ -18,20 +20,17 @@ func goto_scene(path): func _deferred_goto_scene(path): - # Immediately free the current scene, - # there is no risk here. - current_scene.free() + # Immediately free the current scene, there is no risk here. + get_tree().get_current_scene().free() # Load new scene - var s = ResourceLoader.load(path) + var packed_scene = ResourceLoader.load(path) # Instance the new scene - current_scene = s.instance() + var instanced_scene = packed_scene.instance() - # Add it to the active scene, as child of root - get_tree().get_root().add_child(current_scene) - - -func _ready(): - # Get the current scene at the time of initialization - current_scene = get_tree().get_current_scene() + # Add it to the scene tree, as direct child of root + get_tree().get_root().add_child(instanced_scene) + + # Set it as the current scene, only after it has been added to the tree + get_tree().set_current_scene(instanced_scene) diff --git a/demos/misc/autoload/scene_a.gd b/demos/misc/autoload/scene_a.gd index f9c39887b03..03da86d9a02 100644 --- a/demos/misc/autoload/scene_a.gd +++ b/demos/misc/autoload/scene_a.gd @@ -1,16 +1,5 @@ - extends Panel -# Member variables here, example: -# var a=2 -# var b="textvar" - - -func _ready(): - # Initalization here - pass - func _on_goto_scene_pressed(): get_node("/root/global").goto_scene("res://scene_b.scn") - pass # Replace with function body diff --git a/demos/misc/autoload/scene_b.gd b/demos/misc/autoload/scene_b.gd index fdf2287a046..dea8c4623f0 100644 --- a/demos/misc/autoload/scene_b.gd +++ b/demos/misc/autoload/scene_b.gd @@ -1,16 +1,5 @@ - extends Panel -# Member variables here, example: -# var a=2 -# var b="textvar" - - -func _ready(): - # Initalization here - pass - func _on_goto_scene_pressed(): get_node("/root/global").goto_scene("res://scene_a.scn") - pass # Replace with function body diff --git a/Doxyfile b/doc/Doxyfile similarity index 99% rename from Doxyfile rename to doc/Doxyfile index 4268ed8c7db..c1904f17c92 100644 --- a/Doxyfile +++ b/doc/Doxyfile @@ -51,14 +51,14 @@ PROJECT_BRIEF = "Game Engine MIT" # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = ./logo_small.png +PROJECT_LOGO = ../logo.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ./doc/doxygen/ +OUTPUT_DIRECTORY = ./_build/doxygen/ # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -768,7 +768,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = ./core/ ./main/ ./scene/ +INPUT = ../core/ ../main/ ../scene/ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 00000000000..286a5162aff --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,47 @@ +BASEDIR = $(CURDIR) +CLASSES = $(BASEDIR)/base/classes.xml +OUTPUTDIR = $(BASEDIR)/_build +TOOLSDIR = $(BASEDIR)/tools + +.ONESHELL: + +clean: + rm -rf $(OUTPUTDIR) + +doku: + rm -rf $(OUTPUTDIR)/doku + mkdir -p $(OUTPUTDIR)/doku + pushd $(OUTPUTDIR)/doku + python2 $(TOOLSDIR)/makedoku.py $(CLASSES) + popd + +doxygen: + rm -rf $(OUTPUTDIR)/doxygen + mkdir -p $(OUTPUTDIR)/doxygen + doxygen Doxyfile + +html: + rm -rf $(OUTPUTDIR)/html + mkdir -p $(OUTPUTDIR)/html + pushd $(OUTPUTDIR)/html + python2 $(TOOLSDIR)/makehtml.py -multipage $(CLASSES) + popd + +markdown: + rm -rf $(OUTPUTDIR)/markdown + mkdir -p $(OUTPUTDIR)/markdown + pushd $(OUTPUTDIR)/markdown + python2 $(TOOLSDIR)/makemd.py $(CLASSES) + popd + +rst: + rm -rf $(OUTPUTDIR)/rst + mkdir -p $(OUTPUTDIR)/rst + pushd $(OUTPUTDIR)/rst + echo "TODO" + popd + +textile: + rm -rf $(OUTPUTDIR)/textile + mkdir -p $(OUTPUTDIR)/textile + python3 $(TOOLSDIR)/makedocs.py --input $(CLASSES) --output $(OUTPUTDIR)/textile diff --git a/doc/core_classes.xml b/doc/core_classes.xml deleted file mode 100644 index c37b50f1226..00000000000 --- a/doc/core_classes.xml +++ /dev/null @@ -1,2654 +0,0 @@ - - - - - Vector class, which performs basic 3D vector math operations. - - - Vector3 is one of the core classes of the engine, and includes several built-in helper functions to perform basic vecor math operations. - - - - - - - Sum. - - - Add two vectors. - - - - - - - Difference. - - - Substract two vectors. - - - - - - - Quotient. - - - Divide two vectors (component wise). - - - - - - - Product. - - - Multiply two vectors (components wise). - - - - - Axis Index. - - - Value. - - - Set an individual axis (0 is X, 1 is Y and 2 is Z). the enum constants Vector.AXIS_X, Vector.AXIS_Y, and Vector.AXIS_Z, are also valid. This is specially useful for for-loops. - - - - - Axis Index. - - - Value. - - - Set an individual axis (0 is X, 1 is Y and 2 is Z). the enum constants Vector.AXIS_X, Vector.AXIS_Y, and Vector.AXIS_Z, are also valid. This is specially useful for for-loops. - - - - - Length: sqrt(x^2+y^2+z^2) - - - Return the length of the vector. - - - - - Squared Length: x^2+y^2+z^2. - - - Return the length of the vector, without the square root step. - - - - - Normalize the vector to unit length. This is the same as v = v / v.length() - - - - - - - Return a copy of the normalized vector to unit length. This is the same as v / v.length() - - - - - Inverse: 1/v - - - Returns the inverse of the vector. this is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z ) - - - - - Set x,y and z to 0. - - - - - - - Snap the vector in each axis the the lowest nearest multiple. ie: 4,5,7 snapped to 2 equals 4,4,6. - - - - - - - Snapped copy. - - - Return a copy of the vector, snapped to the lowest neared multiple. - - - - - - - - - - - Linearly interpolates the vector to a given one (b), by the given amount (i) - - - - - - - - - - - - - - - Perform a cubic interpolation between vectors a,b,c,d (b is current), by the given amount (i). - - - - - - - Cross product. - - - Return the cross product with b. - - - - - - - - - Return the dot product with b. - - - - - - - - - Return the distance to b. - - - - - - - - - Return the squared distance (distance minus the last square root) to b. - - - - - - - - - - - - - - - - - - - - - - - Axis-Aligned-Bounding-Box. - - - AABB stands for "Axis Aligned Bounding Box". It consits of a position and a size, which for an box that is always aligned to the x, y and z axis, which goes from "pos" to "pos+size". - - - - - - - Returns true if the AABB volume is empty (even if it has a surface). Holds true if size.x,y or z is 0. - - - - - - - Return true if size is 0,0,0. - - - - - - - Compute the volume of the AABB. - - - - - - - - - Returns true if this AABB shares a portion of space with b. - - - - - - - - - Returns true if this AABB completely encloses b. - - - - - - - Expand this AABB to also enclose the area of b. - - - - - - - - - Return the shared portion of space with b (empty if they don't intersect). - - - - - - - - - result (if they intersect) - - - normal (if they intersect) - - - - - Returns true if this AABB intersects segment "a" towards "b". Also, return the point and normal of intersection. - - - - - - - - - Returns true if this AABB intersects the plane b. - - - - - - - - - Return true if this AABB contains point "p". - - - - - Axis direction - - - Get the normal of the longest axis in this AABB. - - - - - - - Get the index of the longest axis in this AABB. - - - - - Get the length of the longest axis in this AABB. - - - - - - - - - - - Get one of the edges (0 to 11) of this AABB in "ra" and "rb". - - - - - - - Grow this AABB, by expanding its margin, by "s". - - - - - - - Expand this AABB to contain point "p". - - - - - - Position of the AABB. - - - Suze of the AABB (should always be positive). - - - - - - Plane in hessian form. - - - Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing. - - - - - Normalize the plane (although it will be often normalized already). - - - - - - - Returns a copy of the plane, normalized. - - - - - - - - - Returns true if "p" is located above the plane. - - - - - - - - - Returns the orthogonal distance from "p" to the plane. If positive, "p" is above, if negative, "p" is below. - - - - - - - - - Returns true if "p" is inside the plane (by a very minimum treshold). - - - - - - - - - - - - - Returns true if this plane intersects with planes "a" and "b". The resulting intersectin is placed in "r". - - - - - - - - - - - - - Returns true if ray consiting of position "p" and direction normal "d" intersects this plane. If true, the result is placed in "r". - - - - - - - - - - - - - Returns true if segment from position "sa" to position "sb" intersects this plane. If true, the result is placed in "r". - - - - - - - - - - Returns the orthogonal projection of point "p" into a point in the plane. - - - - - - - - - Returns true if plane "b" is very similar to this one. - - - - - - Plane normal vector (a,c and d in the plane equation normalized). - - - Plane distance (d in the plane equation). - - - - - - Quaternion. - - - Quaternion is a 4 dimensional vector that is used to represet a rotation. It mainly exists to perform SLERP (spherical-linear interpolation) between to rotations obtained by a Matrix3 cheaply. Adding quaternions also cheaply adds the rotations, however quaternions need to be often normalized, or else they suffer from precision issues. - - - - - - - Returns the length of the quaternion. - - - - - - - Returns the length of the quaternion, minus the square root. - - - - - Normalize the quaternion to unit length. - - - - - - - Returns a copy of the quaternion, normalized to unit length. - - - - - - - Returns the inverse of the quaternion (applies to the inverse rotatio too). - - - - - - - - - Returns the dot product between two quaternions. - - - - - - - Create a quaternion from euler rotation "e", as yaw, pitch, roll. - - - - - - - - - - - Perform a spherical-linear interpolation with another quaternion. - - - - - - - - - Peform multiplication between two quaternions. - - - - - - x-axis - - - y-axis - - - z-axis - - - w-axis - - - - - - 3x3 Matrix. - - - Matrix represent a 3x3 (3 rows by 3 columns) transformation matrix. it is used mainly to represent and accumulate transformations such as rotation or scale when used as an OCS (oriented coordinate system). - - - - - Invert the matrix (transformations are reversed). - - - - - Transpose the matrix (transformations are reversed only for orthogonal matrices). - - - - - - - Returns the inverse of the matrix. - - - - - - - Returns the transposition of the matrix. - - - - - - - - - Rotates the matrix in normalized "axis" by amount "phi" in radians. (This is equivalent to glRotate from OpenGL). - - - - - - - Scale each axis of the rotated matrix by 's". - - - - - - - Get the scale of the matrix. - - - - - - - Create an orthogonal matrix from euler angles "e", as yaw, pitch, roll. - - - - - - - Computes and returns the euler engles for an orthogonal matrix, as yaw, pitch, roll. - - - - - - - - - Computes and returns a dot product with transposed axis x. - - - - - - - - - Computes and returns a dot product with transposed axis y. - - - - - - - - - Computes and returns a dot product with transposed axis z. - - - - - - - - - Transforms vector "v" by this matrix (as M x V) and returns the result. - - - - - - - - - Inverse-transforms vector "v" by this matrix (as V x M) and returns the result. - - - - - - - - - Get an axis of the OCS. (0 is X, 1 is Y and 2 is Z). The enum constants Vector.AXIS_X, Vector.AXIS_Y, and Vector.AXIS_Z, are also valid. This is equivalent to get_column(). - - - - - - - - - Set an axis of the OCS. (0 is X, 1 is Y and 2 is Z). The enum constants Vector.AXIS_X, Vector.AXIS_Y, and Vector.AXIS_Z, are also valid. This is equivalent to set_column() - - - - - - - - - Get a matrix row. - - - - - - - - - Set a matrix row. - - - - - - - - - Get a matrix column. This is equivalent to get_axis() - - - - - - - - Set a matrix column. This is equivalent to set_axis - - - - - - - - - - Perform a matrix multiplication (M x N) and return the result. - - - - - - - - - Perform a transposed-matrix multiplication (Mt x N) and return the result. - - - - - - - - - - - - - - - - - - - - - - - - - - - Transformation. - - - Transform is used to store transformations, including translations. It consists of a Matrix3 "basis" and Vector3 "origin". Transform is used to represent transformations of any object in space. It is similar to a 4x3 matrix. - - - - - Invert the transform. - - - - - - - - Returns the inverse of the transform. - - - - - - - - - Rotates the transform in normalized "axis" by amount "phi" in radians. (This is equivalent to glRotate from OpenGL). - - - - - - - Scales the whole transform by "s" (including the origin) - - - - - - - Get the basis. - - - - - - - Translate the transform by "v". - - - - - "Eye" Position. - - - "Target" Position. - - - "Up" Normal Vector. - - - Creates a transform positioned at "eye", looking towards "target". "up" represents the direction where "up" is. This function is useful for setting up cameras. - - - - - - - - - Transforms vector "v" by this transform. - - - - - - - - - Inverse-transforms vector "v" by this transform. - - - - - - - - - Transforms AABB "a" by this transform. The resulting aabb will often be larger, so succesive transforms are not recommended. - - - - - - - - - Inverse-transforms AABB "a" by this transform. The resulting aabb will often be larger, so succesive transforms are not recommended. - - - - - - - - - Transform plane "p" by this transform. - - - - - - - - - Inverse-transforms plane "p" by this transform. - - - - - - Transform "basis" or OCS. - - - Transform origin. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Vector used for 2D Math. - - - Vector class, which performs basic 2D vector math operations. - - - - - - - - - Add two vectors. - - - - - - - - - Substract two vectors. - - - - - - - - - Divide two vectors. - - - - - - - - - Multiply two vectors. - - - - - - - Returns the length of the vector. - - - - - - - Returns the squared length of the vector. - - - - - Normalizes the vector to unit length. - - - - - - - Returns a normalized vector to unit length. - - - - - Sets x and y to 0. - - - - - - - - - - - Returns the result of the linear interpolation between this vector and "b", by amount "i". - - - - - - - - - Returns the dot product with vector "b". - - - - - - - - - Returns the distance to vector "b". - - - - - - - Remove the fractional part of x and y. - - - - - - - - - - - - - - - Positioned rectangle in 2D. - - - Rect2 represets a positioned rectangle of position "pos" and "size". - - - - - - - Returns "true" if the rectangle has no area. - - - - - - - - - Returns true if v is contained within the rectangle. - - - - - - - Extend the rectangle to enclose "b". - - - - - - - - - Return the interection with rectangle "b" - - - - - - - Extend the rectangle margin by "m". - - - - - - Position of the rectangle. - - - Size of the rectangle. - - - - - - - - - - - - - - - Color in RGBA format. - - - A color is represented as red, green and blue (r,g,b) components. Additionally, "a" represents the alpha component, often used for transparency. - - - - - - - Convert the color to a 32 its integer (each byte represets a RGBA). - - - - - - - Convert the color to gray. - - - - - - - Compute the "hue" of the color. - - - - - - - Compute the "saturation" of the color. - - - - - - - Compute the "value" of the color. - - - - - - - - - - - Set the color from the HSV format. - - - - - Invert the color. - - - - - Contrast the color. - - - - - - - (0 to 1) - - - Linearly blend with color "c", by amount "i". - - - - - - Red. - - - Green. - - - Blue. - - - Alpha. - - - - - - Two Dimensional Image. - - - Image represents a two-dimensional representation of an image, composed by a color per pixel. - - - - - - - Returns the width of the image (in pixels). - - - - - - - Returns the height of the image (in pixels). - - - - - - - - - - - Get the color of the pixel at position (x,y). - - - - - - - - - - - Sets the color of the pixel at position (x,y). - - - - - - - Convert the image to a new format (valid values in the FORMAT_* enumeration). - - - - - - - Get the image format (valid values in the FORMAT_* enumeration). - - - - - - - - - Resize the image to a new pixel resolution given by width,height. - - - - - - - - - Crop the image to a new pixel resolution given by width,height. - - - - - Flip the X axis of the image. - - - - - Flip the Y axis of the image. - - - - - - - Create a mipmap from "source" image. - - - - - - - Create a normalmap from "height_scale" image. - - - - - - - - - - - Create a new image of size width, height and format. - - - - - - - - - - - - - Import an image from raw data, given a specific format. - - - - - - - Returns true if the image is empty. - - - - - - - - - Load an image from a file in "path". - - - - - - - - - - - - - - - - - - - - - - - Resource ID. - - - RID references a resource, typically created in a server. - - - - - - - Returns true if the resource is valid. - - - - - - - A struct containing information fron an input device. - - - A struct containing information fron an input event, such as mouse, keyboard, joystick, etc. Valid event types are:

- -
  • InputEvent.NONE
  • -
  • InputEvent.KEY
  • -
  • InputEvent.MOUSE_BUTTON
  • -
  • InputEvent.MOUSE_MOTION
  • -
  • InputEvent.JOYSTICK_MOTION
  • -
  • InputEvent.JOYSTICK_BUTTON
  • -
    - -
    - - - Event ID. Every event as a unique ID. - - - Event type (check description). - - - Device that originated the event. - - - Mouse x position (for mouse events). - - - Mouse y position (for mouse events). - - - State of the mouse buttons as a bitmask (for key and mouse events) - - - Global mouse x position (used in GUI Controls). - - - Global mouse y position (used in GUI Controls). - - - if MOUSE_BUTTON was a press, this value is true. - - - if MOUSE_BUTTON was a doubleclick, this value is true. - - - Index of the clicked button (mouse button event). - - - Relative x motion of the mouse (mouse motion event). - - - Relative y motion of the mouse (mouse motion event). - - - If ALT modifier is pressed, this is true (mouse and key events). - - - If SHIFT modifier is pressed, this is true (mouse and key events). - - - If CONTROL modifier is pressed, this is true (mouse and key events). - - - If META modifier (win/apple/etc keys) is pressed, this is true (mouse and key events). - - - if a KEY event originated from a keypress, this is true. - - - if a KEY event originated from an echo key, this is true. - - - Unicode value of a key pressed (key event). - - - Scancode of a key pressed (check the KEY_* enumeration) (key event). - - - Joystick button index (joy button event). - - - If joystick button was pressed, this is true (joy button event). - - - Index of the pressed/released joystick button. - - - Axis of a joystick (joy axis event). - - - Axis value a joystick, from -1 to 1 (joy axis event). - - - - - Empty input event. - - - Key pressed/released event. - - - Mouse button pressed/released event. - - - Joystick axis motion event. - - - Joystick button press/release event. - - - -
    - - - File Access Interface. - - - FileAccess provides access to files in the host platform (remote access to files in webserver in the web plugin, as web plugin does not access the local filesystem). - - - - - Path to a file - - - Open mode: FileAccess.READ, FileAccess.WRITE or FileAccess.READ_WRITE - - - Error value (check the ERR_ macro for the meaning of the values) - - - Open a file in a given path. Error is returned if the file can't be opened, is nt found, etc. - - - - - Closes a currently open file. - - - - - - - Returns true if a file is currently open. - - - - - - - Seek to a given position (in bytes) in the file. - - - - - - - Seek to a given position (in bytes) in the file, from the end of the file. - - - - - - - Get the current position in the file. - - - - - - - Get the open file size (in bytes). - - - - - - - Returns true if EOF was reached (read past end of file). - - - - - - - Read a byte from the file. - - - - - - - Read a 16-bits unsigned integer from the file, in little/big endian format. - - - - - - - Read a 32-bits unsigned integer from the file, in little/big endian format. - - - - - - - Change the endian mode for reading sizes larger than a byte (read big endian files). - - - - - - - Return the status of the endian swap. - - - - - - - Store a byte in the file. - - - - - - - Store a 16-bits integer in the file. - - - - - - - Store a 32 bits integer in the file. - - - - - - - - - Returns true if a given file (in path) exist. - - - - - - - - - - - - - - - - Directory Tree Access Interface. - - - Dir provides access to directories in the host platform (remote access to files in webserver in the web plugin, as web plugin does not access the local filesystem). - - - - - true if an error ocurred. - - - Begin a directory listing. This is done iteratively due to the positility of directories with a large amount of entries. - - - - - - - Get the next item. If the return value is empty (""), then the end of the directory has been reached. - - - - - - - Returns true if the current item is a directory (not a file). - - - - - End the directory listing. - - - - - - - Get the amount of drives (windows only, returns 0 on other platforms). - - - - - - - - - Get the string (or character) representing the drive (such as "C","D",etc). - - - - - - - - - Change the current directory of the dir access. "dir" can be either absolute or relative. - - - - - - - Get the full path of the current dir. - - - - - - - Get the string or character most commonly used as drive separator in the host OS. - - - - - - - true on error. - - - Create a new directory. "name" can be either absolute or relative. - - - - - - - - - Returns true if a file exist. "path" can be either absolute or relative. - - - - - - - Return the space left on the device, in kilobytes. - - - - - - - Video Mode structure. - - - Describes a video mode. - - - - - - - - "true" if the video mode is full scren. - - - "true" if the video mode can be resized to another video mode. - - - - - - Date structure. - - - Describes a date. - - - - year (integer) - - - day of the year - - - day of the week (0 to 6) - - - month of the year (0 to 11) - - - "true" if daylight savings is enabled. - - - - - - Current Time. - - - Describes the current time. - - - - (0 to 11) - - - (0 to 59) - - - (0 to 59) - - - - - - Operating System common functions. - - - OS provides access to common host OS functions. "OS" Must not be instanced. All members are static (called like OS.get_name() ). - - - - - - - Produce an alert. On OSs such as windows or mac, this may result in a popup dialog. - - - - - - - Determine the hardware cursor visibility (if available). - - - - - - - Capture the hardware cursor (if available). - - - - - - - Returns true if the application is capturing the hardware cursor. - - - - - - - Get the name of the host OS or Platform. - - - - - - - Change the current videomode (if available). - - - - - - - Get the current videomode. - - - - - - - Get the current date. - - - - - - - Get the current time. - - - - - - - Get the amount of milliseconds since the app started. - - - - - - - Suspend the calling thread for "usec" milliseconds - - - - - - - Common math functions. - - - Math provides implementations of commonly used math functions."Math" shouldt not be instanced since all members are static (called like Math.cos() ). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Degrees to Radians conversion. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Round to nearest (lowest) value in given step. - - - - - - - - - - - - - - - - - - - - - - - - - Returns the amount of decimals used by "s". - - - - - - - Returns a random number fro 0 to 1 - - - - - - - - - - - Returns a random number between "min" and "max" - - - - - - - - - - - - Shell Execution interface. - - - Shell allows the application to open a given URL in the host OS. It can be anything the host OS understands, from a web page to a media file. - - - - - - - Open any URL the host OS understands. - - - - - - - Resource Loader. - - - ResourceLoader loads resources from disk and returns a resource object. - - - - - - - null on failure. - - - Open a resource in the given path. - - - - - - - Scene Loader - - - SceneLoader loads scenes from disk and returns a scene node. - - - - - - - A scene node, null on error. - - - Load a scene from disk at given "path" and return a node object. - - - - - - - Base class for the Object Model. - - - Object is the building block of most of the high level engine interfaces. The "Object" interface contains a reference to an actual internal Object. - Usually, Object memory should not be managed by the API, as resources will be fred automatically when not in use and nodes are deleted by their parent nodes. - - - - - Free the Object reference. This should not be used with nodes inside a scene tree, as they are removed by their parent node. This function can also be used to unreference resources. - - - - - - - Get a string with the type name of the object. - - - - - - - Returns true if the Object datatype contains a reference to an actual object instance. - - - - - - - Return the instance ID of the object. Every Object has a unique instance ID. - - - - - - - - - Return true if the type of the object class (or any base clases) match "type. - - - - - - - - - Set a property "property", with any value "value. This function can be inherited with "_set" (but base class "_set" will still be called). - - - - - - - - - Return a property "property". This function can be inherited with "_get" (but base class "_get" will still be called). - - - - - - - - - Perform a notification. Notifications are quick ways to tell an Object that something happened or changed regarding it's state and surroundings. This function can be inherited with "_notification" (but base class "_notification" will still be called). - - - - - - - Set the script of the object. Any object can contain a script. Scripts behave as if they inherited the object they are set to - - - - - - - Return the script of the object. Any object can contain a script. Scripts behave as if they inherited the object they are set to - - - - - - - Set a meta property. Meta properties are just containers for setting and retrieving any custom data to an object. Metaproperties are also saved with the object. - - - - - - - Return a meta property. Meta properties are just containers for setting and retrieving any custom data to an object. Metaproperties are also saved with the object. - - - - - - - - - Return wether an object has a meta property. Meta properties are just containers for setting and retrieving any custom data to an object. Metaproperties are also saved with the object. - - - - - - - Return the list of meta properties in the object. Meta properties are just containers for setting and retrieving any custom data to an object. Metaproperties are also saved with the object. - - - - - - - Call any method in the object (syntax: call("method", .. arguments..). - - - - - - This notification is called right after the object is done initializing - - - This notification is called right before the object will e deleted. - - - - - - All Symbolic Key Names - - - Key is an enumaration containing the constants for all the symbolic key names. They are used directly (not with Key. prefix). This value is used in the "scancode" field of the "KEY" InputEvent. - - - Special Key Mask - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Property Hints. - - - PropertyHint hints editors on how to edit a property. In many cases, hint_string (in the PropertyInfo) will contain extra data. These constants are used globally ("PropertyHint" class doesn't exist"). - - - - Hint_string defined as "min,max,step - " - Values such as 0,1,2 are represented in hint_string as "A,B,C" - hint_string is the length of an array type. - Flags names are in hint_string from MSB to LSB as "flag8,fla7,flag6,,,,flag1" - Property is a path. - Property is a path to a file. - Property is a path to a dir. - hint_string contains the valid resource types the property accept (separated by ","). - - - - - Usage for an object property. - - - PropertyUsage defines a list of (inclusive) usages that can be ORed together to specify how the property will be treated in different scenarios. These constants are used globally ("PropertyUsage" class doesn't exist"). - - - Property is Saved/Loaded from disk. - Property is visible in editor (for editing). - Property can be syncronized on network. - Default usage. - - - - - Valid Data Types. - - - Type consists of a list of valid types. It is usually used for property type hinting. These constants are used globally ("Type" class doesn't exist"). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - List of generic errors. - - - Error is a list of generic errors - - - - Generic fail error - What is requested is unsupported/unavailable - The object being used hasnt been properly set up yet - Missing credentials for requested resource - Parameter given out of range - Out of memory - - - - - - - - - - - - Can't open a resource/socket/file - - - - resource is locked - - - Data passed is invalid - Parameter passed is invalid - When adding"> item already exists - When retrieving/erasing"> it item does not exist - database is full - database is full - - - - - - - user requested help!! - a bug in the software certainly happeneddue to a double check failing or unexpected behavior. - an impossible to trigger check due to paranoid programmer was triggered - - -
    - - diff --git a/doc/deferred_format.txt b/doc/deferred_format.txt deleted file mode 100644 index 76a158a3ce5..00000000000 --- a/doc/deferred_format.txt +++ /dev/null @@ -1,33 +0,0 @@ -deferred: - -ar ag ab gl - accumulation RGB + glow - -nx ny mx my? - normal, motion -dr dg db sm - diffuse, shademodel -sr sg sb sp - specular OR shadeparams - -ar ag ab gl -nx ny sp sp -dr dg db se -444 6 -se can be 6 bits, 2 for shade model - -shade models: - -0 - none -1 - wrap -2 - toon -3 - fresne - - - -sp: 2 bits what - 6 bits param - -16 - - - - - - - diff --git a/doc/demos.txt b/doc/demos.txt deleted file mode 100644 index cf56a5cbc61..00000000000 --- a/doc/demos.txt +++ /dev/null @@ -1,40 +0,0 @@ --Oceano --Portales --Grilla --Personaje --Auto (?) --Fisica --Fisica Idle --Low level APIS (Server) --Sonido Posicional --Custom Shaders --HDR --Trees Waving --luces --fixed material --shader material --synctoaudio speech and speex --particulas con gif animados para mostrar que es cada parametro --soporte de syntax hilight de gdscript para editores mas comunes --instanciar enemigos usando duplicate --simulated motion con animacion --animation player controla otro animation player (tipo camina de lugar a otro y saluda) --corutinas y loops con yield para animation, audio, etc --CCD (bullets) - --custom gizmos, editor plugins en script - -Clases que necesitan tutorial. - -Animation/AnimationPlayer -Area2D (space override, notifications) -custom container demo -custon drawing in a canvas item -ignore mouse on top of button -input in a game, with _unhandled_input -demo containers -Control, anchors e input event handling -lots of 2D physics examples -dictionary and array doc of passing by reference? - - diff --git a/doc/engine_classes.xml b/doc/engine_classes.xml deleted file mode 100644 index 43602e26e97..00000000000 --- a/doc/engine_classes.xml +++ /dev/null @@ -1,17940 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/examples/physics/script/test_base.sq b/doc/examples/physics/script/test_base.sq deleted file mode 100644 index 9d5451728fd..00000000000 --- a/doc/examples/physics/script/test_base.sq +++ /dev/null @@ -1,295 +0,0 @@ - -class PhysicsTestBase extends MainLoopScripted { - - - bodies=[] - type_mesh_map={} - type_shape_map={} - cameratr=Transform() - - - function body_changed_transform(p_transform, p_velocity, p_angular_velocity,p_sleeping, p_visual_instance) { - - VisualServer.instance_set_transform(p_visual_instance,p_transform); - } - - - function create_body(p_shape, p_body_mode, p_location, p_active=true) { - - local mesh_instance = VisualServer.instance_create( type_mesh_map[p_shape] ) - local body = PhysicsServer.body_create(RID(),p_body_mode,!p_active) - PhysicsServer.body_add_shape(body,type_shape_map[p_shape]) - - local query = PhysicsServer.query_create(this,"body_changed_transform",mesh_instance) - PhysicsServer.query_body_state(query, body) - - PhysicsServer.body_set_state( body, PhysicsServer.BODY_STATE_TRANSFORM, p_location ) - bodies.append( body ) - return body - - } - - - function create_static_plane(p_plane) { - - local plane_shape = PhysicsServer.shape_create(PhysicsServer.SHAPE_PLANE) - PhysicsServer.shape_set_data( plane_shape, p_plane ); - - local b = PhysicsServer.body_create(RID(), PhysicsServer.BODY_MODE_STATIC ); - PhysicsServer.body_add_shape(b, plane_shape); - return b; - } - - function configure_body( p_body, p_mass, p_friction, p_bounce) { - - PhysicsServer.body_set_param( p_body, PhysicsServer.BODY_PARAM_MASS, p_mass ); - PhysicsServer.body_set_param( p_body, PhysicsServer.BODY_PARAM_FRICTION, p_friction ); - PhysicsServer.body_set_param( p_body, PhysicsServer.BODY_PARAM_BOUNCE, p_bounce ); - - } - - function init_shapes() { - - - /* SPHERE SHAPE */ - local sphere_mesh = VisualServer.make_sphere_mesh(10,20,1.0); - local sphere_material = VisualServer.fixed_material_create(); - //VisualServer.material_set_flag( sphere_material, VisualServer.MATERIAL_FLAG_WIREFRAME, true ); - VisualServer.fixed_material_set_parameter( sphere_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.7,0.8,3.0) ); - VisualServer.mesh_surface_set_material( sphere_mesh, 0, sphere_material ); - type_mesh_map[PhysicsServer.SHAPE_SPHERE] <- sphere_mesh; - - local sphere_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_SPHERE); - PhysicsServer.shape_set_data( sphere_shape, 1.0 ); - type_shape_map[PhysicsServer.SHAPE_SPHERE] <- sphere_shape; - - /* BOX SHAPE */ - - local box_planes = GeometryUtils.build_box_planes(Vector3(0.5,0.5,0.5)); - local box_material = VisualServer.fixed_material_create(); - VisualServer.fixed_material_set_parameter( box_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(1.0,0.2,0.2) ); - local box_mesh = VisualServer.mesh_create(); - - VisualServer.mesh_add_surface_from_planes(box_mesh,box_planes); - VisualServer.mesh_surface_set_material( box_mesh, 0, box_material ); - type_mesh_map[PhysicsServer.SHAPE_BOX]<- box_mesh; - - local box_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_BOX); - PhysicsServer.shape_set_data( box_shape, Vector3(0.5,0.5,0.5) ); - type_shape_map[PhysicsServer.SHAPE_BOX]<- box_shape; - - /* CYLINDER SHAPE */ - - local cylinder_planes = GeometryUtils.build_cylinder_planes(0.5,1,12 - ,Vector3.AXIS_Z); - local cylinder_material = VisualServer.fixed_material_create(); - VisualServer.fixed_material_set_parameter( cylinder_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.3,0.4,1.0) ); - local cylinder_mesh = VisualServer.mesh_create(); - - VisualServer.mesh_add_surface_from_planes(cylinder_mesh,cylinder_planes); - VisualServer.mesh_surface_set_material( cylinder_mesh, 0, cylinder_material ); - type_mesh_map[PhysicsServer.SHAPE_CYLINDER]<- cylinder_mesh; - - local cylinder_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_CYLINDER); - local cylinder_params={} - cylinder_params["radius"]<- 0.5; - cylinder_params["height"]<- 2; - PhysicsServer.shape_set_data( cylinder_shape, cylinder_params ); - type_shape_map[PhysicsServer.SHAPE_CYLINDER]<- cylinder_shape; - - /* CAPSULE SHAPE */ - - local capsule_planes = GeometryUtils.build_capsule_planes(0.5,0.7,12,Vector3.AXIS_Z); - local capsule_material = VisualServer.fixed_material_create(); - VisualServer.fixed_material_set_parameter( capsule_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.3,0.4,1.0) ); - - local capsule_mesh = VisualServer.mesh_create(); - - VisualServer.mesh_add_surface_from_planes(capsule_mesh,capsule_planes); - VisualServer.mesh_surface_set_material( capsule_mesh, 0, capsule_material ); - type_mesh_map[PhysicsServer.SHAPE_CAPSULE]<-capsule_mesh; - - local capsule_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_CAPSULE); - local capsule_params={} - capsule_params["radius"]<- 0.5; - capsule_params["height"]<- 1.4; - PhysicsServer.shape_set_data( capsule_shape, capsule_params ); - type_shape_map[PhysicsServer.SHAPE_CAPSULE]<- capsule_shape; - - /* CONVEX SHAPE */ - - local convex_planes = GeometryUtils.build_cylinder_planes(0.5,0.7,5,Vector3.AXIS_Z); - local convex_material = VisualServer.fixed_material_create(); - VisualServer.fixed_material_set_parameter( convex_material, VisualServer.FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.8,0.2,0.9)); - - local convex_mesh = VisualServer.mesh_create(); - VisualServer.mesh_add_surface_from_planes(convex_mesh,convex_planes); - VisualServer.mesh_surface_set_material( convex_mesh, 0, convex_material ); - type_mesh_map[PhysicsServer.SHAPE_CONVEX_POLYGON]<- convex_mesh; - - local convex_shape=PhysicsServer.shape_create(PhysicsServer.SHAPE_CONVEX_POLYGON); - PhysicsServer.shape_set_data( convex_shape, convex_planes ); - type_shape_map[PhysicsServer.SHAPE_CONVEX_POLYGON]<- convex_shape; - - } - - function make_trimesh(p_faces,p_xform=Transform()) { - - local trimesh_shape = PhysicsServer.shape_create(PhysicsServer.SHAPE_CONCAVE_POLYGON); - PhysicsServer.shape_set_data(trimesh_shape, p_faces); - p_faces=PhysicsServer.shape_get_data(trimesh_shape); // optimized one - normals=[] - - for (i=0;i 5: -\end_layout - -\begin_layout Plain Layout - - print(param2) -\end_layout - -\begin_layout Plain Layout - - else: -\end_layout - -\begin_layout Plain Layout - - print("fail!") -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - - for i in range(20): -\end_layout - -\begin_layout Plain Layout - - print(i) -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - - while(param2!=0): -\end_layout - -\begin_layout Plain Layout - - param2-=1 -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - - var local_var2 = param1+3 -\end_layout - -\begin_layout Plain Layout - - return local_var2 -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -#subclass -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -class Something: -\end_layout - -\begin_layout Plain Layout - - var a=10 -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -#constructor -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -func _init(): -\end_layout - -\begin_layout Plain Layout - - print("constructed!") -\end_layout - -\begin_layout Plain Layout - - var lv = Something.new() -\end_layout - -\begin_layout Plain Layout - - print(lv.a) -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Language -\end_layout - -\begin_layout Subsection -Identifiers -\end_layout - -\begin_layout Standard -Any string that restricts itself to alphabetic characters ('a' to 'z' and - 'A' to 'Z'), digits ('0' to '9') and '_' qualifies as an identifier. - As an extra restriction, identifiers must not begin with a digit. - Identifiers are case-sensitive ('foo' is different to 'FOO'). -\end_layout - -\begin_layout Subsection -Keywords -\end_layout - -\begin_layout Standard -The following is the list of keywords supported by the language. - Since keywords are reserved words (tokens), they can't be used as identifiers. -\end_layout - -\begin_layout Subsection -Operators -\end_layout - -\begin_layout Standard -The following is the list of supported operators and their precedence (TODO, - change since this was made to reflect python operators) -\end_layout - -\begin_layout Standard -\begin_inset Tabular - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -Operator -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Note -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -x[index] -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Subscription, Highest Priority -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -x.attribute -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Attribute Reference -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -extends -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Instance Type Checker -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -~ -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Bitwise NOT -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout --x -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Negative -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -* / % -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Mult / Div / Remainder -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -+ - -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Addition / Substraction -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -<< >> -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Bit Shifting -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -& -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Bitwise AND -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -^ -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Bitwise XOR -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -| -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Bitwise OR -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -< > == != >= <= -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Comparisons -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -in -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Content Test -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -! not -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Boolean NOT -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -and && -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Boolean AND -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -or || -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Boolean OR -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -= += -= *= /= ^= &= |= -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Assignment, Lowest Priority -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\begin_layout Subsection -Literals -\end_layout - -\begin_layout Standard -\begin_inset Tabular - - - - - - -\begin_inset Text - -\begin_layout Plain Layout -Literal -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Name -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -45 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Base 10 Integer -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -0x8F51 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Base 16 (hex) Integer -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -3.14, 58.1e-10 -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Floating Point Number (real) -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -'Hello', -\begin_inset Quotes eld -\end_inset - -Hi -\begin_inset Quotes erd -\end_inset - - -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Strings -\end_layout - -\end_inset - - - - -\begin_inset Text - -\begin_layout Plain Layout -@'Hello', @'Hi' -\end_layout - -\end_inset - - -\begin_inset Text - -\begin_layout Plain Layout -Internationalized Strings -\end_layout - -\end_inset - - - - -\end_inset - - -\end_layout - -\begin_layout Subsection -Comments -\end_layout - -\begin_layout Standard -Anything from a '#' to the end of the line is ignored and is considered - a comment. -\end_layout - -\begin_layout Standard -\begin_inset listings -lstparams "language=Python" -inline false -status open - -\begin_layout Plain Layout - -# This is a comment -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Built-in Types -\end_layout - -\begin_layout Subsection -Basic Bult-In Types -\end_layout - -\begin_layout Standard -A variable in GDScript can be assigned many of several built-in types. - -\end_layout - -\begin_layout Subsubsection -null -\end_layout - -\begin_layout Standard -'null' is a data type that contains no information, nothing assigned, and - it's just empy. - It can only be set to one value: 'null'. -\end_layout - -\begin_layout Subsubsection -bool -\end_layout - -\begin_layout Standard -Boolean data type, can only contain 'true' or 'false'. -\end_layout - -\begin_layout Subsubsection -int -\end_layout - -\begin_layout Standard -Integer data type, can only contain integer numbers, negative and positive. -\end_layout - -\begin_layout Subsubsection -float -\end_layout - -\begin_layout Standard -contains a floating point value (real). -\end_layout - -\begin_layout Subsubsection -String -\end_layout - -\begin_layout Standard -Sequence of characters in unicode format. - Strings can contain the standard C escape sequences. -\end_layout - -\begin_layout Subsection -Vector Built-In Types -\end_layout - -\begin_layout Subsubsection -Vector2/Size2 -\end_layout - -\begin_layout Standard -2D vector type, containing x and y fields. - Can alternatively access fields as width and height for readability. - Can also be accessed as array. -\end_layout - -\begin_layout Subsubsection -Rect2 -\end_layout - -\begin_layout Standard -2D Rectangle type. - Contains 2 vectors fields, -\begin_inset Quotes eld -\end_inset - -pos -\begin_inset Quotes erd -\end_inset - - and size -\begin_inset Quotes erd -\end_inset - -. - Alternatively contains an -\begin_inset Quotes eld -\end_inset - -end -\begin_inset Quotes erd -\end_inset - - field which is -\begin_inset Quotes eld -\end_inset - -pos+size -\begin_inset Quotes erd -\end_inset - -. -\end_layout - -\begin_layout Subsubsection -Vector3 -\end_layout - -\begin_layout Standard -3D vector type. - Contains x, y and z fields. - Can also be accessed as array. -\end_layout - -\begin_layout Subsubsection -Matrix32 -\end_layout - -\begin_layout Standard -3x2 matrix used for 2D transforms. -\end_layout - -\begin_layout Subsubsection -Plane -\end_layout - -\begin_layout Standard -3D Plane type in normalized form. - Contains a -\begin_inset Quotes eld -\end_inset - -normal -\begin_inset Quotes erd -\end_inset - - vector field and a -\begin_inset Quotes eld -\end_inset - -d -\begin_inset Quotes erd -\end_inset - - scalar distance. -\end_layout - -\begin_layout Subsubsection -Quat -\end_layout - -\begin_layout Standard -Quaternion, datatype used for representing a 3D rotation. - It's useful for interpolating rotations. -\end_layout - -\begin_layout Subsubsection -AABB/Box3 -\end_layout - -\begin_layout Standard -Axis Aligned bounding box (or alternatively, 3D box). - Contains 2 vectors fields, -\begin_inset Quotes eld -\end_inset - -pos -\begin_inset Quotes erd -\end_inset - - and size -\begin_inset Quotes erd -\end_inset - -. - Alternatively contains an -\begin_inset Quotes eld -\end_inset - -end -\begin_inset Quotes erd -\end_inset - - field which is -\begin_inset Quotes eld -\end_inset - -pos+size -\begin_inset Quotes erd -\end_inset - -. -\end_layout - -\begin_layout Subsubsection -Matrix3 -\end_layout - -\begin_layout Standard -3x3 matrix used for 3D rotation and scale. - Contains 3 vector fields x,y and z. - Can also be accessed as array of 3D vectors. -\end_layout - -\begin_layout Subsubsection -Transform -\end_layout - -\begin_layout Standard -3D Transform, contains a Matrix3 field -\begin_inset Quotes eld -\end_inset - -basis -\begin_inset Quotes erd -\end_inset - - and a Vector3 field -\begin_inset Quotes eld -\end_inset - -origin -\begin_inset Quotes erd -\end_inset - -. -\end_layout - -\begin_layout Subsection -Engine Built-In Types -\end_layout - -\begin_layout Subsubsection -Color -\end_layout - -\begin_layout Standard -Color datatype, contains r,g,b,a fields. - Can also be accessed as h,s,v for hue/saturation/value. -\end_layout - -\begin_layout Subsubsection -Image -\end_layout - -\begin_layout Standard -Contains a 2D Image of custom format and allows direct access to the pixels. -\end_layout - -\begin_layout Subsubsection -NodePath -\end_layout - -\begin_layout Standard -Compiled path to a node, used mainly in the scene system. - Can be easily asigned from/to a String. -\end_layout - -\begin_layout Subsubsection -RID -\end_layout - -\begin_layout Standard -Resource ID (RID). - Servers use generic RIDs to reference opaque data. -\end_layout - -\begin_layout Subsubsection -Object -\end_layout - -\begin_layout Standard -Base class for anything not a built-in type. - -\end_layout - -\begin_layout Subsubsection -InputEvent -\end_layout - -\begin_layout Standard -Events from input devices are contained in very compact form in InputEvent - objects. - Due to fact they can be received in high amounts from frame to frame, they - are optimized in their own datatype. - -\end_layout - -\begin_layout Subsection -Container Built-In Types -\end_layout - -\begin_layout Subsubsection -Array -\end_layout - -\begin_layout Standard -Generic sequence of objects. - It's size can be changed to anything and starts from index 0. - -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -var arr=[] -\end_layout - -\begin_layout Plain Layout - -arr=[1,2,3] -\end_layout - -\begin_layout Plain Layout - -arr[0]="Hi!" -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Arrays are allocated linearly in memory, so they are fast, but very large - arrays (more than tens of thousands of elements) may cause fragmentation. - There are specialized arrays for some built-in datatypes which do not suffer - from this and use much less memory. -\end_layout - -\begin_layout Subsubsection -Dictionary -\end_layout - -\begin_layout Standard -Associative container which contains values referenced by unique keys. -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -var dict={4:5, "a key":"a value", 28:[1,2,3]} -\end_layout - -\begin_layout Plain Layout - -dict["Hi!"]=0 -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsubsection -ByteArray -\end_layout - -\begin_layout Standard -Array of bytes. - Can only contains bytes (integers from 0 to 255). - Optimized for memory usage, can't fragment the memory. -\end_layout - -\begin_layout Subsubsection -IntArray -\end_layout - -\begin_layout Standard -Array of integers. - Can only contain integers. - Optimized for memory usage, can't fragment the memory. -\end_layout - -\begin_layout Subsubsection -FloatArray -\end_layout - -\begin_layout Standard -Array of floats, can only contain floats. - Optimized for memory usage, can't fragment the memory. -\end_layout - -\begin_layout Subsubsection -StringArray -\end_layout - -\begin_layout Standard -Array of strings, can only contain strings. - Optimized for memory usage, can't fragment the memory. -\end_layout - -\begin_layout Subsubsection -Vector2Array -\end_layout - -\begin_layout Standard -Array of Vector2, can only contain 2D Vectors. - Optimized for memory usage, can't fragment the memory. -\end_layout - -\begin_layout Subsubsection -Vector3Array -\end_layout - -\begin_layout Standard -Array of Vector3, can only contain 3D Vectors. - Optimized for memory usage, can't fragment the memory. -\end_layout - -\begin_layout Subsubsection -ColorArray -\end_layout - -\begin_layout Standard -Array of Color, can only contains colors. - Optimized for memory usage, can't fragment the memory. -\end_layout - -\begin_layout Section -Data -\end_layout - -\begin_layout Subsection -Variables -\end_layout - -\begin_layout Standard -Variables can exist as class members or local to functions. - They are created with the -\begin_inset Quotes eld -\end_inset - -var -\begin_inset Quotes erd -\end_inset - - keyword and may be, optionally, be assigned a value upon initialization. -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -var a # datatype is null by default -\end_layout - -\begin_layout Plain Layout - -var b = 5 -\end_layout - -\begin_layout Plain Layout - -var c = 3.8 -\end_layout - -\begin_layout Plain Layout - -var d = b+c # variables are always initialized in order -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Constants -\end_layout - -\begin_layout Standard -Constants are similar to variables, but must be constants or constant expression -s and must be assigned on initialization. -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -const a = 5 -\end_layout - -\begin_layout Plain Layout - -const b = Vector2(20,20) -\end_layout - -\begin_layout Plain Layout - -const c = 10+20 # constant expression -\end_layout - -\begin_layout Plain Layout - -const d = Vector2(20,30).x # constant expression: 20 -\end_layout - -\begin_layout Plain Layout - -const e = [1,2,3,4][0] # constant expression: 1 -\end_layout - -\begin_layout Plain Layout - -const f = sin(20) # sin() can be used in constant expression -\end_layout - -\begin_layout Plain Layout - -const g = x+20 # invalid, not a constant expression! -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Functions -\end_layout - -\begin_layout Standard -Functions always belong to a class. - The scope priority for variable look-up is: local -> class member -> global. - -\begin_inset Quotes eld -\end_inset - -self -\begin_inset Quotes erd -\end_inset - - is provided as an option for accessing class members but is not required - always (and must -\emph on -not -\emph default - be defined as first parameter, like in Python). - For performance reasons, functions are not considered class members, so - they can't be referenced directly. - A function can return at any point. - The default return value is null. -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -func myfunction(a,b): -\end_layout - -\begin_layout Plain Layout - - print(a) -\end_layout - -\begin_layout Plain Layout - - print(b) -\end_layout - -\begin_layout Plain Layout - - return a+b # return is optional, otherwise null is returned -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsubsection -Statements and Control Flow -\end_layout - -\begin_layout Standard -Statements are standard, and can be assignments, function calls, control - flow structures, etc (see below). - -\begin_inset Quotes eld -\end_inset - -; -\begin_inset Quotes erd -\end_inset - - as separator is entirely optional. -\end_layout - -\begin_layout Subsubsection -if/else/elif -\end_layout - -\begin_layout Standard -Simple conditions are created by using the -\emph on -if/else/elif -\emph default - syntax. - Parenthesis around statements is allowed but not requiered. - Given the nature of the tab-based indentation, elif can be used instead - of else:/if: to mantain a level of indentation. -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -if [expression]: -\end_layout - -\begin_layout Plain Layout - - statement(s) -\end_layout - -\begin_layout Plain Layout - -elif [expression]: -\end_layout - -\begin_layout Plain Layout - - statement(s) -\end_layout - -\begin_layout Plain Layout - -else: -\end_layout - -\begin_layout Plain Layout - - statement(s) -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsubsection -while -\end_layout - -\begin_layout Standard -Simple loops are created by using -\emph on -while -\emph default - syntax. - Loops can be broken using -\emph on -break -\emph default -, or continued using -\emph on -continue -\emph default -: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -while [expression]: -\end_layout - -\begin_layout Plain Layout - - statement(s) -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsubsection -for -\end_layout - -\begin_layout Standard -To iterate a range, array or table a -\emph on -for -\emph default - loop is used. - For loops store the index in the loop variable on each iteration. -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -for i in [0,1,2]: -\end_layout - -\begin_layout Plain Layout - - statement # loop iterates 3 times, i being 0,1 and 2 -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -var dict = {"a":0, "b":1, "c": 2} -\end_layout - -\begin_layout Plain Layout - -for i in dict: -\end_layout - -\begin_layout Plain Layout - - print(dict[i]) # loop iterates the keys, i being "a","b" and c". - It prints 0, 1 and 2. -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -for i in range(3): -\end_layout - -\begin_layout Plain Layout - - statement # similar to [0,1,2] but does not allocate an array -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -for i in range(1,3): -\end_layout - -\begin_layout Plain Layout - - statement # similar to [1,2] but does not allocate an array -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -for i in range(2,8,2): -\end_layout - -\begin_layout Plain Layout - - statement # similar to [2,4,6] but does not allocate an array -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Classes -\end_layout - -\begin_layout Standard -By default, the body of a script file is an unnamed class, and it can only - be referenced externally as a resource or file. - Class syntax is meant to be very compact and can only contain member variables - or functions. - Static functions are allowed, but not static members (in the spirit of - thread safety, since scripts can be initialized in separate threads without - the user knowing). - In the same way, member variables (including arrays and dictionaries) are - initialized every time an instance is created. - -\end_layout - -\begin_layout Subsection -Class File Example -\end_layout - -\begin_layout Standard -Example of a class file, imagine it being stored in a file like myclass.gd. -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -var a=5 -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -function print_value_of_a(): -\end_layout - -\begin_layout Plain Layout - - print(a) -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Inheritance -\end_layout - -\begin_layout Standard -A class-file can inherit from a global class, another file or a subclass - inside another file. - Multiple inheritance is not allowed. - The -\begin_inset Quotes eld -\end_inset - -extends -\begin_inset Quotes erd -\end_inset - - syntax is used: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -# extend from some class (global) -\end_layout - -\begin_layout Plain Layout - -extends SomeClass -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -# optionally, extend from another file -\end_layout - -\begin_layout Plain Layout - -extends "somefile.gd" -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -# extend from a subclass in another file -\end_layout - -\begin_layout Plain Layout - -extends "somefile.gd".Subclass -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Inheritance Testing -\end_layout - -\begin_layout Standard -It is possible to check if an instance inherits from a given class. - For this the -\begin_inset Quotes eld -\end_inset - -extends -\begin_inset Quotes erd -\end_inset - - keyword can be used as an operator instead: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -static var enemy_class = preload("enemy.gd") # cache the enemy class -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -[..] -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -if ( entity extends enemy_class ): -\end_layout - -\begin_layout Plain Layout - - entity.apply_damage() -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Constructor -\end_layout - -\begin_layout Standard -A class can have an optional constructor, a function named -\begin_inset Quotes eld -\end_inset - -_init -\begin_inset Quotes erd -\end_inset - - that is called when the class is instanced. -\end_layout - -\begin_layout Subsection -Sub Classes -\end_layout - -\begin_layout Standard -A class file can have subclasses. - Syntax should be straightforward: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -class SomeSubClass: -\end_layout - -\begin_layout Plain Layout - - var a=5 -\end_layout - -\begin_layout Plain Layout - - function print_value_of_a(): -\end_layout - -\begin_layout Plain Layout - - print(a) -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -function _init(): -\end_layout - -\begin_layout Plain Layout - - var sc = SomeSubClass.new() #instance by calling built-in new -\end_layout - -\begin_layout Plain Layout - - sc.print_value_of_a() -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Classes as Objects -\end_layout - -\begin_layout Standard -It may be desired at some point to load a class from a file and then instance - it. - Since the global scope does not exist, classes must be loaded as a resource. - Instancing is done by calling the -\begin_inset Quotes eld -\end_inset - -new -\begin_inset Quotes erd -\end_inset - - function in a class object: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -#load the class (loaded every time the script is instanced) -\end_layout - -\begin_layout Plain Layout - -var MyClass = load("myclass.gd") -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -#alternatively, using the preload() function preloads the class at compile - time -\end_layout - -\begin_layout Plain Layout - -var MyClass2 = preload("myclass.gd") -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -function _init(): -\end_layout - -\begin_layout Plain Layout - - var a = MyClass.new() -\end_layout - -\begin_layout Plain Layout - - a.somefunction() -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Exports -\end_layout - -\begin_layout Standard -Class members can be exported. - This means their value gets saved along with a scene. - If class members have initializers to constant expressions, they will be - available for editing in the property editor. - Exporting is done by using the export keyword: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -extends Button -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -export var data # value will be saved -\end_layout - -\begin_layout Plain Layout - -export var number=5 # also available to the property editor -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -One of the fundamental benefits of exporting member variables is to have - them visible in the property editor. - This way artists and game designers can modify values that later influence - how the program runs. - For this, a special export syntax is provided for more detail in the exported - variables: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -#if the exported value assigns a constant or constant expression, the type - will be infered and used in the editor -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -export var number=5 -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -#export can take a basic datatype as argument, which will be used in the - editor -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -export(int) var number -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -#export can also take a resource type as hint -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -export(Texture) var character_face -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -#integers and strings hint enumerated values -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -export(int,"Warrior","Magician","Thief") var character_class # (editor will - set them as 0,1 and 2) -\end_layout - -\begin_layout Plain Layout - -export(String,"Rebecca","Mary","Leah") var character_name -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -#strings as paths -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -export(String,FILE) var f # string is a path to a file -\end_layout - -\begin_layout Plain Layout - -export(String,DIR) var f # string is a path to a directory -\end_layout - -\begin_layout Plain Layout - -export(String,FILE,"*.txt") var f # string is a path to a file, custom filter - provided as hint -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -#integers and floats hint ranges -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -export(int,20) var i # 0 to 20 allowed -\end_layout - -\begin_layout Plain Layout - -export(int,-10,20) var j # -10 to 20 allowed -\end_layout - -\begin_layout Plain Layout - -export(float,-10,20,0.2) var k # -10 to 20 allowed, with stepping of 0.2 -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -#color can hint availability of alpha -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -export(Color,RGB) var col # Color is RGB -\end_layout - -\begin_layout Plain Layout - -export(Color,RGBA) var col # Color is RGBA -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -It must be noted that even if the script is not being run while at the editor, - the exported properties are still editable (see below for -\begin_inset Quotes eld -\end_inset - -tool -\begin_inset Quotes erd -\end_inset - -). -\end_layout - -\begin_layout Subsection -Static Functions -\end_layout - -\begin_layout Standard -A function can be declared static. - When static, it has no access to the instance member variables or -\begin_inset Quotes eld -\end_inset - -self -\begin_inset Quotes erd -\end_inset - -. - This is mainly useful to make libraries of helper functions: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -static func sum2(a,b): -\end_layout - -\begin_layout Plain Layout - - return a+b -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Asserting -\end_layout - -\begin_layout Standard -It is possible to assert a condition, which will cause a debugger break - if false. - Just use the built-in 'assert' function. -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -assert(a==2) -\end_layout - -\begin_layout Plain Layout - -# if a is not 2, it will generate a debugger break -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Tool Mode -\end_layout - -\begin_layout Standard -Scripts by default don't run inside the editor, and only the exported properties - can be changed. - In some cases it is desired that they do (as long as they don't execute - game code or manually avoid doing so). - For this, the -\begin_inset Quotes eld -\end_inset - -tool -\begin_inset Quotes erd -\end_inset - - keyword exists, and must be placed at the top of the file: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -tool -\end_layout - -\begin_layout Plain Layout - -extends Button -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -func _init(): -\end_layout - -\begin_layout Plain Layout - - print("Hello") -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Memory Management -\end_layout - -\begin_layout Standard -If a class inherits from -\emph on -Reference -\emph default -, then instances will be freed when no longer in use. - No garbage collector exists, just simple reference counting. - By default, all classes that don't define inheritance extend -\emph on -Reference -\emph default -. - If this is not desired, then a class must inherit -\emph on -Object -\emph default - manually and must call instance.free(). - To avoid reference cycles that can't be freed, a weakref() function is - provided for creating weak references. - -\end_layout - -\begin_layout Subsection -Function References -\end_layout - -\begin_layout Standard -Functions can't be referenced because they are not treated as class members. - There are two alternatives to this, though. - The -\begin_inset Quotes eld -\end_inset - -call -\begin_inset Quotes erd -\end_inset - - function or the funcref() helper. -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -instance.call("funcname",args) # call a function by bane -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -var fr = funcref(instance,"funcname") #create a function ref -\end_layout - -\begin_layout Plain Layout - -fr.exec(args) -\end_layout - -\end_inset - - -\end_layout - -\end_body -\end_document diff --git a/doc/godot_splash.png b/doc/godot_splash.png deleted file mode 100644 index da56fa15cc6..00000000000 Binary files a/doc/godot_splash.png and /dev/null differ diff --git a/doc/header.txt b/doc/header.txt deleted file mode 100644 index 359949cc3b8..00000000000 --- a/doc/header.txt +++ /dev/null @@ -1,12 +0,0 @@ -/*************************************************/ -/* $filename */ -/*************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/*************************************************/ -/* Source code within this file is: */ -/* (c) 2007-2010 Juan Linietsky, Ariel Manzur */ -/* All Rights Reserved. */ -/*************************************************/ - - diff --git a/doc/html/@GDScript.html b/doc/html/@GDScript.html deleted file mode 100644 index 5d5d77ffbf9..00000000000 --- a/doc/html/@GDScript.html +++ /dev/null @@ -1,93 +0,0 @@ -
    IndexClassesCategoriesInheritance

    @GDScript

    - Built-in GDScript functions. -

    Category: Core

    Public Methods:

    real sin ( real s )
    real cos ( real s )
    real tan ( real s )
    real sinh ( real s )
    real cosh ( real s )
    real tanh ( real s )
    real asin ( real s )
    real acos ( real s )
    real atan ( real s )
    real atan2 ( real x, real y )
    real sqrt ( real s )
    real fmod ( real x, real y )
    real fposmod ( real x, real y )
    real floor ( real s )
    real ceil ( real s )
    real round ( real s )
    real abs ( real s )
    real sign ( real s )
    real pow ( real x, real y )
    real log ( real s )
    real exp ( real s )
    real isnan ( real s )
    real isinf ( real s )
    real ease ( real s, real curve )
    real decimals ( real step )
    real stepify ( real s, real step )
    int rand ()
    real randf ()
    real rand_range ( real from, real to )
    Array rand_seed ( real seed )
    real deg2rad ( real deg )
    real rad2deg ( real rad )
    real linear2db ( real nrg )
    real db2linear ( real db )
    real max ( real a, real b )
    real min ( real a, real b )
    real clamp ( real val, real min, real max )
    int nearest_po2 ( int val )
    Object weakref ( Object obj )
    Object convert ( var what, int type )
    String str ( var what, var ... )
    Nil print ( var what, var ... )
    Nil printerr ( var what, var ... )
    Nil printraw ( var what, var ... )
    Array range ( var ... )

    Description:

    - This contains the list of built-in gdscript functions. Mostly math functions and other utilities. Everything else is expanded by objects. -

    Method Documentation:

    - Standard sine function. -
    - Standard cosine function. -
    - Standard tangent function. -
    - Hyperbolic sine. -
    - Hyperbolic tangent. -
    - Arc-sine. -
    - Arc-cosine. -
    - Arc-tangent. -
    - Arc-tangent that takes a 2D vector as argument, retuns the full -pi to +pi range. -
    - Square root. -
    - Module (remainder of x/y). -
    - Module (remainder of x/y) that wraps equally in positive and negative. -
    - Floor (rounds down to nearest integer). -
    - Ceiling (rounds up to nearest integer). -
    - Round to nearest integer. -
    - Remove sign (works for integer and float). -
    - Return sign (-1 or +1). -
    - Power function, x elevate to y. -
    - Natural logarithm. -
    - Exponential logarithm. -
    - Return true if the float is not a number. -
    - Return true if the float is infinite. -
    - Easing function, based on exponent. 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in. -
    - Return the amount of decimals in the floating point value. -
    - Snap float value to a given step. -
    - Random value (integer). -
    - Random value (0 to 1 float). -
    - Random range. -
    - random from seed, pass a seed and an array with both number and new seed is returned. -
    - Convert from degrees to radians. -
    - Convert from radias to degrees. -
    - Convert from linear energy to decibels (audio). -
    - Convert from decibels to linear energy (audio). -
    - Return the maximum of two values. -
    - Return the minimum of two values. -
    - Clamp both values to a range. -
    - Return the nearest larger power of 2 for an integer. -
    - Return a weak reference to an object. -
    - Convert from a type to another in the best way possible. The "type" parameter uses the enum TYPE_* in Global Scope. -
    String @GDScript::str ( var what, var ... )
    - Convert one or more arguments to strings in the best way possible. -
    Nil @GDScript::print ( var what, var ... )
    - Print one or more arguments to strings in the best way possible to a console line. -
    Nil @GDScript::printerr ( var what, var ... )
    - Print one or more arguments to strings in the best way possible to standard error line. -
    Nil @GDScript::printraw ( var what, var ... )
    - Print one or more arguments to strings in the best way possible to console. No newline is added at the end. -
    - 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). -

    Copyright 2008-2010 Codenix SRL \ No newline at end of file diff --git a/doc/html/@Global Scope.html b/doc/html/@Global Scope.html deleted file mode 100644 index 3324383c3d8..00000000000 --- a/doc/html/@Global Scope.html +++ /dev/null @@ -1,459 +0,0 @@ -
    IndexClassesCategoriesInheritance

    @Global Scope

    - Global scope constants and variables. -

    Category: Core

    Public Variables:

  • Globals Globals -
  • IP IP -
  • Geometry Geometry -
  • ResourceLoader ResourceLoader -
  • ResourceSaver ResourceSaver -
  • PathRemap PathRemap -
  • OS OS -
  • TranslationServer TranslationServer -
  • SceneIO SceneIO -
  • VisualServer VisualServer -
  • AudioServer AudioServer -
  • PhysicsServer PhysicsServer -
  • Physics2DServer Physics2DServer -
  • SpatialSound2DServer SpatialSoundServer -
  • SpatialSound2DServer SpatialSound2DServer -
  • Constants:

  • MARGIN_LEFT = 0 -
  • MARGIN_TOP = 1 -
  • MARGIN_RIGHT = 2 -
  • MARGIN_BOTTOM = 3 -
  • VERTICAL = 1 -
  • HORIZONTAL = 0 -
  • HALIGN_LEFT = 0 -
  • HALIGN_CENTER = 1 -
  • HALIGN_RIGHT = 2 -
  • VALIGN_TOP = 0 -
  • VALIGN_CENTER = 1 -
  • VALIGN_BOTTOM = 2 -
  • SPKEY = 16777216 -
  • KEY_ESCAPE = 16777217 -
  • KEY_TAB = 16777218 -
  • KEY_BACKTAB = 16777219 -
  • KEY_BACKSPACE = 16777220 -
  • KEY_RETURN = 16777221 -
  • KEY_ENTER = 16777222 -
  • KEY_INSERT = 16777223 -
  • KEY_DELETE = 16777224 -
  • KEY_PAUSE = 16777225 -
  • KEY_PRINT = 16777226 -
  • KEY_SYSREQ = 16777227 -
  • KEY_CLEAR = 16777228 -
  • KEY_HOME = 16777229 -
  • KEY_END = 16777230 -
  • KEY_LEFT = 16777231 -
  • KEY_UP = 16777232 -
  • KEY_RIGHT = 16777233 -
  • KEY_DOWN = 16777234 -
  • KEY_PAGEUP = 16777235 -
  • KEY_PAGEDOWN = 16777236 -
  • KEY_SHIFT = 16777237 -
  • KEY_CONTROL = 16777238 -
  • KEY_META = 16777239 -
  • KEY_ALT = 16777240 -
  • KEY_CAPSLOCK = 16777241 -
  • KEY_NUMLOCK = 16777242 -
  • KEY_SCROLLLOCK = 16777243 -
  • KEY_F1 = 16777244 -
  • KEY_F2 = 16777245 -
  • KEY_F3 = 16777246 -
  • KEY_F4 = 16777247 -
  • KEY_F5 = 16777248 -
  • KEY_F6 = 16777249 -
  • KEY_F7 = 16777250 -
  • KEY_F8 = 16777251 -
  • KEY_F9 = 16777252 -
  • KEY_F10 = 16777253 -
  • KEY_F11 = 16777254 -
  • KEY_F12 = 16777255 -
  • KEY_F13 = 16777256 -
  • KEY_F14 = 16777257 -
  • KEY_F15 = 16777258 -
  • KEY_F16 = 16777259 -
  • KEY_KP_ENTER = 16777344 -
  • KEY_KP_MULTIPLY = 16777345 -
  • KEY_KP_DIVIDE = 16777346 -
  • KEY_KP_SUBSTRACT = 16777347 -
  • KEY_KP_PERIOD = 16777348 -
  • KEY_KP_ADD = 16777349 -
  • KEY_KP_0 = 16777350 -
  • KEY_KP_1 = 16777351 -
  • KEY_KP_2 = 16777352 -
  • KEY_KP_3 = 16777353 -
  • KEY_KP_4 = 16777354 -
  • KEY_KP_5 = 16777355 -
  • KEY_KP_6 = 16777356 -
  • KEY_KP_7 = 16777357 -
  • KEY_KP_8 = 16777358 -
  • KEY_KP_9 = 16777359 -
  • KEY_SUPER_L = 16777260 -
  • KEY_SUPER_R = 16777261 -
  • KEY_MENU = 16777262 -
  • KEY_HYPER_L = 16777263 -
  • KEY_HYPER_R = 16777264 -
  • KEY_HELP = 16777265 -
  • KEY_DIRECTION_L = 16777266 -
  • KEY_DIRECTION_R = 16777267 -
  • KEY_BACK = 16777280 -
  • KEY_FORWARD = 16777281 -
  • KEY_STOP = 16777282 -
  • KEY_REFRESH = 16777283 -
  • KEY_VOLUMEDOWN = 16777284 -
  • KEY_VOLUMEMUTE = 16777285 -
  • KEY_VOLUMEUP = 16777286 -
  • KEY_BASSBOOST = 16777287 -
  • KEY_BASSUP = 16777288 -
  • KEY_BASSDOWN = 16777289 -
  • KEY_TREBLEUP = 16777290 -
  • KEY_TREBLEDOWN = 16777291 -
  • KEY_MEDIAPLAY = 16777292 -
  • KEY_MEDIASTOP = 16777293 -
  • KEY_MEDIAPREVIOUS = 16777294 -
  • KEY_MEDIANEXT = 16777295 -
  • KEY_MEDIARECORD = 16777296 -
  • KEY_HOMEPAGE = 16777297 -
  • KEY_FAVORITES = 16777298 -
  • KEY_SEARCH = 16777299 -
  • KEY_STANDBY = 16777300 -
  • KEY_OPENURL = 16777301 -
  • KEY_LAUNCHMAIL = 16777302 -
  • KEY_LAUNCHMEDIA = 16777303 -
  • KEY_LAUNCH0 = 16777304 -
  • KEY_LAUNCH1 = 16777305 -
  • KEY_LAUNCH2 = 16777306 -
  • KEY_LAUNCH3 = 16777307 -
  • KEY_LAUNCH4 = 16777308 -
  • KEY_LAUNCH5 = 16777309 -
  • KEY_LAUNCH6 = 16777310 -
  • KEY_LAUNCH7 = 16777311 -
  • KEY_LAUNCH8 = 16777312 -
  • KEY_LAUNCH9 = 16777313 -
  • KEY_LAUNCHA = 16777314 -
  • KEY_LAUNCHB = 16777315 -
  • KEY_LAUNCHC = 16777316 -
  • KEY_LAUNCHD = 16777317 -
  • KEY_LAUNCHE = 16777318 -
  • KEY_LAUNCHF = 16777319 -
  • KEY_UNKNOWN = 33554431 -
  • KEY_SPACE = 32 -
  • KEY_EXCLAM = 33 -
  • KEY_QUOTEDBL = 34 -
  • KEY_NUMBERSIGN = 35 -
  • KEY_DOLLAR = 36 -
  • KEY_PERCENT = 37 -
  • KEY_AMPERSAND = 38 -
  • KEY_APOSTROPHE = 39 -
  • KEY_PARENLEFT = 40 -
  • KEY_PARENRIGHT = 41 -
  • KEY_ASTERISK = 42 -
  • KEY_PLUS = 43 -
  • KEY_COMMA = 44 -
  • KEY_MINUS = 45 -
  • KEY_PERIOD = 46 -
  • KEY_SLASH = 47 -
  • KEY_0 = 48 -
  • KEY_1 = 49 -
  • KEY_2 = 50 -
  • KEY_3 = 51 -
  • KEY_4 = 52 -
  • KEY_5 = 53 -
  • KEY_6 = 54 -
  • KEY_7 = 55 -
  • KEY_8 = 56 -
  • KEY_9 = 57 -
  • KEY_COLON = 58 -
  • KEY_SEMICOLON = 59 -
  • KEY_LESS = 60 -
  • KEY_EQUAL = 61 -
  • KEY_GREATER = 62 -
  • KEY_QUESTION = 63 -
  • KEY_AT = 64 -
  • KEY_A = 65 -
  • KEY_B = 66 -
  • KEY_C = 67 -
  • KEY_D = 68 -
  • KEY_E = 69 -
  • KEY_F = 70 -
  • KEY_G = 71 -
  • KEY_H = 72 -
  • KEY_I = 73 -
  • KEY_J = 74 -
  • KEY_K = 75 -
  • KEY_L = 76 -
  • KEY_M = 77 -
  • KEY_N = 78 -
  • KEY_O = 79 -
  • KEY_P = 80 -
  • KEY_Q = 81 -
  • KEY_R = 82 -
  • KEY_S = 83 -
  • KEY_T = 84 -
  • KEY_U = 85 -
  • KEY_V = 86 -
  • KEY_W = 87 -
  • KEY_X = 88 -
  • KEY_Y = 89 -
  • KEY_Z = 90 -
  • KEY_BRACKETLEFT = 91 -
  • KEY_BACKSLASH = 92 -
  • KEY_BRACKETRIGHT = 93 -
  • KEY_ASCIICIRCUM = 94 -
  • KEY_UNDERSCORE = 95 -
  • KEY_QUOTELEFT = 96 -
  • KEY_BRACELEFT = 123 -
  • KEY_BAR = 124 -
  • KEY_BRACERIGHT = 125 -
  • KEY_ASCIITILDE = 126 -
  • KEY_NOBREAKSPACE = 160 -
  • KEY_EXCLAMDOWN = 161 -
  • KEY_CENT = 162 -
  • KEY_STERLING = 163 -
  • KEY_CURRENCY = 164 -
  • KEY_YEN = 165 -
  • KEY_BROKENBAR = 166 -
  • KEY_SECTION = 167 -
  • KEY_DIAERESIS = 168 -
  • KEY_COPYRIGHT = 169 -
  • KEY_ORDFEMININE = 170 -
  • KEY_GUILLEMOTLEFT = 171 -
  • KEY_NOTSIGN = 172 -
  • KEY_HYPHEN = 173 -
  • KEY_REGISTERED = 174 -
  • KEY_MACRON = 175 -
  • KEY_DEGREE = 176 -
  • KEY_PLUSMINUS = 177 -
  • KEY_TWOSUPERIOR = 178 -
  • KEY_THREESUPERIOR = 179 -
  • KEY_ACUTE = 180 -
  • KEY_MU = 181 -
  • KEY_PARAGRAPH = 182 -
  • KEY_PERIODCENTERED = 183 -
  • KEY_CEDILLA = 184 -
  • KEY_ONESUPERIOR = 185 -
  • KEY_MASCULINE = 186 -
  • KEY_GUILLEMOTRIGHT = 187 -
  • KEY_ONEQUARTER = 188 -
  • KEY_ONEHALF = 189 -
  • KEY_THREEQUARTERS = 190 -
  • KEY_QUESTIONDOWN = 191 -
  • KEY_AGRAVE = 192 -
  • KEY_AACUTE = 193 -
  • KEY_ACIRCUMFLEX = 194 -
  • KEY_ATILDE = 195 -
  • KEY_ADIAERESIS = 196 -
  • KEY_ARING = 197 -
  • KEY_AE = 198 -
  • KEY_CCEDILLA = 199 -
  • KEY_EGRAVE = 200 -
  • KEY_EACUTE = 201 -
  • KEY_ECIRCUMFLEX = 202 -
  • KEY_EDIAERESIS = 203 -
  • KEY_IGRAVE = 204 -
  • KEY_IACUTE = 205 -
  • KEY_ICIRCUMFLEX = 206 -
  • KEY_IDIAERESIS = 207 -
  • KEY_ETH = 208 -
  • KEY_NTILDE = 209 -
  • KEY_OGRAVE = 210 -
  • KEY_OACUTE = 211 -
  • KEY_OCIRCUMFLEX = 212 -
  • KEY_OTILDE = 213 -
  • KEY_ODIAERESIS = 214 -
  • KEY_MULTIPLY = 215 -
  • KEY_OOBLIQUE = 216 -
  • KEY_UGRAVE = 217 -
  • KEY_UACUTE = 218 -
  • KEY_UCIRCUMFLEX = 219 -
  • KEY_UDIAERESIS = 220 -
  • KEY_YACUTE = 221 -
  • KEY_THORN = 222 -
  • KEY_SSHARP = 223 -
  • KEY_DIVISION = 247 -
  • KEY_YDIAERESIS = 255 -
  • KEY_CODE_MASK = 33554431 -
  • KEY_MODIFIER_MASK = -16777216 -
  • KEY_MASK_SHIFT = 33554432 -
  • KEY_MASK_ALT = 67108864 -
  • KEY_MASK_META = 134217728 -
  • KEY_MASK_CTRL = 268435456 -
  • KEY_MASK_KPAD = 536870912 -
  • KEY_MASK_GROUP_SWITCH = 1073741824 -
  • BUTTON_LEFT = 1 -
  • BUTTON_RIGHT = 2 -
  • BUTTON_MIDDLE = 3 -
  • BUTTON_WHEEL_UP = 4 -
  • BUTTON_WHEEL_DOWN = 5 -
  • BUTTON_MASK_LEFT = 1 -
  • BUTTON_MASK_RIGHT = 2 -
  • BUTTON_MASK_MIDDLE = 4 -
  • JOY_BUTTON_0 = 0 -
  • JOY_BUTTON_1 = 1 -
  • JOY_BUTTON_2 = 2 -
  • JOY_BUTTON_3 = 3 -
  • JOY_BUTTON_4 = 4 -
  • JOY_BUTTON_5 = 5 -
  • JOY_BUTTON_6 = 6 -
  • JOY_BUTTON_7 = 7 -
  • JOY_BUTTON_8 = 8 -
  • JOY_BUTTON_9 = 9 -
  • JOY_BUTTON_10 = 10 -
  • JOY_BUTTON_11 = 11 -
  • JOY_BUTTON_12 = 12 -
  • JOY_BUTTON_13 = 13 -
  • JOY_BUTTON_14 = 14 -
  • JOY_BUTTON_15 = 15 -
  • JOY_BUTTON_MAX = 16 -
  • JOY_SNES_A = 1 -
  • JOY_SNES_B = 0 -
  • JOY_SNES_X = 3 -
  • JOY_SNES_Y = 2 -
  • JOY_SONY_CIRCLE = 1 -
  • JOY_SONY_X = 0 -
  • JOY_SONY_SQUARE = 2 -
  • JOY_SONY_TRIANGLE = 3 -
  • JOY_SEGA_B = 1 -
  • JOY_SEGA_A = 0 -
  • JOY_SEGA_X = 2 -
  • JOY_SEGA_Y = 3 -
  • JOY_XBOX_B = 1 -
  • JOY_XBOX_A = 0 -
  • JOY_XBOX_X = 2 -
  • JOY_XBOX_Y = 3 -
  • JOY_DS_A = 1 -
  • JOY_DS_B = 0 -
  • JOY_DS_X = 3 -
  • JOY_DS_Y = 2 -
  • JOY_SELECT = 10 -
  • JOY_START = 11 -
  • JOY_DPAD_UP = 12 -
  • JOY_DPAD_DOWN = 13 -
  • JOY_DPAD_LEFT = 14 -
  • JOY_DPAD_RIGHT = 15 -
  • JOY_L = 4 -
  • JOY_L2 = 6 -
  • JOY_L3 = 8 -
  • JOY_R = 5 -
  • JOY_R2 = 7 -
  • JOY_R3 = 9 -
  • JOY_AXIS_0 = 0 -
  • JOY_AXIS_1 = 1 -
  • JOY_AXIS_2 = 2 -
  • JOY_AXIS_3 = 3 -
  • JOY_AXIS_4 = 4 -
  • JOY_AXIS_5 = 5 -
  • JOY_AXIS_6 = 6 -
  • JOY_AXIS_7 = 7 -
  • JOY_AXIS_MAX = 8 -
  • JOY_ANALOG_0_X = 0 -
  • JOY_ANALOG_0_Y = 1 -
  • JOY_ANALOG_1_X = 2 -
  • JOY_ANALOG_1_Y = 3 -
  • JOY_ANALOG_2_X = 4 -
  • JOY_ANALOG_2_Y = 5 -
  • OK = 0 -
  • FAILED = 1 -
  • ERR_UNAVAILABLE = 2 -
  • ERR_UNCONFIGURED = 3 -
  • ERR_UNAUTHORIZED = 4 -
  • ERR_PARAMETER_RANGE_ERROR = 5 -
  • ERR_OUT_OF_MEMORY = 6 -
  • ERR_FILE_NOT_FOUND = 7 -
  • ERR_FILE_BAD_DRIVE = 8 -
  • ERR_FILE_BAD_PATH = 9 -
  • ERR_FILE_NO_PERMISSION = 10 -
  • ERR_FILE_ALREADY_IN_USE = 11 -
  • ERR_FILE_CANT_OPEN = 12 -
  • ERR_FILE_CANT_WRITE = 13 -
  • ERR_FILE_CANT_READ = 14 -
  • ERR_FILE_UNRECOGNIZED = 15 -
  • ERR_FILE_CORRUPT = 16 -
  • ERR_FILE_EOF = 17 -
  • ERR_CANT_OPEN = 18 -
  • ERR_CANT_CREATE = 19 -
  • ERROR_QUERY_FAILED = 20 -
  • ERR_ALREADY_IN_USE = 21 -
  • ERR_LOCKED = 22 -
  • ERR_TIMEOUT = 23 -
  • ERR_CANT_AQUIRE_RESOURCE = 24 -
  • ERR_INVALID_DATA = 26 -
  • ERR_INVALID_PARAMETER = 27 -
  • ERR_ALREADY_EXISTS = 28 -
  • ERR_DOES_NOT_EXIST = 29 -
  • ERR_DATABASE_CANT_READ = 30 -
  • ERR_DATABASE_CANT_WRITE = 31 -
  • ERR_COMPILATION_FAILED = 32 -
  • ERR_METHOD_NOT_FOUND = 33 -
  • ERR_LINK_FAILED = 34 -
  • ERR_SCRIPT_FAILED = 35 -
  • ERR_CYCLIC_LINK = 36 -
  • ERR_BUSY = 40 -
  • ERR_HELP = 42 -
  • ERR_BUG = 43 -
  • ERR_WTF = 45 -
  • PROPERTY_HINT_NONE = 0 - No hint for edited property. -
  • PROPERTY_HINT_RANGE = 1 -
  • PROPERTY_HINT_EXP_RANGE = 2 - Hint string is an exponential range, defined as "min,max" or "min,max,step". This is valid for integers and floats. -
  • PROPERTY_HINT_ENUM = 3 - Property hint is an enumerated value, like "Hello,Something,Else". This is valid for integers, floats and strings properties. -
  • PROPERTY_HINT_LENGTH = 5 -
  • PROPERTY_HINT_FLAGS = 7 - Property hint is a bitmask description, for bits 0,1,2,3 abd 5 the hint would be like "Bit0,Bit1,Bit2,Bit3,,Bit5". Valid only for integers. -
  • PROPERTY_HINT_FILE = 8 - String property is a file (so pop up a file dialog when edited). Hint string can be a set of wildcards like "*.doc". -
  • PROPERTY_HINT_DIR = 9 - String property is a directory (so pop up a file dialog when edited). -
  • PROPERTY_HINT_RESOURCE_TYPE = 10 - String property is a resource, so open the resource popup menu when edited. -
  • PROPERTY_USAGE_STORAGE = 1 - Property will be used as storage (default). -
  • PROPERTY_USAGE_STORAGE = 1 - Property will be used as storage (default). -
  • PROPERTY_USAGE_EDITOR = 2 - Property will be visible in editor (default). -
  • PROPERTY_USAGE_NETWORK = 4 -
  • PROPERTY_USAGE_DEFAULT = 7 - Default usage (storage and editor). -
  • TYPE_NIL = 0 -
  • TYPE_BOOL = 1 -
  • TYPE_INT = 2 -
  • TYPE_REAL = 3 -
  • TYPE_STRING = 4 -
  • TYPE_VECTOR2 = 5 -
  • TYPE_RECT2 = 6 -
  • TYPE_VECTOR3 = 7 -
  • TYPE_MATRIX32 = 8 -
  • TYPE_PLANE = 9 -
  • TYPE_QUAT = 10 -
  • TYPE_AABB = 11 -
  • TYPE_MATRIX3 = 12 -
  • TYPE_TRANSFORM = 13 -
  • TYPE_COLOR = 14 -
  • TYPE_IMAGE = 15 -
  • TYPE_NODE_PATH = 16 -
  • TYPE_RID = 17 -
  • TYPE_OBJECT = 18 -
  • TYPE_INPUT_EVENT = 19 -
  • TYPE_DICTIONARY = 20 -
  • TYPE_ARRAY = 21 -
  • TYPE_RAW_ARRAY = 22 -
  • TYPE_INT_ARRAY = 23 -
  • TYPE_REAL_ARRAY = 24 -
  • TYPE_STRING_ARRAY = 25 -
  • TYPE_VECTOR2_ARRAY = 26 -
  • TYPE_VECTOR3_ARRAY = 27 -
  • TYPE_COLOR_ARRAY = 28 -
  • TYPE_MAX = 29 -
  • Description:

    - Global scope constants and variables. This is all that resides in the globals, constants regarding error codes, scancodes, property hints, etc. It's not much. - Singletons are also documented here, since they can be accessed from anywhere. -

    Method Documentation:


    Copyright 2008-2010 Codenix SRL \ No newline at end of file diff --git a/doc/html/@Squirrel.html b/doc/html/@Squirrel.html deleted file mode 100644 index ad4aaa49d83..00000000000 --- a/doc/html/@Squirrel.html +++ /dev/null @@ -1,2 +0,0 @@ -
    IndexClassesCategoriesInheritance

    @Squirrel

    -

    Category: Core

    Method Documentation:


    Copyright 2008-2010 Codenix SRL \ No newline at end of file diff --git a/doc/html/tutorial01/0_home_red_coding_godot_doc_math_position.png b/doc/html/tutorial01/0_home_red_coding_godot_doc_math_position.png deleted file mode 100644 index df52c054624..00000000000 Binary files a/doc/html/tutorial01/0_home_red_coding_godot_doc_math_position.png and /dev/null differ diff --git a/doc/html/tutorial01/1_home_red_coding_godot_doc_math_direction.png b/doc/html/tutorial01/1_home_red_coding_godot_doc_math_direction.png deleted file mode 100644 index 5b58274bcb8..00000000000 Binary files a/doc/html/tutorial01/1_home_red_coding_godot_doc_math_direction.png and /dev/null differ diff --git a/doc/html/tutorial01/2_home_red_coding_godot_doc_math_normals.png b/doc/html/tutorial01/2_home_red_coding_godot_doc_math_normals.png deleted file mode 100644 index 73681a58cee..00000000000 Binary files a/doc/html/tutorial01/2_home_red_coding_godot_doc_math_normals.png and /dev/null differ diff --git a/doc/html/tutorial01/tutorial.css b/doc/html/tutorial01/tutorial.css deleted file mode 100644 index a518c6dff73..00000000000 --- a/doc/html/tutorial01/tutorial.css +++ /dev/null @@ -1,128 +0,0 @@ - -/* start css.sty */ -.cmr-7{font-size:70%;} -.cmmi-7{font-size:70%;font-style: italic;} -.cmmi-10{font-style: italic;} -.ectt-1000{ font-family: monospace;} -.ectt-1000{ font-family: monospace;} -.ectt-1000{ font-family: monospace;} -.ectt-1000{ font-family: monospace;} -.ectt-1000{ font-family: monospace;} -.ecti-1000{ font-style: italic;} -.ecti-1000{ font-style: italic;} -.ecti-1000{ font-style: italic;} -.ecti-1000{ font-style: italic;} -.ecti-1000{ font-style: italic;} -.ecti-0700{font-size:70%; font-style: italic;} -.ecti-0700{ font-style: italic;} -.ecti-0700{ font-style: italic;} -.ecti-0700{ font-style: italic;} -.ecti-0700{ font-style: italic;} -.ecrm-0700{font-size:70%;} -p.noindent { text-indent: 0em } -td p.noindent { text-indent: 0em; margin-top:0em; } -p.nopar { text-indent: 0em; } -p.indent{ text-indent: 1.5em } -@media print {div.crosslinks {visibility:hidden;}} -a img { border-top: 0; border-left: 0; border-right: 0; } -center { margin-top:1em; margin-bottom:1em; } -td center { margin-top:0em; margin-bottom:0em; } -.Canvas { position:relative; } -img.math{vertical-align:middle;} -li p.indent { text-indent: 0em } -.enumerate1 {list-style-type:decimal;} -.enumerate2 {list-style-type:lower-alpha;} -.enumerate3 {list-style-type:lower-roman;} -.enumerate4 {list-style-type:upper-alpha;} -div.newtheorem { margin-bottom: 2em; margin-top: 2em;} -.obeylines-h,.obeylines-v {white-space: nowrap; } -div.obeylines-v p { margin-top:0; margin-bottom:0; } -.overline{ text-decoration:overline; } -.overline img{ border-top: 1px solid black; } -td.displaylines {text-align:center; white-space:nowrap;} -.centerline {text-align:center;} -.rightline {text-align:right;} -div.verbatim {font-family: monospace; white-space: nowrap; text-align:left; clear:both; } -.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } -div.fbox {display:table} -div.center div.fbox {text-align:center; clear:both; padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } -table.minipage{width:100%;} -div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;} -div.center div {text-align: left;} -div.flushright, div.flushright div.flushright {text-align: right;} -div.flushright div {text-align: left;} -div.flushleft {text-align: left;} -.underline{ text-decoration:underline; } -.underline img{ border-bottom: 1px solid black; margin-bottom:1pt; } -.framebox-c, .framebox-l, .framebox-r { padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; } -.framebox-c {text-align:center;} -.framebox-l {text-align:left;} -.framebox-r {text-align:right;} -span.thank-mark{ vertical-align: super } -span.footnote-mark sup.textsuperscript, span.footnote-mark a sup.textsuperscript{ font-size:80%; } -div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; } -table.tabular td p{margin-top:0em;} -table.tabular {margin-left: auto; margin-right: auto;} -div.td00{ margin-left:0pt; margin-right:0pt; } -div.td01{ margin-left:0pt; margin-right:5pt; } -div.td10{ margin-left:5pt; margin-right:0pt; } -div.td11{ margin-left:5pt; margin-right:5pt; } -table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; } -td.td00{ padding-left:0pt; padding-right:0pt; } -td.td01{ padding-left:0pt; padding-right:5pt; } -td.td10{ padding-left:5pt; padding-right:0pt; } -td.td11{ padding-left:5pt; padding-right:5pt; } -table[rules] {border-left:solid black 0.4pt; border-right:solid black 0.4pt; } -.hline hr, .cline hr{ height : 1px; margin:0px; } -.tabbing-right {text-align:right;} -span.TEX {letter-spacing: -0.125em; } -span.TEX span.E{ position:relative;top:0.5ex;left:-0.0417em;} -a span.TEX span.E {text-decoration: none; } -span.LATEX span.A{ position:relative; top:-0.5ex; left:-0.4em; font-size:85%;} -span.LATEX span.TEX{ position:relative; left: -0.4em; } -div.float img, div.float .caption {text-align:center;} -div.figure img, div.figure .caption {text-align:center;} -.marginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;} -.marginpar p{margin-top:0.4em; margin-bottom:0.4em;} -table.equation {width:100%;} -.equation td{text-align:center; } -td.equation { margin-top:1em; margin-bottom:1em; } -td.equation-label { width:5%; text-align:center; } -td.eqnarray4 { width:5%; white-space: normal; } -td.eqnarray2 { width:5%; } -table.eqnarray-star, table.eqnarray {width:100%;} -div.eqnarray{text-align:center;} -div.array {text-align:center;} -div.pmatrix {text-align:center;} -table.pmatrix {width:100%;} -span.pmatrix img{vertical-align:middle;} -div.pmatrix {text-align:center;} -table.pmatrix {width:100%;} -img.cdots{vertical-align:middle;} -.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;} -.index-item, .index-subitem, .index-subsubitem {display:block} -.caption td.id{font-weight: bold; white-space: nowrap; } -table.caption {text-align:center;} -h1.partHead{text-align: center} -p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } -p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; } -.paragraphHead, .likeparagraphHead { margin-top:2em; font-weight: bold;} -.subparagraphHead, .likesubparagraphHead { font-weight: bold;} -.quote {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; margin-right:1em; text-align:justify;} -.verse{white-space:nowrap; margin-left:2em} -div.maketitle {text-align:center;} -h2.titleHead{text-align:center;} -div.maketitle{ margin-bottom: 2em; } -div.author, div.date {text-align:center;} -div.thanks{text-align:left; margin-left:10%; font-size:85%; font-style:italic; } -div.author{white-space: nowrap;} -.quotation {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; } -.abstract p {margin-left:5%; margin-right:5%;} -table.abstract {width:100%;} -.lstlisting .label{margin-right:0.5em; } -div.lstlisting{font-family: monospace; white-space: nowrap; margin-top:0.5em; margin-bottom:0.5em; } -div.lstinputlisting{ font-family: monospace; white-space: nowrap; } -.lstinputlisting .label{margin-right:0.5em;} -.figure img.graphics {margin-left:10%;} -/* end css.sty */ - diff --git a/doc/html/tutorial01/tutorial.html b/doc/html/tutorial01/tutorial.html deleted file mode 100644 index 45c02587090..00000000000 --- a/doc/html/tutorial01/tutorial.html +++ /dev/null @@ -1,902 +0,0 @@ - - - - - - - - - - - -

    1 Introduction to 3D Math

    -

    -

    1.1 Introduction

    -

    There are many approaches to understanding the type of 3D math used in video -games, modelling, ray-tracing, etc. The usual is through vector algebra, matrices, and -linear transformations and, while they are not completely necesary to understand -most of the aspects of 3D game programming (from the theorical point of view), they -provide a common language to communicate with other programmers or -engineers. -

    This tutorial will focus on explaining all the basic concepts needed for a -programmer to understand how to develop 3D games without getting too deep into -algebra. Instead of a math-oriented language, code examples will be given instead -when possible. The reason for this is that. while programmers may have -different backgrounds or experience (be it scientific, engineering or self taught), -code is the most familiar language and the lowest common denominator for -understanding. -

    -

    1.2 Vectors

    -

    -

    1.2.1 Brief Introduction
    -

    When writing 2D games, interfaces and other applications, the typical convention is -to define coordinates as an x,y pair, x representing the horizontal offset and y the -vertical one. In most cases, the unit for both is pixels. This makes sense given the -screen is just a rectangle in two dimensions. -

    An x,y pair can be used for two purposes. It can be an absolute position (screen -cordinate in the previous case), or a relative direction, if we trace an arrow from the -origin (0,0 coordinates) to it’s position. -

    -

    - -

    - - - -
    PICPIC
    Position Direction
    -
    -

    When used as a direction, this pair is called a vector, and two properties can be -observed: The first is the magnitude or length , and the second is the direction. In -two dimensions, direction can be an angle. The magnitude or length can be computed -by simply using Pithagoras theorem: -

    -

    -

    - - -
    ∘x2-+-y2-∘x2-+-y2 +-z2
    2D 3D
    -
    -

    The direction can be an arbitrary angle from either the x or y axis, and could be -computed by using trigonometry, or just using the usual atan2 function present in -most math libraries. However, when dealing with 3D, the direction can’t be described -as an angle. To separate magnitude and direction, 3D uses the concept of normal -vectors. -

    -

    1.2.2 Implementation
    -

    Vectors are implemented in Godot Engine as a class named Vector3 for 3D, and as -both Vector2, Point2 or Size2 in 2D (they are all aliases). They are used for any -purpose where a pair of 2D or 3D values (described as x,y or x,y,z) is needed. This is -somewhat a standard in most libraries or engines. In the script API, they can be -instanced like this: - -

    a = Vector3() 
    a = Vector2( 2.0, 3.4 ) -
    - -

    Vectors also support the common operators +, -, / and * for addition, -substraction, multiplication and division. - -

    a = Vector3(1,2,3) 
    b = Vector3(4,5,6) 
    c = Vector3() 
     
    // writing 
     
    c = a + b 
     
    // is the same as writing 
     
    c.x = a.x + b.x 
    c.y = a.y + b.y 
    c.z = a.z + b.z 
     
    // both will result in a vector containing (5,7,9). 
    // the same happens for the rest of the operators. -
    -

    Vectors also can perform a wide variety of built-in functions, their most common -usages will be explored next. -

    -

    1.2.3 Normal Vectors
    -

    Two points ago, it was mentioned that 3D vectors can’t describe their direction as an -agle (as 2D vectors can). Because of this, normal vectors become important for -separating a vector between direction and magnitude. -

    A normal vector is a vector with a magnitude of 1. This means, no matter where -the vector is pointing to, it’s length is always 1. -

    - - -
    PIC
    Normal vectors aroud the origin.
    -
    -

    Normal vectors have endless uses in 3D graphics programming, so it’s -recommended to get familiar with them as much as possible. -

    -

    1.2.4 Normalization
    -

    Normalization is the process through which normal vectors are obtained -from regular vectors. In other words, normalization is used to reduce the -magnitude of any vector to 1. (except of course, unless the vector is (0,0,0) -). -

    To normalize a vector, it must be divided by its magnitude (which should be -greater than zero): - -

    // a custom vector is created 
    a = Vector3(4,5,6) 
    // l is a single real number (or scalar) containight the length 
    l = Math.sqrt( a.x*a.x + a.y*a.y + a.z*a.z ) 
    // the vector a is divided by its length, by performing scalar divide 
    a = a / l 
    // which is the same as 
    a.x = a.x / l 
    a.y = a.y / l 
    a.z = a.z / l - -
    -

    Vector3 contains two built in functions for normalization: - -

    a = Vector3(4,5,6) 
    a.normalize() // in-place normalization 
    b = a.normalized() // returns a copy of a, normalized -
    -

    -

    1.2.5 Dot Product
    -

    The dot product is, pheraps, the most useful operation that can be applied to 3D -vectors. In the surface, it’s multiple usages are not very obvious, but in depth it can -provide very useful information between two vectors (be it direction or just points in -space). -

    The dot product takes two vectors (a and b in the example) and returns a scalar -(single real number): -

    -

    -

    axbx + ayby + azbz -

    -

    The same expressed in code: - -

    a = Vector3(...) 
    b = Vector3(...) 
     
    c = a.x*b.x + a.y*b.y + a.z*b.z 
     
    // using built-in dot() function 
     
    c = a.dot(b) -
    -

    The dot product presents several useful properties: -

      -
    • If both a and b parameters to a dot product are direction vectors, dot - product will return positive if both point towards the same direction, - negative if both point towards opposite directions, and zero if they are - orthogonal (one is perpendicular to the other). -
    • -
    • If both a and b parameters to a dot product are normalized direction - vectors, then the dot product will return the cosine of the angle between - them (ranging from 1 if they are equal, 0 if they are orthogonal, and -1 if - they are opposed (a == -b)). -
    • -
    • If a is a normalized direction vector and b is a point, the dot product will - return the distance from b to the plane passing through the origin, with - normal a (see item about planes) - -
    • -
    • More uses will be presented later in this tutorial.
    -

    -

    1.2.6 Cross Product
    -

    The cross product also takes two vectors a and b, but returns another vector c that is -orthogonal to the two previous ones. -

    -

    -

    cx = axbz - azby -

    -
    -

    -

    cy = azbx - axbz -

    -
    -

    -

    cz = axby - aybx -

    -

    The same in code: - -

    a = Vector3(...) 
    b = Vector3(...) 
    c = Vector3(...) 
     
    c.x = a.x*b.z - a.z*b.y 
    c.y = a.z*b.x - a.x*b.z 
    c.z = a.x*b.y - a.y*b.x 
     
    // or using the built-in function 
     
    c = a.cross(b) -
    -

    The cross product also presents several useful properties: -

      -
    • As mentioned, the resulting vector c is orthogonal to the input vectors a - and b. -
    • -
    • Since the cross product is anticommutative, swapping a and b will result - in a negated vector c. - -
    • -
    • if a and b are taken from two of the segmets AB, BC or CA that form a - 3D triangle, the magnitude of the resulting vector divided by 2 is the area - of that triangle. -
    • -
    • The direction of the resulting vector c in the previous triangle example - determines wether the points A,B and C are arranged in clocwise or - counter-clockwise order.
    -

    -

    1.3 Plane

    -

    -

    1.3.1 Theory
    -

    A plane can be considered as an infinite, flat surface that splits space in two halves, -usually one named positive and one named negative. In regular mathematics, a plane -formula is described as: -

    -

    -

    ax + by + cz + d -

    -

    However, in 3D programming, this form alone is often of little use. For planes to -become useful, they must be in normalized form. -

    A normalized plane consists of a normal vector n and a distance d. To normalize -a plane, a vector n and distance d’ are created this way: -

    nx = a -

    ny = b -

    nz = c -

    d= d -

    Finally, both n and d’ are both divided by the magnitude of n. -

    In any case, normalizing planes is not often needed (this was mostly for -explanation purposes), and normalized planes are useful because they can be created -and used easily. -

    A normalized plane could be visualized as a plane pointing towards normal n, -offseted by d in the direction of n. -

    In other words, take n, multiply it by scalar d and the resulting point will be part -of the plane. This may need some thinking, so an example with a 2D normal vector -(z is 0, so plane is orthogonal to it) is provided: -

    Some operations can be done with normalized planes: - -

      -
    • Given any point p, the distance from it to a plane can be computed by - doing: n.dot(p) - d -
    • -
    • If the resulting distance in the previous point is negative, the point is - below the plane. -
    • -
    • Convex polygonal shapes can be defined by enclosing them in planes (the - physics engine uses this property)
    -

    -

    1.3.2 Implementation
    -

    Godot Engine implements normalized planes by using the Plane class. - -

    //creates a plane with normal (0,1,0) and distance 5 
    p = Plane( Vector3(0,1,0), 5 ) 
    // get the distance to a point 
    d = p.distance( Vector3(4,5,6) ) -
    -

    -

    1.4 Matrices, Quaternions and Coordinate Systems

    -

    It is very often needed to store the location/rotation of something. In 2D, it is often -enough to store an x,y location and maybe an angle as the rotation, as that should -be enough to represent any posible position. -

    In 3D this becomes a little more difficult, as there is nothing as simple as an angle -to store a 3-axis rotation. -

    The first think that may come to mind is to use 3 angles, one for x, one for y and -one for z. However this suffers from the problem that it becomes very cumbersome to -use, as the individual rotations in each axis need to be performed one after another -(they can’t be performed at the same time), leading to a problem called “gimbal -lock”. Also, it becomes impossible to accumulate rotations (add a rotation to an -existing one). -

    To solve this, there are two known diferent approaches that aid in solving -rotation, Quaternions and Oriented Coordinate Systems. -

    -

    1.4.1 Oriented Coordinate Systems
    -

    Oriented Coordinate Systems (OCS) are a way of representing a coordinate system -inside the cartesian coordinate system. They are mainly composed of 3 Vectors, one -for each axis. The first vector is the x axis, the second the y axis, and the third is the - -z axis. The OCS vectors can be rotated around freely as long as they are kept the -same length (as changing the length of an axis changes its cale), and as long as they -remain orthogonal to eachother (as in, the same as the default cartesian system, -with y pointing up, x pointing left and z pointing front, but all rotated -together). -

    Oriented Coordinate Systems are represented in 3D programming as a 3x3 matrix, -where each row (or column, depending on the implementation) contains one of the -axis vectors. Transforming a Vector by a rotated OCS Matrix results in the rotation -being applied to the resulting vector. OCS Matrices can also be multiplied to -accumulate their transformations. -

    Godot Engine implements OCS Matrices in the Matrix3 class: - -

    //create a 3x3 matrix 
    m = Matrix3() 
    //rotate the matrix in the y axis, by 45 degrees 
    m.rotate( Vector3(0,1,0), Math.deg2rad(45) ) 
    //transform a vector v (xform method is used) 
    v = Vector3(...) 
    result = m.xform( v ) -
    -

    However, in most usage cases, one wants to store a translation together with the -rotation. For this, an origin vector must be added to the OCS, thus transforming it -into a 3x4 (or 4x3, depending on preference) matrix. Godot engine implements this -functionality in the Transform class: - -

    t = Transform() 
    //rotate the transform in the y axis, by 45 degrees 
    t.rotate( Vector3(0,1,0), Math.deg2rad(45) ) 
    //translate the transform by 5 in the z axis 
    t.translate( Vector3( 0,0,5 ) ) 
    //transform a vector v (xform method is used) 
    v = Vector3(...) 
    result = t.xform( v ) -
    -

    Transform contains internally a Matrix3 “basis” and a Vector3 “origin” (which can -be modified individually). -

    -

    1.4.2 Transform Internals
    -

    Internally, the xform() process is quite simple, to apply a 3x3 transform to a vector, -the transposed axis vectors are used (as using the regular axis vectors will result on -an inverse of the desired transform): - -

    m = Matrix3(...) 
    v = Vector3(..) 
    result = Vector3(...) 
     
    x_axis = m.get_axis(0) 
    y_axis = m.get_axis(1) 
    z_axis = m.get_axis(2) 
     
    result.x = Vector3(x_axis.x, y_axis.x, z_axis.x).dot(v) 
    result.y = Vector3(x_axis.y, y_axis.y, z_axis.y).dot(v) 
    result.z = Vector3(x_axis.z, y_axis.z, z_axis.z).dot(v) 
     
    // is the same as doing 
     
    result = m.xform(v) 
     
    // if m this was a Transform(), the origin would be added 
    // like this: 
     
    result = result + t.get_origin() -
    -

    -

    1.4.3 Using The Transform
    -

    So, it is often desired apply sucessive operations to a transformation. For example, -let’s a assume that there is a turtle sitting at the origin (the turtle is a logo reference, - -for those familiar with it). The y axis is up, and the the turtle’s nose is pointing -towards the z axis. -

    The turtle (like many other animals, or vehicles!) can only walk towards the -direction it’s looking at. So, moving the turtle around a little should be something -like this: - -

    // turtle at the origin 
    turtle = Transform() 
    // turtle will walk 5 units in z axis 
    turtle.translate( Vector3(0,0,5) ) 
    // turtle eyes a lettuce 3 units away, will rotate 45 degrees right 
    turtle.rotate( Vector3(0,1,0), Math.deg2rad(45) ) 
    // turtle approaches the lettuce 
    turtle.translate( Vector3(0,0,5) ) 
    // happy turtle over lettuce is at 
    print(turtle.get_origin()) -
    -

    As can be seen, every new action the turtle takes is based on the previous one it -took. Had the order of actions been different and the turtle would have never reached -the lettuce. -

    Transforms are just that, a mean of “accumulating” rotation, translation, scale, -etc. -

    -

    1.4.4 A Warning about Numerical Precision
    -

    Performing several actions over a transform will slowly and gradually lead to -precision loss (objects that draw according to a transform may get jittery, bigger, -smaller, skewed, etc). This happens due to the nature of floating point numbers. if -transforms/matrices are created from other kind of values (like a position and -some angular rotation) this is not needed, but if has been accumulating -transformations and was never recreated, it can be normalized by calling the -.orthonormalize() built-in function. This function has little cost and calling it every -now and then will avoid the effects from precision loss to become visible. - - - - - diff --git a/doc/html/tutorial01/tutorial0x.png b/doc/html/tutorial01/tutorial0x.png deleted file mode 100644 index a0ed4f53ffa..00000000000 Binary files a/doc/html/tutorial01/tutorial0x.png and /dev/null differ diff --git a/doc/html/tutorial01/tutorial1x.png b/doc/html/tutorial01/tutorial1x.png deleted file mode 100644 index 80f0d099f73..00000000000 Binary files a/doc/html/tutorial01/tutorial1x.png and /dev/null differ diff --git a/doc/html/tutorial01/tutorial2x.png b/doc/html/tutorial01/tutorial2x.png deleted file mode 100644 index 76c502b6da0..00000000000 Binary files a/doc/html/tutorial01/tutorial2x.png and /dev/null differ diff --git a/doc/html/tutorial01/tutorial3x.png b/doc/html/tutorial01/tutorial3x.png deleted file mode 100644 index 8431e9d15c0..00000000000 Binary files a/doc/html/tutorial01/tutorial3x.png and /dev/null differ diff --git a/doc/html/tutorial01/tutorial4x.png b/doc/html/tutorial01/tutorial4x.png deleted file mode 100644 index 1ce7a2bb456..00000000000 Binary files a/doc/html/tutorial01/tutorial4x.png and /dev/null differ diff --git a/doc/make_doc.sh b/doc/make_doc.sh deleted file mode 100644 index a76f568bfc1..00000000000 --- a/doc/make_doc.sh +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/bash -here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -godotHome=$(dirname "$here") -docTarget=${here}/html/class_list -toolsRoot=${godotHome}/tools - -throw() { - echo "$@" >&2 - exit 1 -} - -[ -d "$docTarget" ] || mkdir -p "$docTarget" || throw "Could not create doc target $docTarget" - -cd "$docTarget" -python ${toolsRoot}/docdump/makehtml.py -multipage ${here}/base/classes.xml -cd "$here" - diff --git a/doc/notes.txt b/doc/notes.txt deleted file mode 100644 index 39c03ca4c54..00000000000 --- a/doc/notes.txt +++ /dev/null @@ -1,20 +0,0 @@ - -in FileDialog file_selected -> file_activated -focus script/shader editor when gaining focus -detect if errors in editor and don't allow play - - --tree of files (all recognized extensions) - -*export: *keep|export|bundle -*options: [make binary for xnl], then options for each filetype (texture compress method, etc) - - -config.h deberia teber varias cosas de plataforma - -_FORCE_INLINE_ -copymem -ftoi -defines de funciones matematicas - - diff --git a/doc/phys_engine.png b/doc/phys_engine.png deleted file mode 100644 index 15539d47d76..00000000000 Binary files a/doc/phys_engine.png and /dev/null differ diff --git a/doc/squirrel.lyx b/doc/squirrel.lyx deleted file mode 100644 index 05270c1b8f8..00000000000 --- a/doc/squirrel.lyx +++ /dev/null @@ -1,984 +0,0 @@ -#LyX 2.0 created this file. For more info see http://www.lyx.org/ -\lyxformat 413 -\begin_document -\begin_header -\textclass article -\use_default_options true -\maintain_unincluded_children false -\language english -\language_package default -\inputencoding auto -\fontencoding global -\font_roman default -\font_sans default -\font_typewriter default -\font_default_family default -\use_non_tex_fonts false -\font_sc false -\font_osf false -\font_sf_scale 100 -\font_tt_scale 100 - -\graphics default -\default_output_format default -\output_sync 0 -\bibtex_command default -\index_command default -\paperfontsize default -\use_hyperref false -\papersize default -\use_geometry false -\use_amsmath 1 -\use_esint 1 -\use_mhchem 1 -\use_mathdots 1 -\cite_engine basic -\use_bibtopic false -\use_indices false -\paperorientation portrait -\suppress_date false -\use_refstyle 1 -\index Index -\shortcut idx -\color #008000 -\end_index -\secnumdepth 3 -\tocdepth 3 -\paragraph_separation indent -\paragraph_indentation default -\quotes_language english -\papercolumns 1 -\papersides 1 -\paperpagestyle default -\tracking_changes false -\output_changes false -\html_math_output 0 -\html_css_as_file 0 -\html_be_strict false -\end_header - -\begin_body - -\begin_layout Title -Squirrel Usage in Godot -\end_layout - -\begin_layout Section -Introduction -\end_layout - -\begin_layout Standard -Squirrel is a nice scripting language. - It's sort of a mix between Lua, Java and JavaScript and ends up being easy - to learn for most programmers. - It has more language features than GDScript but it's also slower, more - limited and not as well integrated. - This guide will explain how Squirrel is integrated to Godot and all the - quirks that are needed to know in order to use it properly. -\end_layout - -\begin_layout Section -Enabling Squirrel -\end_layout - -\begin_layout Standard -Squirrel may not be enabled by default in a Godot build. - To enable it, execute SCons with the following parameters: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -shell$ scons squirrel=yes -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Documentation -\end_layout - -\begin_layout Standard -Godot utilizes Squirrel 2.2. - Documentation can be found at: -\begin_inset CommandInset href -LatexCommand href -target "http://squirrel-lang.org/#documentation" - -\end_inset - - -\end_layout - -\begin_layout Section -Class Files -\end_layout - -\begin_layout Standard -Unless writing a library, Godot expects a class for scripting an object. - Since a Squirrel source file can contain many classes, the main class must - be returned. - The following is an example of extending a button: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -class MyButton extends Button { -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - - constructor() { -\end_layout - -\begin_layout Plain Layout - - // ALWAYS call parent constructor -\end_layout - -\begin_layout Plain Layout - - Button.constructor() -\end_layout - -\begin_layout Plain Layout - - } -\end_layout - -\begin_layout Plain Layout - -} -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -return MyButton // main class returned -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Additionally, classes are all copied to the root table, so all class names - in scripts must be different if they are attempted to be loaded simultaneously. - The same can be said for any other globals declared in the script. - -\end_layout - -\begin_layout Standard -Finally, squirrel scripts must be saved with the .nut or .sq extensions (both - are recognized). -\end_layout - -\begin_layout Section -Including Other Scripts -\end_layout - -\begin_layout Standard -Other scripts can be included with the include() directive. - Full and relative paths are supported. - When included, the classes and globals are moved to the root table, so - they become immediately available. - Constants, however, are only inlined in the current class on load, so Squirrel - does not make them available. - Example of including scripts: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -include("my_button.nut") # // relative to current script, expected to be - in the same path -\end_layout - -\begin_layout Plain Layout - -include("res://buttons/my_button.nut") // using resource path -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Built-In Types -\end_layout - -\begin_layout Standard -There are some small differences between the Built-In types in Godot and - the ones in Squirrel, so the documentation will not match. - The differences are documented here. -\end_layout - -\begin_layout Standard -An attempt will be made to document everything here,but if in doubt about - bindings on built-in types, you can always take a loot at the bindings - source file in script/squirrel/sq_bind_types.cpp. -\end_layout - -\begin_layout Standard -Built-In Types in Squirrel are passed by reference (unlike by value like - in GD). - They also don't need to be freed. -\end_layout - -\begin_layout Subsection -AABB -\end_layout - -\begin_layout Standard -\begin_inset Quotes eld -\end_inset - -pos -\begin_inset Quotes erd -\end_inset - -, -\begin_inset Quotes eld -\end_inset - -size -\begin_inset Quotes erd -\end_inset - - and -\begin_inset Quotes eld -\end_inset - -end -\begin_inset Quotes erd -\end_inset - - are not available Use get_pos()/set_pos and get_size()/set_size(). -\end_layout - -\begin_layout Subsection -InputEvent -\end_layout - -\begin_layout Standard -InputEvent is a single datatype and contains everything. - Use only the fields meant for the event type: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -//for mouse motion and button -\end_layout - -\begin_layout Plain Layout - -int mouse_x -\end_layout - -\begin_layout Plain Layout - -int mouse_y -\end_layout - -\begin_layout Plain Layout - -int mouse_button_mask -\end_layout - -\begin_layout Plain Layout - -int mouse_global_x -\end_layout - -\begin_layout Plain Layout - -int mouse_global_y -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -//for mouse button -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -int mouse_button_index -\end_layout - -\begin_layout Plain Layout - -bool mouse_button_pressed -\end_layout - -\begin_layout Plain Layout - -bool mouse_button_doubleclick -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -//for mouse motion -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -int mouse_motion_x -\end_layout - -\begin_layout Plain Layout - -int mouse_motion_y -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -//for keyboard -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -int key_scancode -\end_layout - -\begin_layout Plain Layout - -int key_unicode -\end_layout - -\begin_layout Plain Layout - -bool key_pressed -\end_layout - -\begin_layout Plain Layout - -bool key_echo -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -//for keyboard and mouse -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -bool mod_alt -\end_layout - -\begin_layout Plain Layout - -bool mod_shift -\end_layout - -\begin_layout Plain Layout - -bool mod_meta -\end_layout - -\begin_layout Plain Layout - -bool mod_control -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -//joy button -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -int joy_button_index -\end_layout - -\begin_layout Plain Layout - -bool joy_button_pressed -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -//joy axis -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -int joy_axis -\end_layout - -\begin_layout Plain Layout - -float joy_axis_value -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -//screen drag and touch -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -int screen_index -\end_layout - -\begin_layout Plain Layout - -int screen_x -\end_layout - -\begin_layout Plain Layout - -int screen_y -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -//screen touch -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -int screen_index -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -//action -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -int action_id -\end_layout - -\begin_layout Plain Layout - -bool action_pressed -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Subsection -Matrix3 -\end_layout - -\begin_layout Standard -x,y,z member vectors are not available. - Use get_row() and set_row() instead. - Individual float values of the matrix are available as swizzle masks such - as xxy, xyz, zzx, etc. -\end_layout - -\begin_layout Standard -Additional in-place versions of some functions are available: transpose(), - invert(), rotate(), scale(), orthonormalize(). -\end_layout - -\begin_layout Subsection -Transform -\end_layout - -\begin_layout Standard -\begin_inset Quotes eld -\end_inset - -basis -\begin_inset Quotes erd -\end_inset - - and -\begin_inset Quotes eld -\end_inset - -origin -\begin_inset Quotes erd -\end_inset - - members are not available. - Use get_basis()/set_basis() and get_origin()/set_origin() instead. - Additional in-place versions of some functions are available: invert(), - affine_invert(), orthonormalize(), rotate(), translate(), scale(). -\end_layout - -\begin_layout Standard -Vector2 -\end_layout - -\begin_layout Subsection -Plane -\end_layout - -\begin_layout Standard -\begin_inset Quotes eld -\end_inset - -normal -\begin_inset Quotes erd -\end_inset - - member vector is not available. - Use get_normal(), set_normal() instead. -\end_layout - -\begin_layout Subsection -Rect2 -\end_layout - -\begin_layout Standard -\begin_inset Quotes eld -\end_inset - -pos -\begin_inset Quotes erd -\end_inset - -, -\begin_inset Quotes eld -\end_inset - -size -\begin_inset Quotes erd -\end_inset - - and -\begin_inset Quotes eld -\end_inset - -end -\begin_inset Quotes erd -\end_inset - - are not available Use get_pos()/set_pos and get_size()/set_size(). -\end_layout - -\begin_layout Subsection -Native Arrays -\end_layout - -\begin_layout Standard -Native arrays such as RawArray, IntArray,StringArray, etc are not supported. - Use regular squirrel arrays instead, since conversion to/from them will - happen automatically. -\end_layout - -\begin_layout Subsection -Math Functions -\end_layout - -\begin_layout Standard -Math functions are inside the Math namespace in Squirrel. - For example Math.sin , Math.PI, Math.atan2(). -\end_layout - -\begin_layout Subsection -Native Types -\end_layout - -\begin_layout Standard -Array, Dictionary and NodePath are not available. - Use a native array, table and string respectively. -\end_layout - -\begin_layout Section -_get , _set -\end_layout - -\begin_layout Standard -_get and _set are reserved in Squirrel, for overriding Godot Object property - getter/setter, use _get_property and _set_property. -\end_layout - -\begin_layout Section -Member Export -\end_layout - -\begin_layout Standard -Simple exporting of members (so far only integer, floating point and string - are supported) is supported by the @export extension. - It is used like this: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -class MyButton extends Button { -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - - aprop=1 // @export -\end_layout - -\begin_layout Plain Layout - - bprop=2.0 // @export -\end_layout - -\begin_layout Plain Layout - - cprop="3" // @export -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - - //these will be available to the property editor, and will be loaded/saved - with the scene. -\end_layout - -\begin_layout Plain Layout - -} -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Always Enabled Scripts -\end_layout - -\begin_layout Standard -Scripts are not enabled in the editor by default. - To enable a script always, add an @always_enabled comment. - Example: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -//@always_enabled -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -class MyButton extends Button { -\end_layout - -\begin_layout Plain Layout - -\end_layout - -\begin_layout Plain Layout - -... -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Section -Threads -\end_layout - -\begin_layout Standard -Thread support in Squirrel is very poor. - This is because of the stack-based nature of the language implementation. - Since godot can run in multiple threads, it will forcibily lock the whole - VM when accessed from multiple threads, which will result in degraded performan -ce. - Creating user threads in Squirrel is definitely not recomended, as it may - completely lock the main thread. -\end_layout - -\begin_layout Section -References -\end_layout - -\begin_layout Standard -Godot has a built-in reference counted type used in conjunction with a template - (objects that inherit the -\begin_inset Quotes eld -\end_inset - -Reference -\begin_inset Quotes erd -\end_inset - - class). - Since Squirrel also uses reference counting, it becomes impossible for - such types in godot to contain a script, because it would result in an - un-breakable reference cycle. - To avoid this, a Ref() class was created in Squirrel. - -\end_layout - -\begin_layout Standard -When calling Godot API functions, returned references are wrapped inside - Ref() transparently, but the problem arises when creating a Reference-derived - object from the code. - In such cases, the reference must be wrapped manually like this: -\end_layout - -\begin_layout Standard -\begin_inset listings -inline false -status open - -\begin_layout Plain Layout - -local f = Ref( File() ) -\end_layout - -\begin_layout Plain Layout - -local err = f.open("hello.txt",File.READ) -\end_layout - -\end_inset - - -\end_layout - -\begin_layout Standard -Anything not a reference that inherits from Object can be freed manually - by calling .free(), just like in GDScript. - Object classes are in itself weak references to engine objects, and their - validity can be checked by calling the -\begin_inset Quotes eld -\end_inset - -has_instance() -\begin_inset Quotes erd -\end_inset - - built-in method. -\end_layout - -\begin_layout Section -Unicode -\end_layout - -\begin_layout Standard -Squirrel source code is supposed to support Unicode, but the implementation - is very broken (Squirrel attempts to use 16 bit chars no matter what, making - it incompatible when the host OS is 32 bit, like Linux). - Squirrel source code is parsed as UTF-8, and strings also contain UTF-8. - Wide char access in strings is not supported. -\end_layout - -\begin_layout Section -Debugging -\end_layout - -\begin_layout Standard -Squirrel is well integrated into the Godot debugger. - To run the project in debug mode, execute the godot binary with the -debug - argument. - Godot will break on squirrel errors and allow the programmer to debug. -\end_layout - -\begin_layout Section -Utility Functions -\end_layout - -\begin_layout Standard -There are a few squirrel-only utility functions available: -\end_layout - -\begin_layout Subsection -print(value[,value]) -\end_layout - -\begin_layout Standard -Print stuff to stdout. -\end_layout - -\begin_layout Subsection -dofile(path) -\end_layout - -\begin_layout Standard -Execute a squirrel script file and return whatever the file returns. - Not recommended to use in production because it can't be optimized. -\end_layout - -\begin_layout Subsection -nativeref(var) -\end_layout - -\begin_layout Standard -Convert any squirrel type to an engine type. - When this type returns to squirrel, it's converted back. - This is useful to add to Godot callbacks to ensure that the datatype is - not converted. -\end_layout - -\begin_layout Subsection -unicode_split(string) -\end_layout - -\begin_layout Standard -Split an unicode string (utf8) into an array of widechars. - Useful since there is no wide char access from Squirrel. -\end_layout - -\begin_layout Subsection -breakpoint() -\end_layout - -\begin_layout Standard -Stop the debugger when reaches here (when run inside the debugger). -\end_layout - -\begin_layout Subsection -backtrace() -\end_layout - -\begin_layout Standard -Print a backtrace of the call stack. -\end_layout - -\begin_layout Subsection -tr(text) -\end_layout - -\begin_layout Standard -Translate text (use string lookup in Godot translation system). -\end_layout - -\begin_layout Subsection -printerr(text) -\end_layout - -\begin_layout Standard -Print a string to stderr. -\end_layout - -\end_body -\end_document diff --git a/doc/todo.txt b/doc/todo.txt deleted file mode 100644 index 511b5dbbe21..00000000000 --- a/doc/todo.txt +++ /dev/null @@ -1,39 +0,0 @@ --Fisica 2D - *terminar constraints - *terminar queries - *desactivar on suspend - -bugs supongo? - --Fisica 3D - -portar engine 2D a 3D mayoritariamente (si puedo esperar, mejor) - -hacer que skeletons se vuelvan ragdolls de alguna forma - -hacer bien lo de enganchar cosas a huesos de esqueleto - --GUI - - Tree necesita resizear desde los headers - --Escena 3D - -Deshabilitar 3D (Opcional en compilacion) - -Particulas 3D - -Heightmaps - -Arreglar fixed pipeline - -arreglar glow y ssao - --Editor codigo - -Editor de codigo (esta, pero esta lleno de bugs) - -Debugger (esta, pero hay que integrar bien) - --UI General - -Cambiar lugar el tema de resources porque es MUY poco intuitivo - -Tal vez arreglar un poquito el theme y la estetica (para release, low priority) - -Run deberia correr la escena main - -new script deberia dar opcion de crear en disco - -los scripts de deberian mantener abiertos al abrir otra escena - - - --Settings - -Hacer pantalla de optimizacion general del proyecto - --A futuro: - -Scripting Propio - -Portar a DX9/GL3 \ No newline at end of file diff --git a/tools/docdump/doc_merge.py b/doc/tools/doc_merge.py similarity index 99% rename from tools/docdump/doc_merge.py rename to doc/tools/doc_merge.py index 872f38ed870..6cc70193245 100644 --- a/tools/docdump/doc_merge.py +++ b/doc/tools/doc_merge.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + import sys import xml.etree.ElementTree as ET diff --git a/tools/docdump/locales/es/LC_MESSAGES/makedocs.mo b/doc/tools/locales/es/LC_MESSAGES/makedocs.mo similarity index 100% rename from tools/docdump/locales/es/LC_MESSAGES/makedocs.mo rename to doc/tools/locales/es/LC_MESSAGES/makedocs.mo diff --git a/tools/docdump/locales/es/LC_MESSAGES/makedocs.po b/doc/tools/locales/es/LC_MESSAGES/makedocs.po similarity index 100% rename from tools/docdump/locales/es/LC_MESSAGES/makedocs.po rename to doc/tools/locales/es/LC_MESSAGES/makedocs.po diff --git a/doc/html/main.css b/doc/tools/main.css similarity index 100% rename from doc/html/main.css rename to doc/tools/main.css diff --git a/tools/docdump/makedocs.pot b/doc/tools/makedocs.pot similarity index 100% rename from tools/docdump/makedocs.pot rename to doc/tools/makedocs.pot diff --git a/tools/docdump/makedocs.py b/doc/tools/makedocs.py similarity index 99% rename from tools/docdump/makedocs.py rename to doc/tools/makedocs.py index be57891abce..db9f04b0919 100644 --- a/tools/docdump/makedocs.py +++ b/doc/tools/makedocs.py @@ -24,7 +24,7 @@ # TODO: # * Refactor code. # * Adapt this script for generating content in other markup formats like -# DokuWiki, Markdown, etc. +# reStructuredText, Markdown, DokuWiki, etc. # # Also check other TODO entries in this script for more information on what is # left to do. diff --git a/tools/docdump/makedoku.py b/doc/tools/makedoku.py similarity index 99% rename from tools/docdump/makedoku.py rename to doc/tools/makedoku.py index e8207715fe7..1ab16841b15 100644 --- a/tools/docdump/makedoku.py +++ b/doc/tools/makedoku.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + import sys import xml.etree.ElementTree as ET @@ -8,7 +11,7 @@ for arg in sys.argv[1:]: input_list.append(arg) if len(input_list) < 1: - print("usage: makedoku.py ") + print("usage: makedoku.py ") sys.exit(0) diff --git a/tools/docdump/makehtml.py b/doc/tools/makehtml.py similarity index 99% rename from tools/docdump/makehtml.py rename to doc/tools/makehtml.py index 9b9c62f33b1..34db47e4240 100644 --- a/tools/docdump/makehtml.py +++ b/doc/tools/makehtml.py @@ -1,3 +1,6 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + import sys import xml.etree.ElementTree as ET from xml.sax.saxutils import escape, unescape @@ -29,7 +32,7 @@ for arg in sys.argv[1:]: input_list.append(arg) if len(input_list) < 1: - print("usage: makehtml.py ") + print("usage: makehtml.py ") sys.exit(0) diff --git a/tools/docdump/makemd.py b/doc/tools/makemd.py similarity index 99% rename from tools/docdump/makemd.py rename to doc/tools/makemd.py index f85d145d5e5..e012287b0e2 100644 --- a/tools/docdump/makemd.py +++ b/doc/tools/makemd.py @@ -1,5 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- + import sys import xml.etree.ElementTree as ET @@ -9,7 +10,7 @@ for arg in sys.argv[1:]: input_list.append(arg) if len(input_list) < 1: - print 'usage: makedoku.py ' + print 'usage: makemd.py ' sys.exit(0) diff --git a/doc/tutorial/01 Getting Started.lyx b/doc/tutorial/01 Getting Started.lyx deleted file mode 100644 index bdb4c7706d1..00000000000 --- a/doc/tutorial/01 Getting Started.lyx +++ /dev/null @@ -1,557 +0,0 @@ -#LyX 1.6.5 created this file. For more info see http://www.lyx.org/ -\lyxformat 345 -\begin_document -\begin_header -\textclass article -\use_default_options true -\language english -\inputencoding auto -\font_roman default -\font_sans default -\font_typewriter default -\font_default_family default -\font_sc false -\font_osf false -\font_sf_scale 100 -\font_tt_scale 100 - -\graphics default -\paperfontsize default -\use_hyperref false -\papersize default -\use_geometry false -\use_amsmath 1 -\use_esint 1 -\cite_engine basic -\use_bibtopic false -\paperorientation portrait -\secnumdepth 3 -\tocdepth 3 -\paragraph_separation indent -\defskip medskip -\quotes_language english -\papercolumns 1 -\papersides 1 -\paperpagestyle default -\tracking_changes false -\output_changes false -\author "" -\author "" -\end_header - -\begin_body - -\begin_layout Title -01. - Getting Started with Godot Engine -\end_layout - -\begin_layout Section* -Introduction: -\end_layout - -\begin_layout Standard -Godot Engine is designed to be useful. - This may sound rather vague and is difficult to explain without repeating - the same claims that every other engine does, but, as we progress through - this (and the next) tutorials, hopefully it will be made clear what -\begin_inset Quotes eld -\end_inset - -useful -\begin_inset Quotes erd -\end_inset - - means. -\end_layout - -\begin_layout Standard -Godot Engine has many components, both high and low level, and is usually - more abstract and complex than most other engines. - This is, however, to the advantage of the user as complexity is presented - in a way that it only needs to be discovered when more power needs to be - untapped. - This helps to provide an easy learning curve. -\end_layout - -\begin_layout Standard -Design wise, the whole API and set of components were created with a clear - goal in mind, which is to allow for smooth integration of design ideas, - code and assets. - This is achieved by defining the following rules: -\end_layout - -\begin_layout Itemize -Implementing a game feature should never be too many steps away from an - existing component. -\end_layout - -\begin_layout Itemize -More complex features should be leveraged by combining or extending existing - components. -\end_layout - -\begin_layout Itemize -If the above fails, creating custom components should be extremely simple. -\end_layout - -\begin_layout Standard -Ultimately, Godot Engine provides an editor and tools that allows everyone - to work with it: -\end_layout - -\begin_layout Itemize -Programmers can script and extend any component of the project. -\end_layout - -\begin_layout Itemize -Designers can tweak and animate any parameter from a friendly user interface. -\end_layout - -\begin_layout Itemize -Artists can import their art and models and tweak the look of everything - in realtime. -\end_layout - -\begin_layout Section* -Editor: -\end_layout - -\begin_layout Standard -As mentioned before, Godot Engine is very abstract so projects consist of - just a -\emph on -path -\emph default - (ie: C: -\backslash -games -\backslash -mygame5). - Projects don't have to be specifically created, and many can be placed - inside the same path (useful for not wasting folders on tests and experiments). - -\end_layout - -\begin_layout Standard -In any case, to ease the management of projects, a graphical util exists. -\end_layout - -\begin_layout Subsection* -Running From The Project Manager -\end_layout - -\begin_layout Standard -Godot Engine includes a built-in project manager. - This is installed by default on Windows and OSX and it allows for the creation - and removal projects that will be remembered at the next startup: -\end_layout - -\begin_layout Standard -\align center -\begin_inset Graphics - filename pm.png - -\end_inset - - -\end_layout - -\begin_layout Standard -To create a new project, the [Create] button must be pressed and a dialog - will appear, prompting for a path and project name. - Afterwards, the [Open] button will close the project manager and open the - desired project. -\end_layout - -\begin_layout Subsection* -Running From the Command Line -\end_layout - -\begin_layout Standard -To create and manage projects, it is perfectly possible to use the command - line. - Many users prefer this way of working with project data. -\end_layout - -\begin_layout Standard -\align center -\begin_inset Graphics - filename pmc.png - -\end_inset - - -\end_layout - -\begin_layout Standard -For ease of use, it is recommended that the -\begin_inset Quotes eld -\end_inset - -godot -\begin_inset Quotes erd -\end_inset - - binary exists in the path, so any project can be opened easily aywhere - just by changing location to the projec and executing the editor. -\end_layout - -\begin_layout Subsection* -Godot Editor -\end_layout - -\begin_layout Standard -Godot Editor should have been opened by now, if not please check the previous - steps again. -\end_layout - -\begin_layout Standard -Godot has a powerful buit-in editor. - It uses the graphics toolkint within itself to display the UI, so it runs - identical on any platform (even consoles or phones!). -\end_layout - -\begin_layout Standard -\align center -\begin_inset Graphics - filename editor.png - -\end_inset - - -\end_layout - -\begin_layout Standard -In the above screenshots, a few regions are labelled to be explained as - follows: -\end_layout - -\begin_layout Subsubsection* -Viewport -\end_layout - -\begin_layout Standard -The -\emph on -Viewport -\emph default - is the main space where the content is displayed. - Content includes 3D Nodes or Graphical User Interface (GUI) controls. - Other types of data spawn editors of their own when being edited. - The default viewport is the 3D viewport, which can be panned, zoomed, etc. -\end_layout - -\begin_layout Subsubsection* -Scene Tree -\end_layout - -\begin_layout Standard -The -\emph on -Scene Tree -\emph default - is a small dock that displays the tree of the current scene being edited. - A scene is a collection of nodes arranged in a tree-hierarchy (any node - can have several owned children-nodes). - The meaning of this ownership depends purely on the -\emph on -type -\emph default - of the node, but it will become clear after going through the examples. - In a -\emph on -MVC -\emph default - pattern, the scene tree could be considered the -\emph on -View -\emph default -. -\end_layout - -\begin_layout Subsubsection* -Property Editor -\end_layout - -\begin_layout Standard -The -\emph on -Property Editor -\emph default - is another small dock. - Every node contains a finite number of -\emph on -properties -\emph default -, which can be edited. - Properties can be of several types, such as integers, strings, images, - matrices, etc. - Usually, changes to properties are reflected in the -\emph on -viewport -\emph default - in real time. -\end_layout - -\begin_layout Section* -Examples: -\end_layout - -\begin_layout Standard -From now, a few, simple examples will be presented that will help understand - a little better how Godot Engine works. - -\end_layout - -\begin_layout Subsubsection* -Hello, World! -\end_layout - -\begin_layout Enumerate -Open the editor -\end_layout - -\begin_layout Enumerate -Click on -\begin_inset Quotes eld -\end_inset - -Node -\begin_inset Quotes erd -\end_inset - - (Node Menu), then on -\begin_inset Quotes eld -\end_inset - -Create Root -\begin_inset Quotes erd -\end_inset - - -\end_layout - -\begin_deeper -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_1.png - -\end_inset - - -\end_layout - -\end_deeper -\begin_layout Enumerate -Create a node of type -\emph on -Label, -\emph default -then instruct the -\emph on -editor -\emph default -to switch to GUI editing mode. - A few red squares will appear on the top left corner, don't mind them yet. -\end_layout - -\begin_deeper -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_2.png - -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_2b.png - -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_3c.png - -\end_inset - - -\end_layout - -\end_deeper -\begin_layout Enumerate -Select the -\emph on -Label -\emph default -node in the -\emph on -Scene Tree -\emph default - (if it's not selected yet), the properties of the selected node will appear - in the -\emph on -Property Editor -\end_layout - -\begin_deeper -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_3a.png - -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_3b.png - -\end_inset - - -\end_layout - -\end_deeper -\begin_layout Enumerate -Look for the -\emph on -Text -\emph default - property in the -\emph on -Property Editor -\emph default - and click the right column, so it becomes editable. - Enter the text -\begin_inset Quotes eld -\end_inset - -Hello, World! -\begin_inset Quotes erd -\end_inset - -. - A red square containing -\begin_inset Quotes eld -\end_inset - -Hello World! -\begin_inset Quotes erd -\end_inset - - will appear at the top left, move it to the center. -\end_layout - -\begin_deeper -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_4a.png - -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_4b.png - -\end_inset - - -\end_layout - -\end_deeper -\begin_layout Enumerate -Save the scene. -\end_layout - -\begin_deeper -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_5a.png - -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_5b.png - -\end_inset - - -\end_layout - -\end_deeper -\begin_layout Enumerate -Press PLAY. - A new window will appear running the application. -\end_layout - -\begin_deeper -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_6.png - -\end_inset - - -\end_layout - -\begin_layout Standard -\align center -\begin_inset Graphics - filename tute1_7.png - -\end_inset - - -\end_layout - -\end_deeper -\begin_layout Subsubsection* -Hello World 2 (a little more complex) -\end_layout - -\begin_layout Subsubsection* -A 3D Cube in Space -\end_layout - -\begin_layout Standard - -\end_layout - -\begin_layout Standard -In many cases, nodes and other types of engine objects need to express changes - in their state, such as a button being pressed, a scroll being dragged, - or a projectile colliding against a tank. - Godot Engine utilizes the concept of signals for this. - Different types of nodes and objects can emit signals, and any other node - or object can connect to them. - -\end_layout - -\end_body -\end_document diff --git a/doc/tutorial/editor.png b/doc/tutorial/editor.png deleted file mode 100644 index 92255a6f17c..00000000000 Binary files a/doc/tutorial/editor.png and /dev/null differ diff --git a/doc/tutorial/pm.png b/doc/tutorial/pm.png deleted file mode 100644 index 00d46d9a64d..00000000000 Binary files a/doc/tutorial/pm.png and /dev/null differ diff --git a/doc/tutorial/pmc.png b/doc/tutorial/pmc.png deleted file mode 100644 index 847d32b3a21..00000000000 Binary files a/doc/tutorial/pmc.png and /dev/null differ diff --git a/doc/tutorial/tute1_1.png b/doc/tutorial/tute1_1.png deleted file mode 100644 index 82152c7255c..00000000000 Binary files a/doc/tutorial/tute1_1.png and /dev/null differ diff --git a/doc/tutorial/tute1_2.png b/doc/tutorial/tute1_2.png deleted file mode 100644 index 852015894c7..00000000000 Binary files a/doc/tutorial/tute1_2.png and /dev/null differ diff --git a/doc/tutorial/tute1_2b.png b/doc/tutorial/tute1_2b.png deleted file mode 100644 index e97a40b4c56..00000000000 Binary files a/doc/tutorial/tute1_2b.png and /dev/null differ diff --git a/doc/tutorial/tute1_3a.png b/doc/tutorial/tute1_3a.png deleted file mode 100644 index 5feef01e035..00000000000 Binary files a/doc/tutorial/tute1_3a.png and /dev/null differ diff --git a/doc/tutorial/tute1_3b.png b/doc/tutorial/tute1_3b.png deleted file mode 100644 index 1f2ded42bbc..00000000000 Binary files a/doc/tutorial/tute1_3b.png and /dev/null differ diff --git a/doc/tutorial/tute1_3c.png b/doc/tutorial/tute1_3c.png deleted file mode 100644 index 2c52ccd780b..00000000000 Binary files a/doc/tutorial/tute1_3c.png and /dev/null differ diff --git a/doc/tutorial/tute1_4a.png b/doc/tutorial/tute1_4a.png deleted file mode 100644 index 8d0d04ff6be..00000000000 Binary files a/doc/tutorial/tute1_4a.png and /dev/null differ diff --git a/doc/tutorial/tute1_4b.png b/doc/tutorial/tute1_4b.png deleted file mode 100644 index fff5f8d7234..00000000000 Binary files a/doc/tutorial/tute1_4b.png and /dev/null differ diff --git a/doc/tutorial/tute1_5a.png b/doc/tutorial/tute1_5a.png deleted file mode 100644 index 37bea04570a..00000000000 Binary files a/doc/tutorial/tute1_5a.png and /dev/null differ diff --git a/doc/tutorial/tute1_5b.png b/doc/tutorial/tute1_5b.png deleted file mode 100644 index df9a987ef3d..00000000000 Binary files a/doc/tutorial/tute1_5b.png and /dev/null differ diff --git a/doc/tutorial/tute1_6.png b/doc/tutorial/tute1_6.png deleted file mode 100644 index bbe04c85478..00000000000 Binary files a/doc/tutorial/tute1_6.png and /dev/null differ diff --git a/doc/tutorial/tute1_7.png b/doc/tutorial/tute1_7.png deleted file mode 100644 index 7653a89064c..00000000000 Binary files a/doc/tutorial/tute1_7.png and /dev/null differ diff --git a/doc/undoredoapi.txt b/doc/undoredoapi.txt deleted file mode 100644 index eb73b8ccff4..00000000000 --- a/doc/undoredoapi.txt +++ /dev/null @@ -1,25 +0,0 @@ -undo/redo api proposal - - - -o o o o o o o o - - -undoredo.create_method(); -undoredo.add_do_method(node,"add_child",node_to_add); -undoredo.add_undo_method(node,"remove_child",node_to_add); -undoredo.add_add_data(node_to_add); -undoredo.commit() - -undoredo.create_method(); -undoredo.add_do_method(node,"remove_node",node_to_remove); -undoredo.add_undo_method(node,"add_node",node_to_remove); -undoredo.add_remove_data(node_to_remove); -undoredo.commit() - - -undoredo.create_property(); -undoredo.add_do_set(node,"property",value); -undoredo.add_undo_set(node,"property",previous_value); -undoredo.add_remove_data(node_to_remove); -undoredo.commit() diff --git a/drivers/openssl/stream_peer_openssl.cpp b/drivers/openssl/stream_peer_openssl.cpp index ef07f113341..81795fdc604 100644 --- a/drivers/openssl/stream_peer_openssl.cpp +++ b/drivers/openssl/stream_peer_openssl.cpp @@ -479,6 +479,13 @@ Error StreamPeerOpenSSL::get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_ return OK; } +int StreamPeerOpenSSL::get_available_bytes() const { + + ERR_FAIL_COND_V(!connected,0); + + return SSL_pending(ssl); + +} StreamPeerOpenSSL::StreamPeerOpenSSL() { ctx=NULL; diff --git a/drivers/openssl/stream_peer_openssl.h b/drivers/openssl/stream_peer_openssl.h index a66b641dd45..64f5a1d7acb 100644 --- a/drivers/openssl/stream_peer_openssl.h +++ b/drivers/openssl/stream_peer_openssl.h @@ -71,6 +71,8 @@ public: virtual Error get_data(uint8_t* p_buffer, int p_bytes); virtual Error get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_received); + virtual int get_available_bytes() const; + static void initialize_ssl(); static void finalize_ssl(); diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index 5aa3915893f..edf5e02971c 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #ifndef NO_FCNTL #ifdef __HAIKU__ #include @@ -367,6 +368,14 @@ Error StreamPeerTCPPosix::get_partial_data(uint8_t* p_buffer, int p_bytes,int &r return read(p_buffer, p_bytes, r_received, false); }; +int StreamPeerTCPPosix::get_available_bytes() const { + + unsigned long len; + int ret = ioctl(sockfd,FIONREAD,&len); + ERR_FAIL_COND_V(ret==-1,0) + return len; + +} IP_Address StreamPeerTCPPosix::get_connected_host() const { return peer_host; diff --git a/drivers/unix/stream_peer_tcp_posix.h b/drivers/unix/stream_peer_tcp_posix.h index 9b1716ac429..817f24c91c2 100644 --- a/drivers/unix/stream_peer_tcp_posix.h +++ b/drivers/unix/stream_peer_tcp_posix.h @@ -67,6 +67,8 @@ public: virtual Error get_data(uint8_t* p_buffer, int p_bytes); virtual Error get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_received); + virtual int get_available_bytes() const; + void set_socket(int p_sockfd, IP_Address p_host, int p_port); virtual IP_Address get_connected_host() const; diff --git a/logo_small.png b/logo_small.png deleted file mode 100644 index 61e4cc95d6a..00000000000 Binary files a/logo_small.png and /dev/null differ diff --git a/makerel.bat b/makerel.bat deleted file mode 100644 index 7db76e1dd77..00000000000 --- a/makerel.bat +++ /dev/null @@ -1 +0,0 @@ -"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" && c:\python27\scons p=windows target=debug_release tools=no diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index 6f51ac53124..fd92c8a9ec9 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -1307,7 +1307,7 @@ MethodInfo GDFunctions::get_info(Function p_func) { } break; case STR_TO_VAR: { - MethodInfo mi("str2var:var",PropertyInfo(Variant::STRING,"string")); + MethodInfo mi("str2var:Variant",PropertyInfo(Variant::STRING,"string")); mi.return_val.type=Variant::NIL; return mi; } break; @@ -1338,7 +1338,7 @@ MethodInfo GDFunctions::get_info(Function p_func) { } break; case HASH: { - MethodInfo mi("hash",PropertyInfo(Variant::NIL,"var:var")); + MethodInfo mi("hash",PropertyInfo(Variant::NIL,"var:Variant")); mi.return_val.type=Variant::INT; return mi; } break; diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index c3cc779bce4..62006cf18b7 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -1370,7 +1370,7 @@ Variant GDFunctionState::resume(const Variant& p_arg) { void GDFunctionState::_bind_methods() { - ObjectTypeDB::bind_method(_MD("resume:var","arg"),&GDFunctionState::resume,DEFVAL(Variant())); + ObjectTypeDB::bind_method(_MD("resume:Variant","arg"),&GDFunctionState::resume,DEFVAL(Variant())); ObjectTypeDB::bind_method(_MD("is_valid"),&GDFunctionState::is_valid); ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&GDFunctionState::_signal_callback,MethodInfo("_signal_callback")); diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp index e8245c92e5a..5bc3e341077 100644 --- a/platform/windows/stream_peer_winsock.cpp +++ b/platform/windows/stream_peer_winsock.cpp @@ -342,6 +342,14 @@ void StreamPeerWinsock::set_nodelay(bool p_enabled) { setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, sizeof(int)); } +int StreamPeerWinsock::get_available_bytes() const { + + unsigned long len; + int ret = ioctlsocket(sockfd,FIONREAD,&len); + ERR_FAIL_COND_V(ret==-1,0) + return len; + +} IP_Address StreamPeerWinsock::get_connected_host() const { diff --git a/platform/windows/stream_peer_winsock.h b/platform/windows/stream_peer_winsock.h index 373b502d2c2..5dd836aa0c1 100644 --- a/platform/windows/stream_peer_winsock.h +++ b/platform/windows/stream_peer_winsock.h @@ -66,6 +66,8 @@ public: virtual Error get_data(uint8_t* p_buffer, int p_bytes); virtual Error get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_received); + virtual int get_available_bytes() const; + void set_socket(int p_sockfd, IP_Address p_host, int p_port); virtual IP_Address get_connected_host() const; diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 295a57d033a..275e4d03040 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -709,7 +709,7 @@ void CanvasItem::draw_circle(const Point2& p_pos, float p_radius, const Color& p } -void CanvasItem::draw_texture(const Ref& p_texture,const Point2& p_pos) { +void CanvasItem::draw_texture(const Ref& p_texture,const Point2& p_pos,const Color& p_modulate) { if (!drawing) { ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); @@ -718,7 +718,7 @@ void CanvasItem::draw_texture(const Ref& p_texture,const Point2& p_pos) ERR_FAIL_COND(p_texture.is_null()); - p_texture->draw(canvas_item,p_pos); + p_texture->draw(canvas_item,p_pos,p_modulate); } void CanvasItem::draw_texture_rect(const Ref& p_texture,const Rect2& p_rect, bool p_tile,const Color& p_modulate, bool p_transpose) { diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index 667fedc9566..4c0386b953b 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -211,7 +211,7 @@ public: void draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width=1.0); void draw_rect(const Rect2& p_rect, const Color& p_color); void draw_circle(const Point2& p_pos, float p_radius, const Color& p_color); - void draw_texture(const Ref& p_texture,const Point2& p_pos); + void draw_texture(const Ref& p_texture, const Point2& p_pos, const Color &p_modulate=Color(1,1,1,1)); void draw_texture_rect(const Ref& p_texture, const Rect2& p_rect, bool p_tile=false,const Color& p_modulate=Color(1,1,1), bool p_transpose=false); void draw_texture_rect_region(const Ref& p_texture,const Rect2& p_rect, const Rect2& p_src_rect,const Color& p_modulate=Color(1,1,1), bool p_transpose=false); void draw_style_box(const Ref& p_style_box,const Rect2& p_rect); diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index b6292c544b3..78b5dabeb42 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -50,9 +50,9 @@ void Slider::_input_event(InputEvent p_event) { grab.pos=orientation==VERTICAL?mb.y:mb.x; double max = orientation==VERTICAL ? get_size().height : get_size().width ; if (orientation==VERTICAL) - set_val( ( ( -(double)grab.pos / max) * ( get_max() - get_min() ) ) + get_max() ); + set_unit_value( 1 - ((double)grab.pos / max) ); else - set_val( ( ( (double)grab.pos / max) * ( get_max() - get_min() ) ) + get_min() ); + set_unit_value((double)grab.pos / max); grab.active=true; grab.uvalue=get_unit_value(); } else { diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 47a55e07167..5f4215a1d50 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -74,6 +74,7 @@ Size2 Tabs::get_minimum_size() const { } } + ms.width=0; //should make this optional return ms; } @@ -85,6 +86,23 @@ void Tabs::_input_event(const InputEvent& p_event) { Point2 pos( p_event.mouse_motion.x, p_event.mouse_motion.y ); + hilite_arrow=-1; + if (buttons_visible) { + + Ref incr = get_icon("increment"); + Ref decr = get_icon("decrement"); + + int limit=get_size().width-incr->get_width()-decr->get_width(); + + if (pos.x>limit+decr->get_width()) { + hilite_arrow=1; + } else if (pos.x>limit) { + hilite_arrow=0; + } + } + + + int hover_buttons=-1; hover=-1; for(int i=0;i incr = get_icon("increment"); + Ref decr = get_icon("decrement"); + + int limit=get_size().width-incr->get_width()-decr->get_width(); + + if (pos.x>limit+decr->get_width()) { + if (missing_right) { + offset++; + update(); + } + return; + } else if (pos.x>limit) { + if (offset>0) { + offset--; + update(); + } + return; + } + } + + int found=-1; for(int i=0;i tex = tabs[i].icon; + if (tex.is_valid()) { + if (tabs[i].text!="") + mw+=get_constant("hseparation"); + + } + mw+=font->get_string_size(tabs[i].text).width; + if (current==i) + mw+=tab_fg->get_minimum_size().width; + else + mw+=tab_bg->get_minimum_size().width; + + if (tabs[i].right_button.is_valid()) { + Ref rb=tabs[i].right_button; + Size2 bms = rb->get_size();//+get_stylebox("button")->get_minimum_size(); + bms.width+=get_constant("hseparation"); + + mw+=bms.width; + } + + if (tabs[i].close_button.is_valid()) { + Ref cb=tabs[i].close_button; + Size2 bms = cb->get_size();//+get_stylebox("button")->get_minimum_size(); + bms.width+=get_constant("hseparation"); + mw+=bms.width; + } + } + + } + + if (tab_align==ALIGN_CENTER) { w=(get_size().width-mw)/2; @@ -238,8 +320,19 @@ void Tabs::_notification(int p_what) { w=0; } + Ref incr = get_icon("increment"); + Ref decr = get_icon("decrement"); + Ref incr_hl = get_icon("increment_hilite"); + Ref decr_hl = get_icon("decrement_hilite"); + + int limit=get_size().width - incr->get_size().width - decr->get_size().width; + + missing_right=false; + for(int i=0;iget_string_size(s).width; lsize+=slen; + + Ref icon; if (tabs[i].icon.is_valid()) { icon = tabs[i].icon; @@ -319,6 +414,16 @@ void Tabs::_notification(int p_what) { } + if (w+lsize > limit) { + max_drawn_tab=i-1; + missing_right=true; + break; + } else { + max_drawn_tab=i; + } + + + Ref sb; int va; Color col; @@ -484,6 +589,25 @@ void Tabs::_notification(int p_what) { } + if (offset>0 || missing_right) { + + int vofs = (get_size().height-incr->get_size().height)/2; + + if (offset>0) + draw_texture(hilite_arrow==0?decr_hl:decr,Point2(limit,vofs)); + else + draw_texture(decr,Point2(limit,vofs),Color(1,1,1,0.5)); + + if (missing_right) + draw_texture(hilite_arrow==1?incr_hl:incr,Point2(limit+decr->get_size().width,vofs)); + else + draw_texture(incr,Point2(limit+decr->get_size().width,vofs),Color(1,1,1,0.5)); + + buttons_visible=true; + } else { + buttons_visible=false; + } + } break; } @@ -673,8 +797,11 @@ Tabs::Tabs() { tab_align=ALIGN_CENTER; rb_hover=-1; rb_pressing=false; + hilite_arrow=-1; cb_hover=-1; cb_pressing=false; cb_displaypolicy = SHOW_NEVER; // Default : no close button + offset=0; + max_drawn_tab=0; } diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h index 1a8352bc932..48fbed1f76e 100644 --- a/scene/gui/tabs.h +++ b/scene/gui/tabs.h @@ -65,6 +65,12 @@ private: Rect2 cb_rect; }; + + int offset; + int max_drawn_tab; + int hilite_arrow; + bool buttons_visible; + bool missing_right; Vector tabs; int current; Control *_get_tab(int idx) const; diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index ee7c0724e3b..1b204cff650 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1721,6 +1721,7 @@ void Tree::text_editor_enter(String p_text) { text_editor->hide(); + value_editor->hide(); if (!popup_edited_item) return; @@ -2167,18 +2168,9 @@ void Tree::_input_event(InputEvent p_event) { range_drag_enabled=false; Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE); warp_mouse(range_drag_capture_pos); - } else { - text_editor->set_pos(pressing_item_rect.pos); - text_editor->set_size(pressing_item_rect.size); + } else + edit_selected(); - text_editor->clear(); - text_editor->set_text( pressing_for_editor_text ); - text_editor->select_all(); - - text_editor->show_modal(); - text_editor->grab_focus(); - - } pressing_for_editor=false; } diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index a1137ba6144..86cf818ac35 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -30,6 +30,8 @@ #include "servers/physics_2d_server.h" #include "servers/visual_server.h" +#include "geometry.h" + void ConvexPolygonShape2D::_update_shape() { Physics2DServer::get_singleton()->shape_set_data(get_rid(),points); @@ -40,7 +42,9 @@ void ConvexPolygonShape2D::_update_shape() { void ConvexPolygonShape2D::set_point_cloud(const Vector& p_points) { - + Vector hull=Geometry::convex_hull_2d(p_points); + ERR_FAIL_COND(hull.size()<3); + set_points(hull); } void ConvexPolygonShape2D::set_points(const Vector& p_points) { diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 25407a5b845..33e1eb338e6 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -709,6 +709,10 @@ void make_default_theme() { t->set_stylebox("button_pressed","Tabs", make_stylebox( button_pressed_png,4,4,4,4) ); t->set_stylebox("button","Tabs", make_stylebox( button_normal_png,4,4,4,4) ); + t->set_icon("increment","Tabs",make_icon( scroll_button_right_png)); + t->set_icon("increment_hilite","Tabs",make_icon( scroll_button_right_hl_png)); + t->set_icon("decrement","Tabs",make_icon( scroll_button_left_png)); + t->set_icon("decrement_hilite","Tabs",make_icon( scroll_button_left_hl_png)); t->set_font("font","Tabs", default_font ); diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index b4ea60cb8d0..51d8be32948 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -572,8 +572,8 @@ void ShaderMaterial::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_shader","shader:Shader"), &ShaderMaterial::set_shader ); ObjectTypeDB::bind_method(_MD("get_shader:Shader"), &ShaderMaterial::get_shader ); - ObjectTypeDB::bind_method(_MD("set_shader_param","param","value:var"), &ShaderMaterial::set_shader_param); - ObjectTypeDB::bind_method(_MD("get_shader_param:var","param"), &ShaderMaterial::get_shader_param); + ObjectTypeDB::bind_method(_MD("set_shader_param","param","value:Variant"), &ShaderMaterial::set_shader_param); + ObjectTypeDB::bind_method(_MD("get_shader_param:Variant","param"), &ShaderMaterial::get_shader_param); ObjectTypeDB::bind_method(_MD("_shader_changed"), &ShaderMaterial::_shader_changed ); } diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index f8283bb5ca4..443d1630a72 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -1537,6 +1537,7 @@ void SceneState::add_editable_instance(const NodePath& p_path){ SceneState::SceneState() { base_scene_idx=-1; + last_modified_time=0; } @@ -1596,6 +1597,15 @@ Node *PackedScene::instance(bool p_gen_edit_state) const { return s; } +void PackedScene::recreate_state() { + + state = Ref( memnew( SceneState )); + state->set_path(get_path()); +#ifdef TOOLS_ENABLED + state->set_last_modified_time(get_last_modified_time()); +#endif +} + Ref PackedScene::get_state() { return state; @@ -1607,6 +1617,7 @@ void PackedScene::set_path(const String& p_path,bool p_take_over) { Resource::set_path(p_path,p_take_over); } + void PackedScene::_bind_methods() { ObjectTypeDB::bind_method(_MD("pack","path:Node"),&PackedScene::pack); diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index f3ec0afb6da..67d0f4ba01d 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -99,6 +99,8 @@ class SceneState : public Reference { String path; + uint64_t last_modified_time; + _FORCE_INLINE_ Ref _get_base_scene_state() const; static bool disable_placeholders; @@ -162,6 +164,9 @@ public: void add_connection(int p_from,int p_to, int p_signal, int p_method, int p_flags,const Vector& p_binds); void add_editable_instance(const NodePath& p_path); + virtual void set_last_modified_time(uint64_t p_time) { last_modified_time=p_time; } + uint64_t get_last_modified_time() const { return last_modified_time; } + SceneState(); }; @@ -189,8 +194,13 @@ public: bool can_instance() const; Node *instance(bool p_gen_edit_state=false) const; - virtual void set_path(const String& p_path,bool p_take_over=false); + void recreate_state(); + virtual void set_path(const String& p_path,bool p_take_over=false); +#ifdef TOOLS_ENABLED + virtual void set_last_modified_time(uint64_t p_time) { state->set_last_modified_time(p_time); } + +#endif Ref get_state(); PackedScene(); diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 7b67eaeda85..f8a14e58a09 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -260,7 +260,7 @@ void ShaderGraph::_bind_methods() { ObjectTypeDB::bind_method(_MD("clear","shader_type"),&ShaderGraph::clear); ObjectTypeDB::bind_method(_MD("node_set_state","shader_type","id","state"),&ShaderGraph::node_set_state); - ObjectTypeDB::bind_method(_MD("node_get_state:var","shader_type","id"),&ShaderGraph::node_get_state); + ObjectTypeDB::bind_method(_MD("node_get_state:Variant","shader_type","id"),&ShaderGraph::node_get_state); ObjectTypeDB::bind_method(_MD("_set_data"),&ShaderGraph::_set_data); ObjectTypeDB::bind_method(_MD("_get_data"),&ShaderGraph::_get_data); diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index 31b28ee8922..56fd8e212e9 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -108,8 +108,8 @@ void Shape2D::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_custom_solver_bias"),&Shape2D::get_custom_solver_bias); ObjectTypeDB::bind_method(_MD("collide","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide); ObjectTypeDB::bind_method(_MD("collide_with_motion","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion); - ObjectTypeDB::bind_method(_MD("collide_and_get_contacts:var","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide_and_get_contacts); - ObjectTypeDB::bind_method(_MD("collide_with_motion_and_get_contacts:var","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion_and_get_contacts); + ObjectTypeDB::bind_method(_MD("collide_and_get_contacts:Variant","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide_and_get_contacts); + ObjectTypeDB::bind_method(_MD("collide_with_motion_and_get_contacts:Variant","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion_and_get_contacts); ADD_PROPERTY( PropertyInfo(Variant::REAL,"custom_solver_bias",PROPERTY_HINT_RANGE,"0,1,0.001"),_SCS("set_custom_solver_bias"),_SCS("get_custom_solver_bias")); } diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp index b9d15d6e350..5d8446ed383 100644 --- a/servers/physics_2d_server.cpp +++ b/servers/physics_2d_server.cpp @@ -102,7 +102,7 @@ void Physics2DDirectBodyState::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_contact_collider_id","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_id); ObjectTypeDB::bind_method(_MD("get_contact_collider_object","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_object); ObjectTypeDB::bind_method(_MD("get_contact_collider_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape); - ObjectTypeDB::bind_method(_MD("get_contact_collider_shape_metadata:var","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape_metadata); + ObjectTypeDB::bind_method(_MD("get_contact_collider_shape_metadata:Variant","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape_metadata); ObjectTypeDB::bind_method(_MD("get_contact_collider_velocity_at_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_velocity_at_pos); ObjectTypeDB::bind_method(_MD("get_step"),&Physics2DDirectBodyState::get_step); ObjectTypeDB::bind_method(_MD("integrate_forces"),&Physics2DDirectBodyState::integrate_forces); diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp index c1d3e5e3148..3161e380b95 100644 --- a/tools/doc/doc_data.cpp +++ b/tools/doc/doc_data.cpp @@ -187,14 +187,13 @@ void DocData::generate(bool p_basic_types) { arginfo=E->get().return_val; - if (arginfo.type==Variant::NIL) - continue; #ifdef DEBUG_METHODS_ENABLED if (m && m->get_return_type()!=StringName()) method.return_type=m->get_return_type(); - else + else if (arginfo.type!=Variant::NIL) { #endif method.return_type=(arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE)?arginfo.hint_string:Variant::get_type_name(arginfo.type); + } } else { diff --git a/tools/docdump/class_list.xml b/tools/docdump/class_list.xml deleted file mode 100644 index 3d07f841771..00000000000 --- a/tools/docdump/class_list.xml +++ /dev/null @@ -1,13625 +0,0 @@ - - - - - Contains data used to animate everything in the engine. - - - An Animation resource contains data used to animate everything in the engine. Animations are divided into tracks, and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (signals) to the track. [html br/] Animations are just data containers, and must be added to odes such as an [AnimationPlayer] or [AnimationTreePlayer] to be played back. - - - - - - - - - Add a track to the Animation. The track type must be specified as any of the values in te TYPE_* enumeration. - - - - - - - Remove a track by specifying the track index. - - - - - - - Return the amount of tracks in the animation. - - - - - - - - - Get the type of a track. - - - - - - - - - Get the path of a track. for more information on the path format, see [method track_set_path] - - - - - - - - - Set the path of a track. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ":". Example: "character/skeleton:ankle" or "character/mesh:transform/local:" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return the amount of keys in a given track. - - - - - - - - - - - - - - - - - - - Return the time at which the key is located. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Set the total length of the animation (in seconds). Note that length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping. - - - - - - - Return the total length of the animation (in seconds). - - - - - - - Set a flag indicating that the animation must loop. This is uses for correct interpolation of animation cycles, and for hinting the player that it must restart the animation once it's over. - - - - - - - Return wether the animation has the loop flag set. - - - - - - - - Transform tracks are used to change node local transforms or skeleton pose bones. Transitions are Interpolated. - - - - - TODO will be changed and bleh - - - Value tracks set values in node properties, but only those which can be Interpolated. - - - - - - - - - - - - Container and player of [Animaton] resources. - - - An animation player is used for general purpose playback of [Animation] resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in diferent channels. - - - - - - - - - - - Add an animation resource to the player, which will be later referenced by the "name" argument. - - - - - - - Remove an animation from the player (by supplying the same name used to add it). - - - - - - - - - - - - - - - - - Request wether an [Animation] name exist within the player. - - - - - - - - - Get an [Animation] resource by requesting a name. - - - - - - - Get the list of names of the animations stored in the player. - - - - - - - - - - - Specify a blend time (in seconds) between two animations, referemced by their names. - - - - - - - - - - - Get the blend time between two animations, referemced by their names. - - - - - - - - - Start playback of an animation (referenced by "name"). Optionally a channel can be specified. - - - - - - - Start playback of an animation channel. (or channel 0 if none is provided). - - - - - Stop playback on all animation channels. - - - - - - - - - Return wether an animation chanel is playing (or channel 0 if none is provided). - - - - - - - - - Return the name of the animation being played in a channel (or channel 0 if none is provided). - - - - - - - Pause the playback in all animation channels. - - - - - - - Return [html i]true[html /i] if all playback is paused. - - - - - - - - - Set a speed scaling ratio in a given animation channel (or channel 0 if none is provided). Default ratio is [html i]1[html /i] (no scaling). - - - - - - - - - Get the speed scaling ratio in a given animation channel (or channel 0 if none is provided). Default ratio is [html i]1[html /i] (no scaling). - - - - - - - - - Seek the animation in an animation channel (or channel 0 if none is provided) to a specific position (in seconds). - - - - - - - - - Return the playback position (in seconds) in an animation channel (or channel 0 if none is provided) - - - - - - - - - - - - - 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. - - - - - - Maximum amount of animation channels. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides a base class for different kinds of buttons. - - - BaseButton is the abstract base class for buttons, so it shouldn't be used directly (It doesnt display anything). Other types of buttons inherit from it. - - - - - - - Set the button to pressed state (only if toggle_mode is active). - - - - - - - Return when the button is pressed (only if toggle_mode is active). - - - - - - - Set the button toggle_mode property. Toggle mode makes the button flip state between pressed and unpressed each time its area is clicked. - - - - - - - Return the toggle_mode property (see [method set_toggle_mode]). - - - - - - - Set the button into disabled state. When a button is disabled, it can't be clicked or toggled. - - - - - - - Return wether the button is in disabled state (see [method set_disabled]). - - - - - - - Set the button click_on_press mode. This mode generates click signals when a mousebutton or key is just pressed (by default signals are generated when the button/keys are released and both press and release occur in the visual area of the Button). - - - - - - - Return the state of the click_on_press property (see [method set_click_on_press]). - - - - - - - - - This signal is emitted when the button was just toggled between pressed and normal states (only if toggle_mode is active). The new state is contained in the [html i]pressed[html /i] argument. - - - - - This signal is emitted every time the button is pressed or toggled. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Standard themed Button. - - - Button is just the standard themed button: [html image src="images/button_example.png"/] It can contain a text and an icon, and will display them according to the current theme. - - - - - - - Set the button text, which will be displayed inside the button area. - - - - - - - Return the button text. - - - - - - - Set the button icon, which will be displayed to the left of the text. - - - - - - - Return the button icon. - - - - - - - Set the [html i]flat[html /i] property of a Button. Flat buttons don't display decoration unless hoevered or pressed. - - - - - - - Set the [html i]clip_text[html /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. - - - - - - - Return the state of the [html i]clip_text[html /i] property (see [method set_clip_text]) - - - - - - - Return the state of the [html i]flat[html /i] property (see [method set_flat]) - - - - - - - - - Camera node, displays from a point of view. - - - Camera is a special node that displays what is visible from its current location. Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the Camera will register in the global viewport. In other words, a Camera just provides [html i]3D[html /i] display capabilities to a [Viewport], and, without one, a [Scene] registered in that [Viewport] (or higher viewports) can't be displayed. - - - - - - - - - Return a normal vector in worldspace, that is the result of projecting a point on the [Viewport] rectangle by the camera proyection. This is useful for casting rays in the form of (origin,normal) for object intersection or picking. - - - - - - - - - Return a 3D position in worldspace, that is the result of projecting a point on the [Viewport] rectangle by the camera proyection. This is useful for casting rays in the form of (origin,normal) for object intersection or picking. - - - - - - - - - Return how a 3D point in worldpsace maps to a 2D coordinate in the [Viewport] rectangle. - - - - - - - - - - - Set the camera projection to perspective mode, by specifying a [html i]FOV[html /i] angle in degrees (FOV means Field of View), and the [html i]near[html /i] and [html i]far[html /i] clip planes in worldspace units. - - - - - - - - - - - Set the camera projection to orthogonal mode, by specifying a rectangle and the [html i]near[html /i] and [html i]far[html /i] clip planes in worldspace units. (As a hint, 2D games often use this projection, with values specified in pixels) - - - - - 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. - - - - - - - - - - - Return wether the Camera is the current one in the [Viewport], or plans to become current (if outside the scene tree). - - - - - - - Get the camera transform. Subclassed cameras (such as CharacterCamera) may provide different transforms than the [Node] transform. - - - - - - - - - - - - Perspective Projection (object's size on the screen becomes smaller when far away). - - - Orthogonal Projection (objects remain the same size on the screen no matter how far away they are). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Control is the base class Node for all the GUI components. - - - Control is the base class Node for all the GUI components. Every GUI component inherits from it, directly or indirectly. Control Nodes contain positions relative to their parent control nodes. In this way, sections of the scene tree made of contiguous Control Nodes, become user interfaces.[html br/] Controls contain a [html i]canvas item[html /i] RID from the visual server, and can draw to it when receiving a NOTIFICATION_DRAW.[html br/] TODO: Explain margins and anchors[html br/] TODO: explain focus[html br/] - - - - - - - - - - - Return the minimum size this Control can shrink to. A control will never be displayed or resized smaller than its minimum size. - - - - - - - Return wether this control is a [html i]window[html /i]. Controls are considered windows when their parent [Node] is not a Control. - - - - - - - Return the [html i]window[html /i] for this control, ascending the scene tree (see [method is_window]). - - - - - - - - - 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 previos 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]). - - - - - - - - - Return the anchor type (ANCHOR_BEGIN, ANCHOR_END, ANCHOR_RATIO) for a given margin (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). - - - - - - - - - Set a margin offset. Margin can be one of (MARGIN_LEFT, MARGIN_TOP, MARGIN_RIGHT, MARGIN_BOTTOM). Offset value being set depends on the anchor mode. - - - - - - - - - - - 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]). - - - - - - - Sets MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see [method set_margin]). - - - - - - - Sets MARGIN_RIGHT and MARGIN_BOTTOM at the same time. This is a helper (see [method set_margin]). - - - - - - - Move the Control to a new position, relative to the top-left corner of the parent Control, changing all margins if needed and without changing current anchor mode. This is a helper (see [method set_margin]). - - - - - - - Changes MARGIN_RIGHT and MARGIN_BOTTOM to fit a given size. This is a helper (see [method set_margin]). - - - - - - - Move the Control to a new position, relative to the top-left corner of the [html i]window[html /i] Control, and without changing current anchor mode. (see [method set_margin]). - - - - - - - - - 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. - - - - - - - - - - - - - Returns MARGIN_LEFT and MARGIN_TOP at the same time. This is a helper (see [method set_margin]). - - - - - - - Returns the Control position, relative to the top-left corner of the parent Control and independly of the anchor mode. - - - - - - - Returns the size of the Control, computed from all margins, however the size returned will [html b]never be smaller than the minimum size reported by [method get_minimum_size][html /b]. This means that even if end position of the Control rectangle is smaller than the begin position, the Control will still display and interact correctly. (see description, [method get_minimum_size], [method set_margin], [method set_anchor]). - - - - - - - Returns the Control position, relative to the top-left corner of the parent Control and independent of the anchor mode. - - - - - - - Return position and size of the Control, relative to the top-left corner of the parent Control. This is a helper (see [method get_pos],[method get_size]). - - - - - - - Return position and size of the Control, relative to the top-left corner of the [html i]window[html /i] Control. This is a helper (see [method get_global_pos],[method get_size]). - - - - - Change all margins and anchors, so this Control always takes up the same area as the parent Control. This is a helper (see [method set_anchor],[method set_margin]). - - - - - - - Display a Control as modal. Control must be a subwindow (see [method set_as_subwindow]). Modal controls capture the input signals until closed or the area outside them is accessed. When a modal control loses focus, or the ESC key is pressed, they automatically hide. Modal controls are used extensively for popup dialogs and menus. - - - - - - - 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. - - - - - - - Return wether the Control is the current focused control (see [method set_focus_mode]). - - - - - Steal the focus from another control and become the focused control (see [method set_focus_mode]). - - - - - - - Override whole the [Theme] for this Control and all its children controls. - - - - - - - Return a [Theme] override, if one exists (see [method set_theme]). - - - - - - - - - Override a single icon ([Texture]) in the theme of this Control. If texture is empty, override is cleared. - - - - - - - - - Override a single stylebox ([Stylebox]) in the theme of this Control. If stylebox is empty, override is cleared. - - - - - - - - - Override a single font (font) in the theme of this Control. If font is empty, override is cleared. - - - - - - - - - - - - - - - - - Override a single constant (integer) in the theme of this Control. If constant equals Theme.INVALID_CONSTANT, override is cleared. - - - - - - - Return the parent Control. Unlike get_parent() in [Node], only returns a valid object if the parent is a Control. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Control gained focus. - - - - - Mouse pointer entered the area of the Control. - - - Control changed size (get_size() reports the new size). - - - Control can acquire focus only if clicked. - - - - - - - - - - - - - - - Control lost focus. - - - Control can't acquire focus. - - - X is relative to MARGIN_LEFT, Y is relative to MARGIN_TOP, - - - - - - - - - - - Mouse pointer exited the area of the Control. - - - Control can acquire focus if clicked, or by pressing TAB/Directionals in the keyboard from another Control. - - - - - X and Y are a ratio (0 to 1) relative to the parent size 0 is left/top, 1 is right/bottom. - - - X is relative to -MARGIN_RIGHT, Y is relative to -MARGIN_BOTTOM, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GridMap is like a tile map, but in 3D. - - - GridMap is a 3D Tile map, using [html i]3D Cells[html /i] instead of tiles. On each cell, a mesh and a collision volume can be placed from a [MeshLibrary]. GridMap is used for designing worlds quickly. Despite that GridMaps can contain up to hundreds millions of cells, they are very optimized, and only use resources for the cells that contain items. - - - - - - - Set a MeshLibrary. Cell indices refer to items in the theme. - - - - - - - Get the current MeshLibrary (if exists). - - - - - - - Set the size of a cell, in worldpsace units. All cells in a GridMap are the same size. - - - - - - - Return the current cell size. - - - - - - - - - - - - - - - - - - - Set the width of the GridMap. Width is the amount of cells i the direction of the X coordinate. - - - - - - - Get the width of the GridMap. Width is the amount of cells i the direction of the X coordinate. - - - - - - - Set the height of the GridMap. Height is the amount of cells i the direction of the Y coordinate. - - - - - - - Get the height of the GridMap. Height is the amount of cells i the direction of the Y coordinate. - - - - - - - Set the depth of the GridMap. Depth is the amount of cells i the direction of the Z coordinate. - - - - - - - Get the depth of the GridMap. Depth is the amount of cells i the direction of the Z coordinate. - - - - - - - - - - - - - - - Set a cell item (x,y,z pos). Cell items are indices to items in the [MeshLibrary]. - - - - - - - - - - - - - Get a cell item (x,y,z pos). Cell items are indices to items in the [MeshLibrary]. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Value indicating that a cell item is not used or invalid. - - - - - - Theme for a [GridMap]. - - - MeshLibrary is [Resource] containing the data used in a [GridMap]. It's filled with items, each containing a mesh and a collision shape. - - - - - - - Create a new item, and assign it a given id. - - - - - - - - - Set the name of an item, referenced by id. - - - - - - - - - Set the [Mesh] of an item, referenced by id. - - - - - - - - - - - - - - - - - Get the name of an item, referenced by id. - - - - - - - - - Get the [Mesh] of an item, referenced by id. - - - - - - - - - - - - - - - Remove an item, referenced by id. - - - - - Clear all items contained in this resource. - - - - - - - Get the list of item IDs contained in this theme. - - - - - - - Get the last unused item id. This is useful for creating new item IDs. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directional Light, such as the Sun or the Moon. - - - A DirectionalLight is a type of [Light] node that emits light constantly in one direction (the negative z axis of the node). It is used lights with strong intensity that are located far away from the scene to model sunlight or moonlight. The worldpace location of the DirectionalLight transform (origin) is ignored, only the basis is used do determine light direction. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dialog for selecting files or directories in the filesystem. - - - FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. - - - - - Clear all the added filters in the dialog. - - - - - - - Add a custom filter. Filter format is: "mask ; description. - - - - - - - Get the current working directory of the file dialog. - - - - - - - Get the current selected file of the file dialog (empty if none). - - - - - - - Get the current selected path (directory and file) of the file dialog (empty if none). - - - - - - - - - - - - - - - - - - - - - - - - - Set the file dialog mode from the MODE_* enum. - - - - - - - Get the file dialog mode from the MODE_* enum. - - - - - - - - - - - - - - - Event emitted when the user selects a file (double clicks it or presses the OK button). - - - - - - - - Editor will not allow to select nonexistent files. - - - Editor will warn when a file exists. - - - - - - Simple Material with a fixed parameter set. - - - FixedMaterial is a simple type of material [Resource], which contains a fixed amount of paramters. It is the only type of material supported in fixed-pipeline devices and APIs. It is also an often a better alternative to [ShaderMaterial] for most simple use cases. - - - - - - - - - - - - - - - - - - - - - Set a parameter, parameters are defined in the PARAM_* enum. The type of each parameter may change, so it's best to check the enum. - - - - - - - Return a parameter, parameters are defined in the PARAM_* enum. The type of each parameter may change, so it's best to check the enum. - - - - - - - - - Set a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see [method set_texcoord_mode]). - - - - - - - - - Return a texture. Textures change parameters per texel and are mapped to the model depending on the texcoord mode (see [method set_texcoord_mode]). - - - - - - - Set the texture coordinate generation mode. Materials have a unique, texgen mode which can generate texture coordinates on the fly. Texgen mode must be one of the values from the TEXGEN_* enum. TEXGEN can be selected as a texture coordinate mode (see [method set_texcoord_mode]). - - - - - - - Return the texture coordinate generation mode. Materials have a unique, texgen mode which can generate texture coordinates on the fly. Texgen mode must be one of the values from the TEXGEN_* enum. TEXGEN can be selected as a texture coordinate mode (see [method set_texcoord_mode]). - - - - - - - - - Set the texture coordinate mode. Each texture param (from the PARAM_* enum) has one. It defines how the textures are mapped to the object. - - - - - - - - - Return the texture coordinate mode. Each texture param (from the PARAM_* enum) has one. It defines how the textures are mapped to the object. - - - - - - - Sets a special transform used to post-transform UV coordinates of the uv_xfrom tecoord mode: TEXCOORD_UV_TRANSFORM - - - - - - - Returns the special transform used to post-transform UV coordinates of the uv_xfrom tecoord mode: TEXCOORD_UV_TRANSFORM - - - - - - Specular Exponent (size of the specular dot) - - - Detail Layer for diffuse lighting. - - - Read texture coordinates from the UV2 array. - - - Use the screen coordinates as UV, scaled by depth and the screenz coefficient. - - - Read texture coordinates from the UV array and transform them by uv_xform. - - - Use object local X and Y coordinates as UV. - - - - - Maximum amount of parameters - - - Diffuse Lighting (light scattered from surface). - - - Emission Lighting (light emitted from the surface) - - - Specular Lighting (light reflected from the surface). - - - Mix coefficient for the detail layer. - - - Use view normal reflected by object normal as UV. - - - Normal Map (irregularity map). - - - Glow (Visible emitted scattered light). - - - Read texture coordinates from the UV array. - - - Use texture coordinates from the texgen. - - - Use the screen coordinates as UV. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Internationalized font and text drawing support. - - - 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. - - - - - - - Set the total font height (ascent plus descent) in pixels. - - - - - - - Return the total font height (ascent plus descent) in pixels. - - - - - - - Set the font ascent (number of pixels above the baseline). - - - - - - - Return the font ascent (number of pixels above the baseline). - - - - - - - Return the font descent (number of pixels below the baseline). - - - - - - - - - - - Add a kerning pair to the [Font] as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. - - - - - - - - - - - Return a kerning pair as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. - - - - - - - Add a texture to the [Font]. - - - - - - - - - - - - - - - Add a character to the font, where "character" is the unicode value, "texture" is the texture index, "rect" is the region in the texture (in pixels!), "align" is the (optional) alignment for the character and "advance" is the (optional) advance. - - - - - - - - - - - Return the size of a character, optionally taking kerning into account if the next character is provided. - - - - - - - - - Return the size of a string, taking kerning and advance into account. - - - - - Clear all the font data. - - - - - - - - - - - - - - - Draw "string" into a canvas item using the font at a given "pos" position, with "modulate" color, and optionally clipping the width. "pos" specifies te baseline, not the top. To draw from the top, [html i]ascent[html /i] must be added to the Y axis. - - - - - - - - - - - - - - - - - Draw character "char" into a canvas item using the font at a given "pos" position, with "modulate" color, and optionally kerning if "next" is apassed. clipping the width. "pos" specifies te baseline, not the top. To draw from the top, [html i]ascent[html /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. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Contains global variables accessible from everywhere. - - - Contains global variables accessible from everywhere. Use the normal [Object] API, such as "Globals.get(variable)", "Globals.set(variable,value)" or "Globals.has(variable)" to access them. Variables stored in engine.cfg are also loaded into globals, making this object very useful for reading custom game configuration options. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Horizontal version of [ScrollBar], which goes from top (min) to bottom (max). - - - - - - - - - - - Horizontal version of [Separator]. - - - Horizontal version of [Separator]. It is used to separate objects vertiacally, though (but it looks horizontal!). - - - - - - - - - - - - - - - - - - - IP Protocol support functions. - - - IP contains some support functions for the IPv4 protocol. TCP/IP support is in different classes (see [TCP_Client], [TCP_Server]). IP provides hostname resolution support, both blocking and threaded. - - - - - - - - - Resolve a given hostname, blocking. Resolved hostname is returned as an IP. - - - - - - - - - Create a queue item for resolving a given hostname. The queue ID is returned, or RESOLVER_INVALID_ID on error. - - - - - - - - - Return the status of hostname queued for resolving, given it's queue ID. Returned status can be any of the RESOLVER_STATUS_* enumeration. - - - - - - - - - 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]). - - - - - - - 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. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Control that displays formatted text. - - - Label is a control that displays formatted text, optionally autowrapping it to the [Control] area. It inherits from range to be able to scroll wrapped text vertically. - - - - - - - Set the alignmend mode to any of the ALIGN_* enumeration values. - - - - - - - Return the alignmend mode (any of the ALIGN_* enumeration values). - - - - - - - Set the label text. Text can contain newlines. - - - - - - - Return the label text. Text can contain newlines. - - - - - - - Set [html i]autowrap[html /i] mode. When enabled, autowrap will fit text to the control width, breaking sentences when they exceed the available horizontal space. When disabled, the label minimum width becomes the width of the longest row, and the minimum height large enough to fit all rows. - - - - - - - Return the state of the [html i]autowrap[html /i] mode (see [method set_autowrap]). - - - - - - Align rows centered. - - - Align rows to the left (default). - - - Align rows to the right (default). - - - Expand row whitespaces to fit the width. - - - - - - Provides a base class for different kinds of light nodes. - - - Light is the abstract base class for light nodes, so it shouldn't be used directly (It can't be instanced). Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Control that provides single line string editing. - - - LineEdit provides a single line string editor, used for text fields. - - - - - Clear the [LineEdit] text. - - - - - Select the whole string. - - - - - - - Set the text in the [LineEdit], clearing the existing one and the selection. - - - - - - - Return the text in the [LineEdit]. - - - - - - - Set the cursor position inside the [LineEdit], causing it to scroll if needed. - - - - - - - Return the cursor position inside the [LineEdit]. - - - - - - - Set the maximum amount of characters the [LineEdit] can edit, and cropping existing text in case it exceeds that limit. Setting 0 removes the limit. - - - - - - - Return the maximum amount of characters the [LineEdit] can edit. If 0 is returned, no limit exists. - - - - - - - Append text at cursor, scrolling the [LineEdit] when needed. - - - - - - - Set the [html i]editable[html /i] status of the [LineEdit]. When disabled, existing text can't be modified and new text can't be added. - - - - - - - Return the [html i]editable[html /i] status of the [LineEdit] (see [method set_editable]). - - - - - - - Set the [html i]secret[html /i] status of the [LineEdit]. When enabled, every character is displayed as "*". - - - - - - - Return the [html i]secret[html /i] status of the [LineEdit] (see [method set_secret]). - - - - - - - - - - - - - - - This signal is emitted when the user presses KEY_ENTER on the [LineEdit]. This signal is often used as an alternate confirmation mechanism in dialogs. - - - - - - - When the text changes, this signal is emitted. - - - - - - - - - Main loop is the abstract main loop base class. - - - Main loop is the abstract main loop base class. All other main loop classes are derived from it. Upon application start, a [MainLoop] has to be provided to OS, else the application will exit. This happens automatically (and a [SceneMainLoop] is created), unless a main [Script] is supplied, which may or not create and return a [MainLoop]. - - - - - - - - - - - - - - - Abstract base [Resource] for coloring and shading geometry. - - - Material is a base [Resource] used for coloring and shading geometry. All materials inherit from it and almost all [VisualInstance] derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here. - - - - - - - - - Set a [Material] flag, which toggles on or off a behavior when rendering. See enumeration FLAG_* for a list. - - - - - - - - - Return a [Material] flag, which toggles on or off a behavior when rendering. See enumeration FLAG_* for a list. - - - - - - - - - - - - - - - - - - - - - - - Set blend mode for the material, which can be one of BLEND_MODE_MIX (default), BLEND_MODE_ADD, BLEND_MODE_SUB. Keep in mind that only BLEND_MODE_MIX ensures that the material [html i]may[html /i] be opaque, any other blend mode will render with alpha blending enabled in raster-based [VisualServer] implementations. - - - - - - - Return blend mode for the material, which can be one of BLEND_MODE_MIX (default), BLEND_MODE_ADD, BLEND_MODE_SUB. Keep in mind that only BLEND_MODE_MIX ensures that the material [html i]may[html /i] be opaque, any other blend mode will render with alpha blending enabled in raster-based [VisualServer] implementations. - - - - - - - - - - - - - - - - - - - Set the line width for geometry drawn with FLAG_WIREFRAME enabled, or LINE primitives. Note that not all hardware or VisualServer backends support this (like DirectX). - - - - - - - Return the line width for geometry drawn with FLAG_WIREFRAME enabled, or LINE primitives. Note that not all hardware or VisualServer backends support this (like DirectX). - - - - - - - - - - - - - - - - - - - - - - - - - - Triangle geometry is drawn as lines if this flag is enabled. - - - - - - - - - Both front facing and back facing triangles are rendered when this flag is enabled. - - - Geometry world transform is computed as billboard if this flag is enabled, often used for impostors. - - - Shading (lighting) is disabled when this flag is enabled. - - - Use the regular alpha blending equation (source and dest colors are faded) (default). - - - - - - - Maximum amount of flags - - - Geometry is visible when this flag is enabled (default). - - - - - - - - - Use additive blending equation, often used for particle effects such as fire or light decals. - - - - - - - - - Use substractive blending equation, often used for some smoke effects or types of glass. - - - Front facing and back facing order is swapped when this flag is enabled. - - - - - - Special button that brings up a [PopupMenu] when clicked. - - - Special button that brings up a [PopupMenu] when clicked. That's pretty much all it does, as it's just a helper class when bulding GUIs. - - - - - - - Return the [PopupMenu] contained in this button. - - - - - - - - - - - - - - - A [Resource] that contains vertex-array based geometry. - - - Mesh is a type of [Resource] that contains vertex-array based geometry, divided in [html i]surfaces[html /i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is prefered to a single surface, because objects created in 3D editing software commonly contain multiple materials. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create a new surface ([method get_surface_count] will become surf_idx for this.[html br/] Surfaces are created to be rendered using a "primitive", which may be PRIMITIVE_POINTS, PRIMITIVE_LINES, PRIMITIVE_LINE_STRIP, PRIMITIVE_LINE_LOOP, PRIMITIVE_TRIANGLES, PRIMITIVE_TRIANGLE_STRIP, PRIMITIVE_TRIANGLE_FAN. (As a note, when using indices, it is recommended to only use just points, lines or triangles).[html br/] The format of a surface determines which arrays it will allocate and hold, so "format" is a combination of ARRAY_FORMAT_* mask constants ORed together. ARRAY_FORMAT_VERTEX must be always present. "array_len" determines the amount of vertices in the array (not primitives!). if ARRAY_FORMAT_INDEX is in the format mask, then it means that an index array will be allocated and "index_array_len" must be passed. - - - - - - - Return the amount of surfaces that the [Mesh] holds. - - - - - - - Remove a surface at position surf_idx, shifting greater surfaces one surf_idx slot down. - - - - - - - - - - - - - Set a surface array, array must be defined in the format (see [method add_surface]), and which array being set in "data" must be indicated passing a value from the ARRAY_* enum (NOT THE ARRAY_FORMAT_ enum!!). A Mesh can't be displayed (error will be reported) if an array that is present in the format was not set. - - - - - - - - - Return a surface array, array must be defined in the format (see [method add_surface]), and which array being returned must be indicated passing a value from the ARRAY_* enum (NOT THE ARRAY_FORMAT_ enum!!) (see [method add_surface]). - - - - - - - - - Return the length in vertices of the vertex array in the requested surface (see [method add_surface]). - - - - - - - - - Return the length in indices of the index array in the requested surface (see [method add_surface]). - - - - - - - - - Return the format mask of the requested surface (see [method add_surface]). - - - - - - - - - Return the primitive type of the requested surface (see [method add_surface]). - - - - - - - - - Set a [Material] for a given surface. Surface will be rendered using this material. - - - - - - - - - Return a [Material] in a given surface. Surface is rendered using this material. - - - - - - Render array as lines (every two vertices a line is created). - - - - - - - Amount of weights/bone indices per vertex (always 4). - - - Array format will include vertices (mandatory). - - - Vertex array (array of [Vector3]() vertices). - - - Render array as points (one vertex equals one point). - - - Array format will include bone indices. - - - Array format will include a color array. - - - Array of bone indices, as a float array. Each element in groups of 4 floats. - - - Vertex array (array of [Color]() colors). - - - Index array will be used. - - - Array of integers, used as indices referencing vertices. No index can be beyond the vertex array size. - - - Render array as triangle strips. - - - Array format will include tangents - - - Array format will include normals - - - Tangent array, array of groups of 4 floats. first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. - - - Normal array (array of [Vector3]() normals). - - - Render array as triangles (every three vertices a triangle is created). - - - Render array as line loop (like line strip, but closed). - - - Render array as line strip. - - - Array format will include bone weights. - - - Array format will include UVs. - - - Array of bone weights, as a float array. Each element in groups of 4 floats. - - - UV array (array of [Vector3]() UVs or float array of groups of 2 floats (u,v)). - - - Render array as triangle fans. - - - Default value used for index_array_len when no indices are present. - - - - - - Node that instances meshes into a [Scenario]. - - - MeshInstance is a [Node] that takes a [Mesh] resource and adds it to the current [Scenario] by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a sigle [Mesh] in many places. This allows to reuse geometry and save on resources. When a [Mesh] has to be instanced more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance] instead. - - - - - - - Set the [Mesh] resource for the instance. - - - - - - - Return the current [Mesh] resource for the instance. - - - - - - - Return the AABB of the mesh, in local coordinates. - - - - - This helper creates a [StaticBody] child [Node] using the mesh geometry as collision. It's mainly used for testing. - - - - - - - - - Soon to be removed, bye bye. - - - - - - - - - - - Provides high perfomance mesh instancing. - - - MultiMesh provides low level mesh instancing. If the amount of [Mesh] instances needed goes from hundreds to thousands (and most need to be visible at close proximity) creating such a large amount of [MeshInstance] nodes may affect performance by using too much CPU or video memory. [html br/]For this case a MultiMesh becomes very useful, as it can draw thousands of instances with little API overhead.[html br/] As a drawback, if the instances are too far away of each other, performance may be reduced as every sigle instance will always rendered (they are spatially indexed as one, for the whole object).[html br/] Since instances may have any behavior, the AABB used for visibility must be provided by the user, or generated with [method generate_aabb]. - - - - - - - Set the [Mesh] resource to be drawn in multiple instances. - - - - - - - Return the [Mesh] resource drawn as multiple instances. - - - - - - - Set the amount of instnces that is going to be drawn. Changing this number will erase all the existing instance transform and color data. - - - - - - - Return the amount of instnces that is going to be drawn. - - - - - - - - - Set the transform for a specific instance. - - - - - - - - - Return the transform of a specific instance. - - - - - - - - - Set the color of a specific instance. - - - - - - - - - Get the color of a specific instance. - - - - - - - Set the visibility AABB. If not provided, MultiMesh will not be visible. - - - - - - - Return the visibility AABB. - - - - - Generate a new visibility AABB, using mesh AABB and instance transforms. Since instance information is stored in the [VisualServer], this function is VERY SLOW and must NOT be used often. - - - - - - - - - Node that instances a [MultiMesh]. - - - MultiMeshInstance is a [Node] that takes a [MultiMesh] resource and adds it to the current [Scenario] by creating an instance of it (yes, this is an instance of instances). - - - - - - - Set the [MultiMesh] to be instance. - - - - - - - Return the [MultiMesh] that is used for instancing. - - - - - - - - - Base class for all the "Scene" elements. - - - Nodes can be set as children of other nodes, resulting in a tree arrangement. Any tree of nodes is called a "Scene".[html br/] Scenes can be saved to disk, and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of the projects. Scenes become "active" and part of the "Scene Tree" once they are added as children of a [RootNode].[html br/][html br/] As an illustrative example, a Scene (tree of nodes): [html div align="center"][html img src="images/scene.png"/][html /div] This scene will was edited separatedly, then is added as part of a game (by instancing it), becoming part of a "Scene Tree": [html div align="center"][html img src="images/scene_tree.png"/][html /div] In short, nodes are an effective all-in-one way to create and organize assets, gameplay and game data. When a Node is freed (deleted), it will delete all its children nodes. TODO: explain better process/signal/group call ordering - - - - - - - Set the name of the [Node]. Name must be unique within parent, and setting an already existing name will cause for the node to be automatically renamed. - - - - - - - Return the name of the [Node]. Name is be unique within parent. - - - - - - - Add a child [Node]. Nodes can have as many children as they want, but every child must have a unique name. Children nodes are automatically deleted when the parent node is deleted, so deleting a whole scene is performed by deleting its topmost node. - - - - - - - Remove a child [Node]. Node is NOT deleted and will have to be deleted manually. - - - - - - - Return the amount of children nodes. - - - - - - - - - Return a children node by it's index (see [method get_child_count]). This method is often used for iterating all children of a node. - - - - - - - - - - - - - - - - - Fetch a node. "path" must be valid (or else error will occur) and can be either the name of a child node, a relative path (from the current node to another node), or an absolute path to a node.[html br/] Examples ofa paths are: get_node("Sword") , get_node("../Swamp/Alligator") , get_node("/MyGame"). [html br/]Note: fetching absolute paths only works when the node is inside the scene tree (see [method is_inside_tree]). - - - - - - - Return the parent [Node] of the current [Node], or an empty Object if the node lacks a parent. - - - - - - - - - - - - - - - Return [html i]true[html /i] if the "node" argument is a direct or indirect child of the current node, otherwise return [html i]false[html /i]. - - - - - - - - - Return [html i]true[html /i] if "node" occurs later in the scene hierarchy than the current node, otherwise return [html i]false[html /i]. - - - - - - - Return the absolute path of the current node. This only works if the curent node is inside the scene tree (see [method is_inside_tree]). - - - - - - - - - Return the relative path from the current node to the specified node in "node" argument. Both nodes must be in the same scene, or else the function will fail. - - - - - - - - - Add a node to a group. Groups are helpers to name and organize group of nodes, like for example: "Enemies" "Collectables", etc. A [Node] can be in any number of groups. Nodes can be assigned a group at any time, but will not be added to it until they are inside the scene tree (see [method is_inside_tree]). - - - - - - - Remove a node from a group. - - - - - - - - - Move a child node to a different position (order) amongst the other children. Since calls, signals, etc are performed by tree order, changing the order of chilren nodes may be useful. - - - - - 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. - - - - - - - Set the node owner. A node can have any other node as owner (as long as a valid parent, grandparent, etc ascending in the tree). When saving a node (using SceneSaver) all the nodes it owns will be saved with it. This allows to create complex SceneTrees, with instancing and subinstancing. - - - - - - - Get the node owner (see [method set_node_owner]). - - - - - Remove a node and set all its children as childrens of the parent node (if exists). All even subscriptions that pass by the removed node will be unsubscribed. - - - - - - - Get the node index in the parent (assuming it has a parent). - - - - - Print the screne to stdout. Used mainly for debugging purposes. - - - - - - - A node can contain a filename. This filename should not be changed by the user, unless writing editors and tools. When a scene is instanced from a file, it topmost node contains the filename from where it was loaded. - - - - - - - Return a filename that may be containedA node can contained by the node. When a scene is instanced from a file, it topmost node contains the filename from where it was loaded (see [method set_filename]). - - - - - - - Notify the current node and all its chldren recursively by calling notification() in all of them. - - - - - - - Enables or disables node processing. When a node is being processed, it will receive a NOTIFICATION_PROCESS on every frame. It is common to check how much time was elapsed since the previous frame by calling [method get_process_time]. If the application is set to run at 60 fps, NOTIFICATION_PROCESS will be received 60 times per second (even if the visuals are running at faster or lower fps). Because of this, nodes that wish to do processing are recommended to use [method set_idle_process] instead, unless strong syncronization is requiered (for example, to modify the behavior of physics objects). - - - - - - - Return the amount of time elapsed (in seconds) between two succesive NOTIFICATION_PROCESS notifications. - - - - - - - Return wether processing is enabled in the current node. - - - - - - - Enables or disables node idle processing. When a node is being idle-processed, it will receive a NOTIFICATION_IDLE_PROCESS when idle. It is common to check how much time was elapsed since the previous idle time by calling [method get_idle_process_time]. Idle processing is commonly syncronized to [VisualServer] being done rendering a frame, so this type of processing is syncronized to the visible frames per second. To syncronize with the desired frames per second, see [method set_process] instead. - - - - - - - Return the amount of time elapsed (in seconds) between two succesive NOTIFICATION_IDLE_PROCESS notifications. - - - - - - - Return wether idle processing is enabled in the current node. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Return a duplicate of the scene, with all nodes and parameters copied. Subscriptions will not be duplicated. - - - - - - - - - Replace a node in a scene by a given one. Subscriptions that pass through this node will be lost. - - - - - - - - - - - - - - - - - - - - - - - - Notification received when a node is unparented (parent removed it from the list of children). - - - - - Notification received every frame when the process flag is set (see [method set_process]). - - - - - - - - - - - - - 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. - - - - - Notification received every time the application enters idle when the idle process flag is set (see [method set_process]). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OmniDirectional Light, such as a lightbulb or a candle. - - - An OmniDirectional light is a type of [Light] node that emits lights in all directions. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. TODO: Image of an omnilight. - - - - - - - - - Button control that provides selectable options when pressed. - - - OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text. - - - - - - - - - Add an item, with text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end. - - - - - - - - - - - Add an item, with a "texture" icon, text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end. - - - - - - - - - Set the text of an item at index "idx". - - - - - - - - - Set the icon of an item at index "idx". - - - - - - - - - - - - - - - - - Set the ID of an item at index "idx". - - - - - - - - - - - - - - - - - Return the text of the item at index "idx". - - - - - - - - - Return the icon of the item at index "idx". - - - - - - - - - Return the ID of the item at index "idx". - - - - - - - - - - - - - - - - - - - - - Return the amount of items in the OptionButton. - - - - - 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. - - - - - Clear all the items in the [OptionButton]. - - - - - - - Select an item by index and make it the current item. - - - - - - - Return the current item index - - - - - - - - - - - - - - - - - - - This signal is emitted when the current item was changed by the user. ID of the item selected is passed as argument (if no IDs were added, ID will be just the item index). - - - - - - - - - Abstraction and base class for packet-based protocols. - - - PacketPeer is an abstration and base class for packet-based protocols (such as UDP). It provides an API for sending and receiving packets both as raw data or variables. This makes it easy to transfer data over a protocol, without having to encode data as low level bytes or having to worry about network ordering. - - - - - - - - - Wrapper to use a PacketPeer over a StreamPeer. - - - 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. - - - - - - - Set the StreamPeer object to be wrapped - - - - - - - - - Provides an opaque background for [Control] children. - - - Panel is a [Control] that displays an opaque background. It's commoly used as a parent and container for other types of [Control] nodes. [html div align="center"][html img src="images/panel_example.png"/][html /div] - - - - - - - - - Particle system 3D Node - - - Particles is a particle system 3D [Node] that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility AABB (although helpers to create one automatically exist). - - - - - - - Set total amount of particles in the system. - - - - - - - Return the total amount of particles in the system. - - - - - - - Set the "emitting" property state. When emitting, the particle system generates new particles at constant rate. - - - - - - - Return the "emitting" property state (see [method set_emitting]). - - - - - - - Set the visibility AABB for the particle system, since the default one will not work properly most of the time. - - - - - - - Return the current visibility AABB. - - - - - - - Set the half extents for the emission box. - - - - - - - Return the half extents for the emission box. - - - - - - - - - - - - - - - - - - - Set the normal vector towards where gravity is pulling (by default, negative Y). - - - - - - - Return the normal vector towards where gravity is pulling (by default, negative Y). - - - - - - - - - Set a specific variable for the particle system (see VAR_* enum). - - - - - - - - - Return a specific variable for the particle system (see VAR_* enum). - - - - - - - - - Set the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted. - - - - - - - - - Return the randomness for a specific variable of the particle system. Randomness produces small changes from the default each time a particle is emitted. - - - - - - - - - Set the position of a color phase (0 to 1) - - - - - - - - - Return the position of a color phase (0 to 1) - - - - - - - - - Set the color of a color phase. - - - - - - - - - Return the color of a color phase. - - - - - - - Set the material used to draw particles - - - - - - - Return the material used to draw particles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Base class for differnt types of Physics bodies. - - - PhysicsBody is an abstract base class for implementing a physics body. All PhysicsBody types inherit from it. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Base container control for popups and dialogs. - - - PopUp is a base [Control] used to show dialogs and popups. It's a subwindow and modal by default (see [Control]) and has helpers for custom popup behavior. - - - - - - - Popup (show the control in modal form) in the center of the screen, at the curent size, or at a size determined by "size". - - - - - - - Popup (show the control in modal form) in the center of the screen, scalled at a ratio of size of the screen. - - - - - Popup (show the control in modal form). - - - - - - - - - - - - - - - - - - - This signal is emitted when a popup is about to be shown. (often used in [PopupMenu] for clearing the list of options and creating a new one according to the current context). - - - - - - - - - - - - - - - - - - - PopupMenu displays a list of options. - - - PopupMenu is the typical Control that displays a list of options. They are popular in toolbars or context menus. - - - - - - - - - - - - - Add a new item with text "label" and icon "texture. An id can optonally be provided, as well as an accelerator. If no id is provided, one will be created from the index. - - - - - - - - - - - Add a new item with text "label". An id can optonally be provided, as well as an accelerator. If no id is provided, one will be created from the index. - - - - - - - - - - - - - Add a new checkable item with text "label" and icon "texture. An id can optonally 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". An id can optonally 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. - - - - - - - - - Set the text of the item at index "idx". - - - - - - - - - Set the icon of the item at index "idx". - - - - - - - - - Set the accelerator of the item at index "idx". Accelerators are special combinations of keys that activate the item, no matter which control is fucused. - - - - - - - - - - - - - - - - - Set the checkstate status of the item at index "idx". - - - - - - - - - - - - - - - - - Set the id of the item at index "idx". - - - - - - - - - Return the text of the item at index "idx". - - - - - - - - - Return the icon of the item at index "idx". - - - - - - - - - - - - - - - Return the accelerator of the item at index "idx". Accelerators are special combinations of keys that activate the item, no matter which control is fucused. - - - - - - - - - Return the checkstate status of the item at index "idx". - - - - - - - - - - - - - - - - - Return the id of the item at index "idx". - - - - - - - - - Find and return the index of the item containing a given id. - - - - - - - Return the amount of items. - - - - - Add a separator between items. Separators also occupy an index. - - - - - Clear the popup menu. - - - - - - - - - This even is emitted when an item is pressed or its accelerator is activated. The id of the item is returned if it exists, else the index. - - - - - - - - - - - - - - - - - - - Portals provide virtual openings to rooms. - - - Portals provide virtual openings to [RoomInstance] 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 [RoomInstance]. 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 [RoomInstance], 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 [RoomInstance] node as a parent, grandparent or far parent, or else they will not be active. - - - - - - - Set the portal shape. The shape is an array of [Point2] points, representing a convex polygon in the X,Y plane. - - - - - - - Return the portal shape. The shape is an array of [Point2] points, representing a convex polygon in the X,Y plane. - - - - - - - Enable the portal (it is enabled by defaul though), disabling it will cause the parent [RoomInstance] to not be visible any longer when looking through the portal. - - - - - - - Return wether the portal is active. When disabled it causes the parent [RoomInstance] to not be visible any longer when looking through the portal. - - - - - - - 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]). - - - - - - - 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]). - - - - - - - When the portal goes beyond the disable distance (see [method set_disable_distance]), it becomes opaque and displayed with color "color". - - - - - - - Return the color for when the portal goes beyond the disable distance (see [method set_disable_distance]) and becomes disabled. - - - - - - - Set the range for auto-connecting two portals from different rooms sharing the same space. - - - - - - - Return the range for auto-connecting two portals from different rooms sharing the same space. - - - - - - - - - Abstract base class for range-based controls. - - - Range is a base class for [Control] nodes that change a floating point [html i]value[html /i] between a need a [html i]minimum[html /i], [html i]maximum[html /i], using [html i]step[html /i] and [html i]page[html /i], for example a [ScrollBar]. - - - - - - - Return the current value. - - - - - - - Return the minimum value. - - - - - - - Return the maximum value. - - - - - - - Return the stepping, if step is 0, stepping is disabled. - - - - - - - Return the page size, if page is 0, paging is disabled. - - - - - - - Return value mapped to 0 to 1 (unit) range. - - - - - - - - - - - - - Set minimum value, clamped range value to it if it's less. - - - - - - - - - - - - - Set step value. If step is 0, stepping will be disabled. - - - - - - - Set page size. Page is mainly used for scrollbars or anything that controls text scrolling. - - - - - - - Set value mapped to 0 to 1 (unit) range, it will then be converted to the actual value within min and max. - - - - - - - - - - - - - - - - - - - This signal is emitted when value changes. - - - - - This signal is emitted when min, max, range or step change. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Base class for all resources. - - - Resource is the base class for all resource types. Resources are primarily data containers. They are reference counted and freed when no longer in use. They are also loaded only once from disk, and further attempts to load the resource will return the same reference (all this in contrast to a [Node], which is not reference counted and can be instanced from disk as many times as desred). Resources can be saved externally on disk or bundled into another object, such as a [Node] or another resource. - - - - - - - Set the path of the resource. This is useful mainly for editors when saving/loading, and shouldn't be changed by anything else. - - - - - - - Return the path of the resource. This is useful mainly for editors when saving/loading, and shouldn't be changed by anything else. - - - - - - - Set the name of the resources, any name is ok (it doesn't have to be unique). Name is for descriptive purposes only. - - - - - - - Return the name of the resources, any name is ok (it doesn't have to be unique). Name is for descriptive purposes only. - - - - - - - Return the RID of the resource (or an empty RID). Many resources (such as [Texture], [Mesh], etc) are high level abstractions of resources stored in a server, so this function will return the original RID. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Room data resource. - - - Room contains the data to define the bounds of a scene (using a BSP Tree). It is instanced by a [RoomInstance] node to create rooms. See that class documentation for more information about rooms. - - - - - - - Set the bounds of the room as a BSP tree. a BSP Tree is defined a Dictionary: (TODO - see source code on how to create a BSP tree from a dictionary). - - - - - - - Return the bounds of the room as a BSP tree. a BSP Tree is defined a Dictionary: (TODO - see source code on how to create a BSP tree from a dictionary). - - - - - - - Set the "geometry" hint of the room. This means, how the room actually looks (an array of [Vector3]s, forming triangles). - - - - - - - Return the "geometry" hint of the room. This means, how the room actually looks (an array of [Vector3]s, forming triangles). - - - - - - - - - Node that instances a Room. - - - RoomInstance is a [Node] that instances a [Room] resource and places it on the world. Rooms are used for defining the areas taken up by [html i]interiors[html /i]. An [html i]interior[html /i] is any closed space that has an entrance/exit (or not) to the outside world, for example the inside of a house, a room in a house, a cave.[html br/]So why is this used? Rooms and Portals ([Portal]) are a common visualization optimization technique, it is used to make interiors invisible (not rendered) when the camera is at the exterior (such as an open field), and also the exterior invisible when inside an interior (such as a house). It is also used to make interior rooms invisible from other interior rooms. [html div align="center"][html img src="images/portals_example.png"/][html /div] - - - - - - - Set the [Room] resource, containing the room bounds. - - - - - - - Return the [Room] resource, containing the room bounds. - - - - - This helper function computes a [Room] from the shapes of all the children [VisualInstance] nodes, and sets it to the node. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Audio Sample (sound) class. - - - Sample provides an audio sample class, containing audio data, together with some information for playback, such as format, mix rate and loop. It is used by sound playback routines. - - - - - - - - - - - Create new data for the sample, with format "format" (see FORMAT_* enum), stereo hint, and length in frames (not samples or bytes!) "frame". Calling create overrides previous existing data if it exists. Stereo samples are interleaved pairs of left and right (in that order) points - - - - - - - Return the sample format (see FORMAT_* enum). - - - - - - - Return true if the sample was created stereo. - - - - - - - Return the sample length in frames. - - - - - - - Set sample data. Data must be little endian, no matter the host platform, and exactly as long to fit all frames. Example, if data is Stereo, 16 bits, 256 frames, it will be 1024 bytes long. - - - - - - - Return sample data. Data will be endian, no matter with the host platform, and exactly as long to fit all frames. Example, if data is Stereo, 16 bits, 256 frames, it will be 1024 bytes long. - - - - - - - Set the mix rate for the sample (expected playback frequency). - - - - - - - Return the mix rate for the sample (expected playback frequency). - - - - - - - Set the loop format, see LOOP_* enum - - - - - - - Return the loop format, see LOOP_* enum. - - - - - - - Set the loop begin position, it must be a valid frame and less than the loop end position. - - - - - - - Return the loop begin position. - - - - - - - Set the loop end position, it must be a valid frame and greater than the loop begin position. - - - - - - - Return the loop begin position. - - - - - - Ima-ADPCM Audio. - - - Forward looping (when playback reaches loop end, goes back to loop begin) - - - 16-Bits signed little endian PCM audio. - - - 8-Bits signed little endian PCM audio. - - - No loop enabled. - - - Ping-Pong looping (when playback reaches loop end, plays backward untilloop begin). Not available in all platforms. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sample Player node. - - - SamplePlayer is a [Node] meant for simple sample playback. A library of samples is loaded and played back "as is", without positioning or anything. - - - - - - - - - - - - - - - - - - - Set the amount of simultaneous voices that will be used for playback. - - - - - - - Return the amount of simultaneous voices that will be used for playback. - - - - - - - - - - - Play back sample, given it's identifier "name". if "unique" is true, all othere previous samples will be stopped. The voice allocated for playback will be returned. - - - - - - - Stop a voice "voice". (see [method play]). - - - - - - - - - - - - - Change the mix rate of a voice "voice" to given "hz". - - - - - - - - - Scale the pitch (mix rate) of a voice by a ratio value "ratio". A ratio of 1.0 means the voice is unscaled. - - - - - - - - - Set the volume of a voice, 0db is maximum volume (every about -6db, volume is reduced in half). "db" does in fact go from zero to negative. - - - - - - - - - - - - - - - - - - - - - Set the panning of a voice. Panning goes from -1 (left) to +1 (right). Optionally, if the hardware supports 3D sound, also set depth and height (also in range -1 to +1). - - - - - - - - - - - - - - - Set and enable a filter of a voice, with type "type" (see FILTER_* enum), cutoff (0 to 22khz) frequency and resonance (0+). - - - - - - - - - Set the chorus send level of a voice (0 to 1). For setting chorus parameters, see [AudioServer]. - - - - - - - - - - - Set the reverb send level and type of a voice (0 to 1). (see REVERB_* enum for type). - - - - - - - - - Return the current mix rate for a given voice. - - - - - - - - - Return the current pitch scale for a given voice. - - - - - - - - - Return the current volume (in db) for a given voice. 0db is maximum volume (every about -6db, volume is reduced in half). "db" does in fact go from zero to negative. - - - - - - - - - - - - - - - - - Return the current panning for a given voice. Panning goes from -1 (left) to +1 (right). - - - - - - - - - Return the current pan depth for a given voice (not used unless the hardware supports 3D sound) - - - - - - - - - Return the current pan height for a given voice (not used unless the hardware supports 3D sound) - - - - - - - - - Return the current filter type in use (see FILTER_* enum) for a given voice. - - - - - - - - - Return the current filter cutoff for a given voice. Cutoff goes from 0 to 22khz. - - - - - - - - - Return the current filter resonance for a given voice. Resonance goes from 0 up. - - - - - - - - - - - - - - - - - Return the current chorus send level for a given voice. (0 to 1). - - - - - - - - - Return the current reverb room type for a given voice (see REVERB_* enum). - - - - - - - - - Return the current reverb send level for a given voice. (0 to 1). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HighPass filter is used for voice. - - - Filter is disabled for voice. - - - Huge reverb room (cathedral, warehouse). - - - Medium reverb room (street) - - - Small reverb room (house room). - - - - - - - Lowpass filter is used for voice. - - - Large reverb room (Theather) - - - - - Band-Limit filter is used for voice, in this case resonance is the highpass cutoff. - - - Notch filter is used for voice. - - - Bandpass filter is used for voice. - - - - - - - - Deprecated, will go away. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Base class for scroll bars. - - - Scrollbars are a [Range] based [Control], that display a draggable area (the size of the page). Horizontal ([HScrollBar]) and Vertical ([VScrollBar]) versions are available. - - - - - - - - - Base class for separators. - - - Separator is a [Control] used for sepataring other controls. It's purely a visual decoration. Horizontal ([HSeparator]) and Vertical ([VSeparator]) versions are available. - - - - - - - - - To be changed, ignore. - - - To be changed, ignore. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Skeleton for characters and animated objects. - - - Skeleton provides a hierachial interface for managing bones, including pose, rest and animation (see [Animation]). Skeleton will support rag doll dynamics in the future. - - - - - - - Add a bone, with name "name". [method get_bone_count] will become the bone index. - - - - - - - - - Return the bone index that matches "name" as its name. - - - - - - - - - Return the name of the bone at index "index" - - - - - - - - - Return the bone index which is the parent of the bone at "bone_idx". If -1, then bone has no parent. Note that the parent bone returned will always be less than "bone_idx". - - - - - - - - - Set the bone index "parent_idx" as the parent of the bone at "bone_idx". If -1, then bone has no parent. Note: "parent_idx" must be less than "bone_idx". - - - - - - - Return the amount of bones in the skeleton. - - - - - - - - - Return the rest transform for a bone "bone_idx". - - - - - - - - - Set the rest transform for bone "bone_idx" - - - - - - - - - Deprecated soon - - - - - - - - - Deprecated soon - - - - - - - - - Deprecated Soon - - - - - Clear all the bones in this skeleton. - - - - - - - - - Return the pose transform for bone "bone_idx". - - - - - - - - - Return the pose transform for bone "bone_idx". - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Base class for all 3D nodes. - - - 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. - - - - - - - Set the transform locally, relative to the parent spatial node. - - - - - - - Return the local transform, relative to the bone parent. - - - - - - - Set the transform globally, relative to worldspace. - - - - - - - Return the gloal transform, relative to worldspace. - - - - - - - Return the parent [Spatial], or an empty [Object] if no parent exists or parent is not of type [Spatial. - - - - - - - - - - Spatial nodes receive this notification when the viewport next to it in ascending hierarchy changed the [Scenario]. - - - Spatial nodes receive this notifacation with their global transform changes. This means that either the current or a parent node changed it's transform. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Spotlight Light, such as a reflector spotlight or a latern. - - - A SpotLight light is a type of [Light] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. TODO: Image of a spotlight. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Squirrel script language support. - - - [html a href="http://squirrel-lang.org/"]Squirrel Language[html /a] support for the engine. Allows to load a [Script] from a .sq or .nut source or compiled file, or bundled it into scenes. - - - - - - - - - PhysicsBody for static collision objects. - - - StaticBody implements a static collision [Node], by utilizing a rigid body in the [PhysicsServer]. Static bodies are used for static collision. For more information on physics body nodes, see [PhysicsBody]. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Abstraction and base class for stream-based protocols. - - - StreamPeer is an abstration and base class for stream-based protocols (such as TCP or Unix Sockets). It provides an API for sending and receiving data through streams as raw data or strings. - - - - - - - - - Send a chunk of data through the connection, blocking if necesary until the data is done sending. This function returns an [Error] code. - - - - - - - - - Send a chunk of data through the connection, if all the data could not be sent at once, only part of it will. This function returns two values, an [Error] code and an integer, describing how much data was actually sent. - - - - - - - - - Return a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will block until the desired amount is received. This function returns two values, an [Error] code and a data array. - - - - - - - - - Return a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will return how many were actually received. This function returns two values, an [Error] code, and a data array. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Base class for dawing stylized boxes for the UI. - - - StyleBox is [Resource] that provides an abstract base class for dawing stylized boxes for the UI. StyleBoxes are used for dawing the styles of buttons, line edit backgrounds, tree backgrounds, etc. and also for testing a transparency mask for pointer signals. If mask test fails on a StyleBox assigned as mask to a control, clicks and motion signals will go through it to the one below. - - - - - - - - - - - Test a position in a rectangle, return wether it pases the mask test. - - - - - - - - - Set the default offset "offset" of the margin "margin" (see MARGIN_* enum) for a StyleBox, Controls that draw styleboxes with context inside need to know the margin, so the border of the stylebox is not occluded. - - - - - - - - - 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. - - - - - - - - - Return the offset of margin "margin" (see MARGIN_* enum). - - - - - - - Return the minimum size that this stylebox can be shrunk to. - - - - - - - Return the "offset" of a stylebox, this is a helper function, like writing Point2( style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP) ) - - - - - - - - - Empty stylebox (does not display anything). - - - Empty stylebox (really does not display anything). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Image mask based StyleBox, for mask test. - - - This StyleBox is similar to [StyleBoxTexture], but only meant to be used for mask testing. It takes an image and applies stretch rules to determine if the poit clicked is masked or not. - - - - - - - Set the image used for mask testing. Pixels (converted to grey) that have a value, less than 0.5 will fail the test. - - - - - - - Return the image used for mask testing. (see [method set_imag]). - - - - - - - Set the expand property (default). When expanding, the image will use the same rules as [StyleBoxTexture] for expand. If not expanding, the image will always be tested at its original size. - - - - - - - Return wether the expand property is set(default). When expanding, the image will use the same rules as [StyleBoxTexture] for expand. If not expanding, the image will always be tested at its original size. - - - - - - - - - Set an expand margin size (from enum MARGIN_*). Parts of the image below the size of the margin (and in the direction of the margin) will not expand. - - - - - - - - - Return the expand margin size (from enum MARGIN_*). Parts of the image below the size of the margin (and in the direction of the margin) will not expand. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Vertical version of [ScrollBar], which goes from left (min) to right (max). - - - - - - - - - - - Vertical version of [Separator]. - - - Vertical version of [Separator]. It is used to separate objects horizontally, though (but it looks vertical!). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/docdump/main.css b/tools/docdump/main.css deleted file mode 100644 index a76e6bbed89..00000000000 --- a/tools/docdump/main.css +++ /dev/null @@ -1,146 +0,0 @@ -BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV, SPAN { - font-family: Arial, Geneva, Helvetica, sans-serif; -} - -a { - - text-decoration: none; - -} - -a:hover { - - text-decoration: underline; -} - -td.top_table { - - padding: 5px; -} - -div.method_doc { - - padding-bottom: 30px; -} - -div.method_description { - margin-left: 30px; -} - -list.inh_class_list { - margin-left: 30px; - -} - -div.inh_class_list { - margin-left: 30px; - -} - -div.method_doc div.method { - - font-size: 12pt; - font-weight: bold; -} - -span.funcdecl { - - color: #202060; -} - -span.funcdef { - - color: #202060; -} - - -span.qualifier { - - font-weight: bold; -} - - -span.symbol { - - /*font-weight: bold;*/ - color: #471870; -} - - -span.datatype { - - color: #6a1533; -} - -tr.category_title { - - background-color: #333333; -} -a.category_title { - font-weight: bold; - color: #FFFFFF; -} - -div.method_list { - - margin-left: 30px; -} - -div.constant_list { - - margin-left: 30px; -} - -div.member_list { - - margin-left: 30px; -} - -div.description { - - margin-left: 30px; -} - -div.class_description { - - margin-left: 30px; -} - -div.method_list li div { - - display: inline; -} - -div.member_list li div.member { - - display: inline; -} - -div.constant_list li div.constant { - - display: inline; -} - -span.member_description { - - font-style: italic; - color: grey; -} - -span.constant_description { - - font-style: italic; - color: grey; -} - -span.identifier { - - font-weight: bold; -} - - -table.class_table td { - - vertical-align: top; -} - diff --git a/tools/editor/array_property_edit.cpp b/tools/editor/array_property_edit.cpp index 9cd443270b8..64a2762095b 100644 --- a/tools/editor/array_property_edit.cpp +++ b/tools/editor/array_property_edit.cpp @@ -209,6 +209,15 @@ void ArrayPropertyEdit::edit(Object* p_obj,const StringName& p_prop,Variant::Typ } +Node *ArrayPropertyEdit::get_node() { + + Object *o = ObjectDB::get_instance(obj); + if (!o) + return NULL; + + return o->cast_to(); +} + void ArrayPropertyEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("_set_size"),&ArrayPropertyEdit::_set_size); diff --git a/tools/editor/array_property_edit.h b/tools/editor/array_property_edit.h index acfb8e68ede..948b2a71a38 100644 --- a/tools/editor/array_property_edit.h +++ b/tools/editor/array_property_edit.h @@ -30,6 +30,8 @@ public: void edit(Object* p_obj, const StringName& p_prop, Variant::Type p_deftype); + Node *get_node(); + ArrayPropertyEdit(); }; diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index a6aedf27063..e9f9e09acd8 100644 --- a/tools/editor/editor_data.cpp +++ b/tools/editor/editor_data.cpp @@ -31,6 +31,9 @@ #include "editor_settings.h" #include "os/dir_access.h" #include "io/resource_loader.h" +#include "scene/resources/packed_scene.h" +#include "os/file_access.h" +#include "editor_node.h" void EditorHistory::_cleanup_history() { @@ -493,6 +496,93 @@ void EditorData::remove_scene(int p_idx){ edited_scene.remove(p_idx); } + +bool EditorData::_find_updated_instances(Node* p_root,Node *p_node,Set &checked_paths) { + + if (p_root!=p_node && p_node->get_owner()!=p_root && !p_root->is_editable_instance(p_node->get_owner())) + return false; + + Ref ss; + + if (p_node==p_root) { + ss=p_node->get_scene_inherited_state(); + } else if (p_node->get_filename()!=String()){ + ss=p_node->get_scene_instance_state(); + } + + if (ss.is_valid()) { + String path = ss->get_path(); + + if (!checked_paths.has(path)) { + + uint64_t modified_time = FileAccess::get_modified_time(path); + if (modified_time!=ss->get_last_modified_time()) { + return true; //external scene changed + } + + checked_paths.insert(path); + } + + } + + for(int i=0;iget_child_count();i++) { + + bool found = _find_updated_instances(p_root,p_node->get_child(i),checked_paths); + if (found) + return true; + } + + return false; +} + + +bool EditorData::check_and_update_scene(int p_idx) { + + ERR_FAIL_INDEX_V(p_idx,edited_scene.size(),false); + if (!edited_scene[p_idx].root) + return false; + + Set checked_scenes; + + + bool must_reload = _find_updated_instances(edited_scene[p_idx].root,edited_scene[p_idx].root,checked_scenes); + + if (must_reload) { + Ref pscene; + pscene.instance(); + + EditorProgress ep("update_scene","Updating Scene",2); + ep.step("Storing local changes..",0); + //pack first, so it stores diffs to previous version of saved scene + Error err = pscene->pack(edited_scene[p_idx].root); + ERR_FAIL_COND_V(err!=OK,false); + ep.step("Updating scene..",1); + Node *new_scene = pscene->instance(true); + ERR_FAIL_COND_V(!new_scene,false); + + //transfer selection + List new_selection; + for (List::Element *E=edited_scene[p_idx].selection.front();E;E=E->next()) { + NodePath p = edited_scene[p_idx].root->get_path_to(E->get()); + Node *new_node = new_scene->get_node(p); + if (new_node) + new_selection.push_back(new_node); + } + + new_scene->set_filename( edited_scene[p_idx].root->get_filename() ); + + memdelete(edited_scene[p_idx].root); + edited_scene[p_idx].root=new_scene; + edited_scene[p_idx].selection=new_selection; + + return true; + + } + + return false; + +} + int EditorData::get_edited_scene() const { return current_edited_scene; diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h index a90a071c39e..51af7d41bdd 100644 --- a/tools/editor/editor_data.h +++ b/tools/editor/editor_data.h @@ -144,6 +144,8 @@ private: Vector edited_scene; int current_edited_scene; + bool _find_updated_instances(Node* p_root,Node *p_node,Set &checked_paths); + public: EditorPlugin* get_editor(Object *p_object); @@ -193,6 +195,7 @@ public: void clear_edited_scenes(); void set_edited_scene_live_edit_root(const NodePath& p_root); NodePath get_edited_scene_live_edit_root(); + bool check_and_update_scene(int p_idx); void set_plugin_window_layout(Ref p_layout); diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp index a8421acff86..1f3b5eed652 100644 --- a/tools/editor/editor_dir_dialog.cpp +++ b/tools/editor/editor_dir_dialog.cpp @@ -205,31 +205,36 @@ void EditorDirDialog::_bind_methods() { EditorDirDialog::EditorDirDialog() { + updating=false; + set_title("Choose a Directory"); + set_hide_on_ok(false); + tree = memnew( Tree ); add_child(tree); set_child_rect(tree); - updating=false; - get_ok()->set_text("Choose"); - set_hide_on_ok(false); - - + tree->connect("item_activated",this,"_ok"); makedir = add_button("Create Folder",OS::get_singleton()->get_swap_ok_cancel()?true:false,"makedir"); makedir->connect("pressed",this,"_make_dir"); makedialog = memnew( ConfirmationDialog ); makedialog->set_title("Create Folder"); + add_child(makedialog); + VBoxContainer *makevb= memnew( VBoxContainer ); makedialog->add_child(makevb); makedialog->set_child_rect(makevb); + makedirname = memnew( LineEdit ); makevb->add_margin_child("Name:",makedirname); - add_child(makedialog); makedialog->register_text_enter(makedirname); makedialog->connect("confirmed",this,"_make_dir_confirm"); + mkdirerr = memnew( AcceptDialog ); mkdirerr->set_text("Could not create folder."); add_child(mkdirerr); + get_ok()->set_text("Choose"); + } diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index 64b104334f7..b6c68d05be5 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -43,6 +43,7 @@ #include "tools/editor/plugins/script_editor_plugin.h" #include "io/zip_io.h" + String EditorImportPlugin::validate_source_path(const String& p_path) { String gp = Globals::get_singleton()->globalize_path(p_path); @@ -1081,12 +1082,14 @@ Error EditorExportPlatform::save_pack_file(void *p_userdata,const String& p_path Error EditorExportPlatform::save_zip_file(void *p_userdata,const String& p_path, const Vector& p_data,int p_file,int p_total) { + String path=p_path.replace_first("res://",""); + ZipData *zd = (ZipData*)p_userdata; zipFile zip=(zipFile)zd->zip; zipOpenNewFileInZip(zip, - p_path.utf8().get_data(), + path.utf8().get_data(), NULL, NULL, 0, diff --git a/tools/editor/editor_layout_dialog.cpp b/tools/editor/editor_layout_dialog.cpp index e37f263c0cd..d3a60f90ddf 100644 --- a/tools/editor/editor_layout_dialog.cpp +++ b/tools/editor/editor_layout_dialog.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* editor_node.cpp */ +/* editor_layout_dialog.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -35,6 +35,12 @@ void EditorLayoutDialog::clear_layout_name() { layout_name->clear(); } +void EditorLayoutDialog::_post_popup() { + + ConfirmationDialog::_post_popup(); + layout_name->grab_focus(); +} + void EditorLayoutDialog::ok_pressed() { if (layout_name->get_text()!="") { diff --git a/tools/editor/editor_layout_dialog.h b/tools/editor/editor_layout_dialog.h index 7e3b9e3d8a6..be9644f8aef 100644 --- a/tools/editor/editor_layout_dialog.h +++ b/tools/editor/editor_layout_dialog.h @@ -43,6 +43,7 @@ protected: static void _bind_methods(); virtual void ok_pressed(); + virtual void _post_popup(); public: void clear_layout_name(); diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 35404b0bbac..05df0a3e48c 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -955,7 +955,23 @@ void EditorNode::_save_scene(String p_file) { _set_scene_metadata(); - Ref sdata = memnew( PackedScene ); + + + Ref sdata; + + if (ResourceCache::has(p_file)) { + // something may be referencing this resource and we are good with that. + // we must update it, but also let the previous scene state go, as + // old version still work for referencing changes in instanced or inherited scenes + + sdata = Ref( ResourceCache::get(p_file)->cast_to() ); + if (sdata.is_valid()) + sdata->recreate_state(); + else + sdata.instance(); + } else { + sdata.instance(); + } Error err = sdata->pack(scene); @@ -1816,7 +1832,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) { } play_button->set_pressed(false); - play_button->set_icon(gui_base->get_icon("Play","EditorIcons")); + play_button->set_icon(gui_base->get_icon("MainPlay","EditorIcons")); //pause_button->set_pressed(false); play_scene_button->set_pressed(false); play_scene_button->set_icon(gui_base->get_icon("PlayScene","EditorIcons")); @@ -2688,7 +2704,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { editor_run.stop(); play_button->set_pressed(false); - play_button->set_icon(gui_base->get_icon("Play","EditorIcons")); + play_button->set_icon(gui_base->get_icon("MainPlay","EditorIcons")); play_scene_button->set_pressed(false); play_scene_button->set_icon(gui_base->get_icon("PlayScene","EditorIcons")); //pause_button->set_pressed(false); @@ -3414,8 +3430,18 @@ void EditorNode::set_current_version(uint64_t p_version) { bool EditorNode::is_changing_scene() const { return changing_scene; } + +void EditorNode::_clear_undo_history() { + + get_undo_redo()->clear_history(); +} + void EditorNode::set_current_scene(int p_idx) { + if (editor_data.check_and_update_scene(p_idx)) { + call_deferred("_clear_undo_history"); + } + changing_scene=true; editor_data.save_edited_scene_state(editor_selection,&editor_history,_get_main_scene_state()); @@ -4113,6 +4139,7 @@ void EditorNode::_bind_methods() { ObjectTypeDB::bind_method("_toggle_search_bar",&EditorNode::_toggle_search_bar); ObjectTypeDB::bind_method("_clear_search_box",&EditorNode::_clear_search_box); + ObjectTypeDB::bind_method("_clear_undo_history",&EditorNode::_clear_undo_history); ObjectTypeDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin); ObjectTypeDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index bd25f27c593..c4429f943b6 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -540,6 +540,7 @@ class EditorNode : public Node { void _toggle_search_bar(bool p_pressed); void _clear_search_box(); + void _clear_undo_history(); protected: void _notification(int p_what); diff --git a/tools/editor/editor_sub_scene.cpp b/tools/editor/editor_sub_scene.cpp index 2a6eba2554a..d7d79e5cc7c 100644 --- a/tools/editor/editor_sub_scene.cpp +++ b/tools/editor/editor_sub_scene.cpp @@ -196,7 +196,11 @@ void EditorSubScene::_bind_methods() { EditorSubScene::EditorSubScene() { + scene=NULL; + set_title("Select Sub-Scene.."); + set_hide_on_ok(false); + VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); set_child_rect(vb); @@ -211,9 +215,11 @@ EditorSubScene::EditorSubScene() { hb->add_child(b); b->connect("pressed",this,"_path_browse"); vb->add_margin_child("Scene Path:",hb); + tree = memnew( Tree ); tree->set_v_size_flags(SIZE_EXPAND_FILL); - vb->add_margin_child("Import From Node:",tree)->set_v_size_flags(SIZE_EXPAND_FILL); + vb->add_margin_child("Import From Node:",tree,true); + tree->connect("item_activated",this,"_ok"); file_dialog = memnew( EditorFileDialog ); List extensions; @@ -228,8 +234,4 @@ EditorSubScene::EditorSubScene() { add_child(file_dialog); file_dialog->connect("file_selected",this,"_path_selected"); - scene=NULL; - - set_hide_on_ok(false); - } diff --git a/tools/editor/icons/icon_list_select.png b/tools/editor/icons/icon_list_select.png new file mode 100644 index 00000000000..cbe81d4328f Binary files /dev/null and b/tools/editor/icons/icon_list_select.png differ diff --git a/tools/editor/io_plugins/editor_export_scene.cpp b/tools/editor/io_plugins/editor_export_scene.cpp index cd5c34e53bc..dff41a59ed7 100644 --- a/tools/editor/io_plugins/editor_export_scene.cpp +++ b/tools/editor/io_plugins/editor_export_scene.cpp @@ -100,7 +100,7 @@ Vector EditorSceneExportPlugin::custom_export(String& p_path,const Ref< Vector ret = FileAccess::get_file_as_array(tmp_path+"scnexp-"+md5+".scn"); - p_path+=".optimized.scn"; + p_path+=".converted.scn"; return ret; diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp index 78882469569..28eeb56b4bf 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -859,7 +859,7 @@ Vector EditorSampleExportPlugin::custom_export(String& p_path,const Ref ERR_FAIL_COND_V(err!=OK,Vector()); - p_path=p_path.basename()+".smp"; + p_path=p_path.basename()+".converted.smp"; return FileAccess::get_file_as_array(savepath); } diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index 8d5a4f1dcf6..92ef57a69e8 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -1666,7 +1666,7 @@ EditorTextureImportPlugin::EditorTextureImportPlugin(EditorNode *p_editor, Mode if (pl.is_valid()) { Vector ce = pl->custom_export(p_path,p_platform); if (ce.size()) { - p_path=p_path.basename()+".tex"; + p_path=p_path.basename()+".converted.tex"; return ce; } } @@ -1680,7 +1680,7 @@ EditorTextureImportPlugin::EditorTextureImportPlugin(EditorNode *p_editor, Mode if (pl.is_valid()) { Vector ce = pl->custom_export(p_path,p_platform); if (ce.size()) { - p_path=p_path.basename()+".tex"; + p_path=p_path.basename()+".converted.tex"; return ce; } } diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index a3164fc5242..0946383c8d6 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -221,7 +221,7 @@ void CanvasItemEditor::_unhandled_key_input(const InputEvent& p_ev) { void CanvasItemEditor::_tool_select(int p_index) { - ToolButton *tb[TOOL_MAX]={select_button,move_button,rotate_button,pan_button}; + ToolButton *tb[TOOL_MAX]={select_button,list_select_button,move_button,rotate_button,pan_button}; for(int i=0;iset_pressed(i==p_index); @@ -938,6 +938,75 @@ bool CanvasItemEditor::get_remove_list(List *p_list) { } +void CanvasItemEditor::_list_select(const InputEventMouseButton& b) { + + Point2 click=Point2(b.x,b.y); + + Node* scene = editor->get_edited_scene(); + if (!scene) + return; + + _find_canvas_items_at_pos(click, scene,transform,Matrix32(), selection_results); + + for(int i=0;iget_owner()!=scene && !scene->is_editable_instance(item->get_owner())) { + //invalid result + selection_results.remove(i); + i--; + } + + } + + if (selection_results.size() == 1) { + + CanvasItem *item = selection_results[0].item; + selection_results.clear(); + + additive_selection=b.mod.shift; + if (!_select(item, click, additive_selection, false)) + return; + + } else if (!selection_results.empty()) { + + selection_results.sort(); + + NodePath root_path = get_tree()->get_edited_scene_root()->get_path(); + StringName root_name = root_path.get_name(root_path.get_name_count()-1); + + for (int i = 0; i < selection_results.size(); i++) { + + CanvasItem *item=selection_results[i].item; + + + Ref icon; + if (item->has_meta("_editor_icon")) + icon=item->get_meta("_editor_icon"); + else + icon=get_icon( has_icon(item->get_type(),"EditorIcons")?item->get_type():String("Object"),"EditorIcons"); + + String node_path="/"+root_name+"/"+root_path.rel_path_to(item->get_path()); + + selection_menu->add_item(item->get_name()); + selection_menu->set_item_icon(i, icon ); + selection_menu->set_item_metadata(i, node_path); + selection_menu->set_item_tooltip(i,String(item->get_name())+ + "\nType: "+item->get_type()+"\nPath: "+node_path); + } + + additive_selection=b.mod.shift; + + selection_menu->set_global_pos(Vector2( b.global_x, b.global_y )); + selection_menu->popup(); + selection_menu->call_deferred("grab_click_focus"); + selection_menu->set_invalidate_click_until_motion(); + + + return; + } + +} + void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { { @@ -993,59 +1062,11 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (b.button_index==BUTTON_RIGHT) { - if (b.pressed && tool==TOOL_SELECT && b.mod.alt) { - Point2 click=Point2(b.x,b.y); + if (b.pressed && (tool==TOOL_SELECT && b.mod.alt)) { - Node* scene = editor->get_edited_scene(); - if (!scene) - return; - - _find_canvas_items_at_pos(click, scene,transform,Matrix32(), selection_results); - - if (selection_results.size() == 1) { - - CanvasItem *item = selection_results[0].item; - selection_results.clear(); - - additive_selection=b.mod.shift; - if (!_select(item, click, additive_selection, false)) - return; - - } else if (!selection_results.empty()) { - - selection_results.sort(); - - NodePath root_path = get_tree()->get_edited_scene_root()->get_path(); - StringName root_name = root_path.get_name(root_path.get_name_count()-1); - - for (int i = 0; i < selection_results.size(); i++) { - - CanvasItem *item=selection_results[i].item; - - Ref icon; - if (item->has_meta("_editor_icon")) - icon=item->get_meta("_editor_icon"); - else - icon=get_icon( has_icon(item->get_type(),"EditorIcons")?item->get_type():String("Object"),"EditorIcons"); - - String node_path="/"+root_name+"/"+root_path.rel_path_to(item->get_path()); - - selection_menu->add_item(item->get_name()); - selection_menu->set_item_icon(i, icon ); - selection_menu->set_item_metadata(i, node_path); - selection_menu->set_item_tooltip(i,String(item->get_name())+ - "\nType: "+item->get_type()+"\nPath: "+node_path); - } - - additive_selection=b.mod.shift; - - selection_menu->set_global_pos(Vector2( b.global_x, b.global_y )); - selection_menu->popup(); - selection_menu->call_deferred("grab_click_focus"); - - return; - } + _list_select(b); + return; } if (get_item_count() > 0 && drag!=DRAG_NONE) { @@ -1103,6 +1124,12 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { //if (!canvas_items.size()) // return; + if (b.button_index==BUTTON_LEFT && tool==TOOL_LIST_SELECT) { + if (b.pressed) + _list_select(b); + return; + } + if (tool==TOOL_PAN || b.button_index!=BUTTON_LEFT || Input::get_singleton()->is_key_pressed(KEY_SPACE)) return; @@ -2118,6 +2145,7 @@ void CanvasItemEditor::_notification(int p_what) { } select_button->set_icon( get_icon("ToolSelect","EditorIcons")); + list_select_button->set_icon( get_icon("ListSelect","EditorIcons")); move_button->set_icon( get_icon("ToolMove","EditorIcons")); rotate_button->set_icon( get_icon("ToolRotate","EditorIcons")); pan_button->set_icon( get_icon("ToolPan", "EditorIcons")); @@ -3155,7 +3183,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { hb->add_child(select_button); select_button->connect("pressed",this,"_tool_select",make_binds(TOOL_SELECT)); select_button->set_pressed(true); - select_button->set_tooltip("Select Mode (Q)\n"+keycode_get_string(KEY_MASK_CMD)+"Drag: Rotate\nAlt+Drag: Move\nPress 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)."); + select_button->set_tooltip("Select Mode (Q)\n"+keycode_get_string(KEY_MASK_CMD)+"Drag: Rotate\nAlt+Drag: Move\nPress 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving).\nAlt+RMB: Depth list selection"); + move_button = memnew( ToolButton ); move_button->set_toggle_mode(true); @@ -3171,6 +3200,12 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { hb->add_child(memnew(VSeparator)); + list_select_button = memnew( ToolButton ); + list_select_button->set_toggle_mode(true); + hb->add_child(list_select_button); + list_select_button->connect("pressed",this,"_tool_select",make_binds(TOOL_LIST_SELECT)); + list_select_button->set_tooltip("Show a list of all objects at the position clicked\n(same as Alt+RMB in selet mode)."); + pan_button = memnew( ToolButton ); pan_button->set_toggle_mode(true); hb->add_child(pan_button); diff --git a/tools/editor/plugins/canvas_item_editor_plugin.h b/tools/editor/plugins/canvas_item_editor_plugin.h index b96d36f7dc1..2376e9f8421 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.h +++ b/tools/editor/plugins/canvas_item_editor_plugin.h @@ -67,6 +67,7 @@ class CanvasItemEditor : public VBoxContainer { enum Tool { TOOL_SELECT, + TOOL_LIST_SELECT, TOOL_MOVE, TOOL_ROTATE, TOOL_PAN, @@ -240,6 +241,7 @@ class CanvasItemEditor : public VBoxContainer { List pose_clipboard; ToolButton *select_button; + ToolButton *list_select_button; ToolButton *move_button; ToolButton *rotate_button; @@ -309,6 +311,7 @@ class CanvasItemEditor : public VBoxContainer { void _clear_canvas_items(); void _visibility_changed(ObjectID p_canvas_item); void _key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE p_move_mode); + void _list_select(const InputEventMouseButton& b); DragType _find_drag_type(const Matrix32& p_xform, const Rect2& p_local_rect, const Point2& p_click, Vector2& r_point); diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index df6397ed1d7..178871ea75c 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -2256,6 +2256,10 @@ void ScriptEditor::_history_back(){ void ScriptEditor::set_scene_root_script( Ref