Compare commits

...

461 Commits
master ... 2.0

Author SHA1 Message Date
Rémi Verschelde 820dd1d001 Version 2.0.4.1, hotfix for #5620 2016-07-10 11:45:08 +02:00
George Marques 78883ea57d Fix builtin OpenSSL configuration
Fixes a bug that happens on Windows 64-bits.

(cherry picked from commit 2c6d0d4905)
2016-07-10 10:30:17 +02:00
Juan Linietsky 9cc9b45948 Finally fixes the infamous bug #4444, hoping to never see you again.
Closes #4444.

(cherry picked from commit b0f0ae0723)
2016-07-10 10:30:17 +02:00
eska 828fa9af11 Fix help search dialog titles
(cherry picked from commit af395cea42)
2016-07-10 10:30:17 +02:00
SuperUserNameMan 8a615b27ad fixes #5464 windows_joystick close_joystick bug
(cherry picked from commit 2511f48339)
2016-07-10 10:30:17 +02:00
Rémi Verschelde 5184b215a9 Revert "update EditorDirDialog on external change, closes #4629"
This reverts commit 257d370677.
Fixes #5620.
2016-07-10 10:30:05 +02:00
Rémi Verschelde 7ce99c23dd Version 2.0.4 stable 2016-07-09 01:05:23 +02:00
Rémi Verschelde af3cf7806e OSX export: Default to fat format, make it an enum
Since we want to distribute only the fat binary in the official templates, this should
make it work out of the box. 32 bits and 64 bits options are still available for people
that want them, but will throw an error if the binaries are not in the template zip.

(cherry picked from commit 02aeac12d1)
2016-07-09 01:01:31 +02:00
Ariel Manzur 687248bbf4 added "arch" parameter, made iphone use it to build isim
(cherry picked from commit 10c512e46d)
2016-07-09 00:54:22 +02:00
Rémi Verschelde 6d6b14d112 iOS simulator: merge into iphone detect.py
Fixes #4489

(cherry picked from commit dc8c145488)
2016-07-09 00:54:16 +02:00
Juan Linietsky 75cc8dc6b4 corrently parse utf8 from zip_io open, closes #1708
this probably failed when exporting or opening android apk files too, should fix that too.

(cherry picked from commit 1c541a2bee)
2016-07-09 00:08:33 +02:00
Rémi Verschelde 106199dfa7 classref: Add docs for InputEvent* and InputMap
(cherry picked from commit 69c8b583e7)
2016-07-08 23:45:31 +02:00
Rémi Verschelde 192688e7eb classref: Fix arg name for is_action_pressed/released
Also position TEXTURE_SPHERE constant properly.

(cherry picked from commit a15de80942)
2016-07-08 23:41:58 +02:00
eska a9a8bb281d Pass mouse position to Input singleton in web export
(cherry picked from commit 4beeff9433)
2016-07-08 21:27:00 +02:00
Franklin Sobrinho 90c8dbb890 Fix own world option of Viewport.
It happens when the viewport has WorldEnviroment child with a valid Enviroment

(cherry picked from commit 6b154c9706)
2016-07-08 20:47:19 +02:00
Juan Linietsky 6e7db99614 Avoid crash if setting modifiers fails, closes #5158
(cherry picked from commit 7e3044981e)
2016-07-08 19:28:54 +02:00
Juan Linietsky 3963f89ebd remove warnings if a script is missing and can't be opened
(cherry picked from commit d8c31e0e74)
2016-07-08 19:28:54 +02:00
Juan Linietsky f4a5963ca9 Fix several bugs related to node duplication and signals, closes #5405
(cherry picked from commit 17e4ead62a)
2016-07-08 19:18:09 +02:00
Pawel Kowal d4cb381ce0 Update String.capitalize() documentation
(cherry picked from commit fe49b71804)
2016-07-08 19:15:03 +02:00
Rémi Verschelde 2c3511a284 classref: Sync for new sorting of constants 2016-07-08 19:13:06 +02:00
George Marques 9420a1b6c1 Make sure builtin types' constants remain in order
This adds a list of constants for VariantCall to make sure the order of
register is kept when showing in the editor help and in the documentation.

This also remove the sorting of constants from the doctool, so it keeps
the natural order in classes.xml.

(cherry picked from commit 29b62ce5d0)
2016-07-08 19:01:59 +02:00
volzhs 8aeacd935c Fix crash when null value through jni on android
(cherry picked from commit b09dbaa78e)
2016-07-08 19:01:36 +02:00
Ignacio Etcheverry f9b7baa546 Prettier str() for arrays
(cherry picked from commit 38ed5d9c7d)
2016-07-08 18:56:50 +02:00
Andreas Haas 7589307911 Windows: prevent freeze while moving or resizing the game window.
When moving or resizing the window, Windows spins up a seperate event-loop, effectively blocking the normal one.
To work around this, we're starting a timer that will continue sending WM_TIMER messages which we can use to keep the mainloop running.

fixes #4695

(cherry picked from commit 6856c52491)
2016-07-08 18:56:28 +02:00
Juan Linietsky 6199efbc7e throw error if GridContainer::set_columns goes below 1, closes #5316
(cherry picked from commit f6725f9768)
2016-07-08 18:52:30 +02:00
Juan Linietsky 801db4c708 Make both signals be ordered and samplelibrary items too, fixes scenes changing for git, closes #5289
(cherry picked from commit b391306828)
2016-07-08 18:52:17 +02:00
Juan Linietsky 9b90d70ae7 Only emit item_selected once per Tree row, closes #5280
(cherry picked from commit 89bb72b2d3)
2016-07-08 18:48:46 +02:00
Juan Linietsky 242ceb1869 Remove error when getting dependencies from tscn files in some cases, closes #3897
(cherry picked from commit 519fce94e9)
2016-07-08 18:43:29 +02:00
Juan Linietsky de0b7b871b Fix bug in inner class reference, closes #1411
(cherry picked from commit cf6450043d)
2016-07-08 18:42:07 +02:00
Juan Linietsky eaca35adfe Fixed bug related to resolving constants in a class, closes #1110
(cherry picked from commit f4c6640827)
2016-07-08 18:42:02 +02:00
Juan Linietsky dffa1da012 Fix extends issue, closes #4026
(cherry picked from commit 565bb3afcc)
2016-07-08 18:41:37 +02:00
Juan Linietsky a2103bac7c Fixed bug in instance state ordering, closes #3904
(cherry picked from commit 8e1c0f287d)
2016-07-08 18:39:23 +02:00
Juan Linietsky a2d2eb9a63 Avoid recursion in filesystem scanning, closes #3838
(cherry picked from commit 41a26528e4)
2016-07-08 18:39:12 +02:00
Rémi Verschelde 3ce0380ba4 Fix style bug in event queue
Same fix as for 1f9812ab83
Not sure if this code actually does anything though, `buffer_max_used` seems unused.

(cherry picked from commit bd424d8f73)
2016-07-08 18:38:35 +02:00
Juan Linietsky 34e6e284db fix bug in reporting of message queue size
(cherry picked from commit 1f9812ab83)
2016-07-08 18:38:14 +02:00
Juan Linietsky 302abb1449 Properly complain when a scene file has not be selected, closes #3811
(cherry picked from commit d41b7a66e9)
2016-07-08 18:36:06 +02:00
Juan Linietsky c5fd6a3b69 Ability to rotate controls using tool, closes #3800
(cherry picked from commit e2d208f122)
2016-07-08 18:34:31 +02:00
Juan Linietsky 6813c89021 Properly deliver localized coordinates when passing gui events through parents, closes #4215
(cherry picked from commit 47d6cc08bb)
2016-07-08 18:34:10 +02:00
Ferdinand Thiessen 406daa8f7f Fix compiling for X11 on non-86, this fixes #5444
(cherry picked from commit 9e751178eb)
2016-07-08 18:33:27 +02:00
George Marques 694120210a Fix visual server error when minimizing the window
(cherry picked from commit bf44275b1a)
2016-07-08 18:33:13 +02:00
Juan Linietsky 9a7c310134 Avoid mirroring to go negative to fix crash, closes #4036
(cherry picked from commit 10f411b47b)
2016-07-08 18:23:22 +02:00
Juan Linietsky ea7da3bf08 remove the warning of instances in use at exit
(cherry picked from commit 8baa85d6b4)
2016-07-08 18:23:08 +02:00
Juan Linietsky 9592dd3e3b Fix error reporting when a scene is not imported properly, closes #3968
(cherry picked from commit 33f1204dc4)
2016-07-08 18:20:55 +02:00
Paulb23 9d85bfa00a Fixed selected text turning black, issue 5199
(cherry picked from commit 7f98f37f13)
2016-07-08 18:18:48 +02:00
Pedro J. Estébanez 5083e18b89 Optimize member access with self
Let the compiler take the fast path when a member is superfluously accessed with `self.`.

(cherry picked from commit d306b9bea5)
2016-07-08 18:18:00 +02:00
paper-pauper 3ff466770a Changes X11 res_name to "Godot_Engine"
Add additional/alternative WM_CLASS; only affects the game window, avoids redundancy and allows finer control in WMs (#5265)
(cherry picked from commit dd1ad31757)
2016-07-08 18:16:09 +02:00
volzhs 584deb807e Fix string array parameter check with jni
(cherry picked from commit 456b7733fc)
2016-07-08 18:07:11 +02:00
volzhs 6116174d49 Remove duplicated aidl for android
Tested IAP function on device.

(cherry picked from commit a5a5bdef25)
2016-07-08 18:06:59 +02:00
Rémi Verschelde 8a451e49e5 Revert "Fixed the order of events called by _input, closes #4384"
This reverts commit 299b0102f0.
2016-07-08 16:25:19 +02:00
Saracen b0aab53853 Dynamic property list for control margins allowing floating point properties to be used with ratio anchors.
(cherry picked from commit d8392dd117)
2016-07-08 16:25:19 +02:00
Juan Linietsky 10eedf62b8 Fixed bug using DirAccess in Android Marshmallow due to data dir being a symlink 2016-07-02 11:46:15 -03:00
Rémi Verschelde 673ef0cf88 Ignore some 2.1-specific files 2016-06-25 02:04:27 +02:00
Andreas Haas f7436c7d16 Add "bool" to GDScript reserverd keywords
Noticed that "bool" wasn't highlighted when used like `export(bool) var is_xy = false`

(cherry picked from commit c871cf6801)
2016-06-25 02:04:27 +02:00
George Marques c015341221 Fix bug in String==StrRange comparison
It was comparing the StrRange with itself, always return true if both
were the same length.

Fix #3843

(cherry picked from commit f4dfa37a23)
2016-06-25 02:04:27 +02:00
Juan Linietsky 6e49bc8210 Properly report a valid error instead of reporting as a bug, closes #3841
(cherry picked from commit 95e3279d34)
2016-06-25 02:04:27 +02:00
volzhs c2226d1199 Fix network IP setting change
Fix #5368

(cherry picked from commit 515472bc52)
2016-06-25 02:04:27 +02:00
George Marques 7fd9ff70f9 Add docs for String and CanvasItem
(cherry picked from commit 6776fa63de)
2016-06-25 02:04:27 +02:00
George Marques 1218d8f2a2 Rename CanvasItem.edit_get() to edit_get_state()
This makes more sense of what it does and correlates to edit_set_state()

(cherry picked from commit b06d235ce8)
2016-06-25 01:56:14 +02:00
Juan Linietsky cf300ace96 Fix issue saving flags (size fill expand), fixes #4176
(cherry picked from commit a8f8f52b19)
2016-06-25 01:55:39 +02:00
Rémi Verschelde 4e1dcd3d0b png: Do not output warnings as errors
(cherry picked from commit 9bf3ee7acc)
2016-06-25 01:55:31 +02:00
Paulb23 5907bddda5 Fixed save as not working with scripts
(cherry picked from commit c68e4e8cbe)
2016-06-25 01:54:13 +02:00
volzhs 39cc2cbfb9 fix android resource locale
(cherry picked from commit 591be5df25)
2016-06-25 01:54:00 +02:00
Juan Linietsky 140949e013 Fixed error using the same atlas rect for all images, closes #4139
(cherry picked from commit 3edf66477a)
2016-06-25 01:53:27 +02:00
Rémi Verschelde 5b3551a91f classref: Sync with the new sorting behaviour 2016-06-25 01:52:14 +02:00
George Marques 2389712638 Fix classes.xml sorting
Make methods, signals, theme items and constants sort correctly

(cherry picked from commit 9bde4e5652
+ a needed change from e8eb396d7cfec8a96efb78719c0556f1beccf68)
2016-06-25 01:50:58 +02:00
Rémi Verschelde 1a3d408f52 classref: Sync with backported patches 2016-06-25 01:50:55 +02:00
Bojidar Marinov 0ce2f76d5a Fix a inherited transform bug with Camera2D preview drawing
Closes #5339

(cherry picked from commit f3342eb72e)
2016-06-25 01:42:00 +02:00
George Marques 35c64c1824 Fix File.get_as_text() to return the whole file
It was returning only from the cursor forward.

(cherry picked from commit 0f20d8756e)
2016-06-25 01:42:00 +02:00
George Marques aa581a067d Add classref for File class
(cherry picked from commit 4d33eb01d7)
2016-06-25 01:42:00 +02:00
sunnystormy 418cd58d47 Renamed Trackpad Hint to Emulate 3 Button Mouse. (#5258)
(cherry picked from commit b3b1fdae85)
2016-06-25 01:42:00 +02:00
Juan Linietsky 0c71eb8a1e do not crash when generating preview of very large sound files, fixes #4123
(cherry picked from commit 9b8f2741ae)
2016-06-25 01:42:00 +02:00
Juan Linietsky 3318860539 fix CanvasItem.get_global_transform() and CanvasItem.get_local_transform(), closes #4075
(cherry picked from commit fa0d1cd27c)
2016-06-25 01:41:59 +02:00
Juan Linietsky d1dbc7fe93 fix bug decompressing bc texture, closes #4404
(cherry picked from commit 9d4cdc6d8a)
2016-06-25 01:41:59 +02:00
Juan Linietsky 299b0102f0 Fixed the order of events called by _input, closes #4384
(cherry picked from commit ad8d4a6b26)
2016-06-25 01:41:59 +02:00
Juan Linietsky fb255a69b6 Add quotes to .tscn keys, solves #4366
(cherry picked from commit 6872139300)
2016-06-25 01:41:59 +02:00
Juan Linietsky 1bfaea0d76 added missing status, closes #4361
(cherry picked from commit e9d2c9ad51)
2016-06-25 01:41:59 +02:00
Juan Linietsky ad01fa2248 Allow mouse wheel to go throuhgh so scroll containers work properly, fixes #4431
(cherry picked from commit 85d8000449)
2016-06-25 01:41:59 +02:00
Juan Linietsky b457b8ac89 Fix error storing path for children of instanced nodes in .tscn, fixes #4320 fixes #4579 fixes #4580
(cherry picked from commit 6bdd17f07c)
2016-06-25 01:41:59 +02:00
volzhs 5582d37af9 correct current Intent for android
(cherry picked from commit 780fa60072)
2016-06-25 01:41:59 +02:00
Juan Linietsky 8c5577e9e4 properly initialize loops to 0 in eventplayer
(cherry picked from commit 93441d6119)
2016-06-25 01:41:59 +02:00
Juan Linietsky 7076e98f40 fix loop counter for eventstream, closes #4493
(cherry picked from commit 8f7a1367fe)
2016-06-25 01:41:59 +02:00
Juan Linietsky a71ea0abc6 Make dure to only call drop_data if can_drop_data returned true, closes #4616
(cherry picked from commit 0e07f49a03)
2016-06-25 01:41:59 +02:00
George Marques edadb46bd4 Fix TextEdit cursor position after undo remove text
It was going to where the text started, now it goes to where the text
ends.

(cherry picked from commit 831ae2d510)
2016-06-25 01:41:58 +02:00
J08nY 86c4bbc031 libtheora: New version 1.1.1
(cherry picked from commit 214f316cf9)
2016-06-25 01:41:58 +02:00
J08nY 8d9121f0b0 libvorbis: New version 1.3.5
(cherry picked from commit 644e9076bb)
2016-06-25 01:41:58 +02:00
Mehmet Durgel c9716ebd00 Clarification about enter keys confusion
Some Languages threat KEY_RETURN and KEY_ENTER keys having the same keycode (eg: Javascript).
Added additional explanation about this issue.
Related to #4595

(cherry picked from commit 92fc3fa536)
2016-06-25 01:41:58 +02:00
J08nY a04be3e44b libogg: New version 1.3.2
(cherry picked from commit 98f23d27a4)
2016-06-25 01:41:58 +02:00
Juan Linietsky af41d7bffa Add function to get the color picker dialog from ColorPickerButton, closes #4415
(cherry picked from commit 400febf585)
2016-06-25 01:41:58 +02:00
J08nY 61b087dd66 Classref: Mutex, Semaphore, Thread, *Array (#5278)
(cherry picked from commit b587a13293)
2016-06-25 01:41:58 +02:00
Juan Linietsky 257d370677 update EditorDirDialog on external change, closes #4629
(cherry picked from commit 5e7f1fc79b)
2016-06-25 01:41:57 +02:00
Juan Linietsky beb2176399 Make ".." always appear even if dir is unlistable (likely lacking permissions), closes #1938
(cherry picked from commit adc13e9027)
2016-06-25 01:41:57 +02:00
Ignacio Etcheverry 18cb1f8e44 LineEdit: Fix and improve selection behaviour
(cherry picked from commit 99612207b7)
2016-06-25 01:41:57 +02:00
Dennis Brakhane a04a78c7f6 correctly parse floats in scientific notation
GDScript incorrectly parsed float values in scientific notation
when no decimal point was given. "1e-5" was parsed as "15".

Fix this by not requiring a decimal point when we found an exponent
for the number to be considered a float.

Fixes #5267

(cherry picked from commit c246931f03)
2016-06-25 01:41:57 +02:00
Juan Linietsky 8df46cddcb Fixed fractional offset not being reset in ringbuffer resamples, closes #4764
Probably fixes other streamplayer issues too.

(cherry picked from commit 3b5f1afb5c)
2016-06-25 01:41:57 +02:00
Juan Linietsky 775b089548 TabContainer now reports proper minimum size, closes #4896
(cherry picked from commit 65bcde0a7d)
2016-06-25 01:41:57 +02:00
Juan Linietsky 7b36595641 Send body inout notifications after state is applied, fixes #4683
(cherry picked from commit 95dc15b750)
2016-06-25 01:41:57 +02:00
J08nY f5d3d9cc5f Classref: added PacketPeer*
(cherry picked from commit 541a1226cd)
2016-06-25 01:41:57 +02:00
J08nY be4babccba Fixed PacketPeer.get_var() return type in docs
(cherry picked from commit 6bbc53ee18)
2016-06-25 01:41:57 +02:00
volzhs 6a1368d24d fix errors while exporting android
(cherry picked from commit e6bbe91994)
2016-06-25 01:41:57 +02:00
J08nY 109e58cf75 Classref: Added docs for StreamPeer* (#5216)
(cherry picked from commit cffdc52482)
2016-06-25 01:41:56 +02:00
George Marques 0b8cf7946e Fix javascript build in Windows
Fix #3438

(cherry picked from commit c48ffed87a)
2016-06-25 01:41:56 +02:00
J08nY c1e004ffca String documentation: .ord_at() returns int not String
fixes #5189

(cherry picked from commit 58a891265a)
2016-06-25 01:41:56 +02:00
Juan Linietsky d662f5aa63 does not fix the bug reported in #4326 and #4818,
but at least make sure it throws and error and does not crash

(cherry picked from commit 333de40180)
2016-06-25 01:41:56 +02:00
Juan Linietsky 85c6d1b37d correctly wrap lines longer than width in richtextlabel, fixes #4735
(cherry picked from commit c204170232)
2016-06-25 01:41:56 +02:00
Juan Linietsky fd4d666289 Better error text when trying to add/remove/move child nodes in a busy parent, closes #4838
(cherry picked from commit 37ed2bae69)
2016-06-25 01:41:56 +02:00
George Marques d8f9c95dbd Fix crash in code completion
Fix #4641

(cherry picked from commit 17b6cebcfe)
2016-06-25 01:41:56 +02:00
Juan Linietsky 56c5da8565 changed visual server free() to free_rid() like in the other servers. Fixes #4917
(cherry picked from commit 64b4253dbf)
2016-06-25 01:41:56 +02:00
Andreas Haas c2e09a21ac Update gamepad mappings.
Merge mappings from https://github.com/gabomdq/SDL_GameControllerDB

(cherry picked from commit 3d0b390457)
2016-06-25 01:41:56 +02:00
J08nY d8d926730c Dictionary: rename param in .has() .has_all() .erase()
fixes #5190, param should be named key, not value

(cherry picked from commit 7a19e3c6ae)
2016-06-25 01:22:42 +02:00
Juan Linietsky da45e32ef1 -Avoid negative zero from being saved to config files o resource files, fixes #4758
(cherry picked from commit 910151a361)
2016-06-25 01:22:41 +02:00
Juan Linietsky b075525e84 resolve numerical error when comparing instancing an inheritance to avoid saving changed properties when they didn't, closes 4759
(cherry picked from commit f0abda999e)
2016-06-25 01:22:41 +02:00
Juan Linietsky 6525e0017c Fixed ancient bug that prevented proper theme editing, closes #4924
(cherry picked from commit c1056a9bfb)
2016-06-25 01:22:41 +02:00
Ovnuniarchos c54744ce4d Documented many Physics2D* classes
(cherry picked from commit 471ab4e6ff)
2016-06-25 01:22:41 +02:00
Juan Linietsky acc552c447 Made error when signal calls a method with the wrong number of parameters more detailed, closes #4893
(cherry picked from commit 4bb93c976c)
2016-06-25 01:22:41 +02:00
Juan Linietsky d411cbe1d9 rewrote LineEdit window repositioning code so it does not eat the last character, closes #4992
(cherry picked from commit 83bf8036de)
2016-06-25 01:22:41 +02:00
Juan Linietsky 2212cc827c fix how some display values are shown, fixes #4953
(cherry picked from commit 1555608276)
2016-06-25 01:22:41 +02:00
Juan Linietsky cb37d1bb91 apply built-in scripts when running the game, closes #4987
(cherry picked from commit 482b21a5a4)
2016-06-25 01:22:41 +02:00
Juan Linietsky 7987147502 gdscript tokenizer will dislike use of case, closes #4991
(cherry picked from commit ceeb5453a8)
2016-06-25 01:22:41 +02:00
Juan Linietsky c22ac11afb fix crash in SamplePlayer, closes #5005
(cherry picked from commit ef9720c8f0)
2016-06-25 01:22:41 +02:00
Juan Linietsky d945dbdd0f remove unnecesary found bug? print, closes #5028
(cherry picked from commit fea9511bc6)
2016-06-25 01:22:40 +02:00
Juan Linietsky b06cf23c1a make sure tab is not visible in RichTextLabel, closes #5079
(cherry picked from commit ef2f6a18d2)
2016-06-25 01:22:40 +02:00
Juan Linietsky 51330b29ae do not allow picking in captured mode, closes #5134
(cherry picked from commit b75fb6674b)
2016-06-25 01:22:40 +02:00
Juan Linietsky 8289760227 Show descriptive errors when look_at is improperly used, closes #5131
(cherry picked from commit 375fbe5c7c
and db1e9bac79)
2016-06-25 01:22:40 +02:00
Juan Linietsky dd7e7c94c1 property output unix seconds since epoch in windows get_system_time_secs, fixes #5155
(cherry picked from commit fc7adf0b4c)
2016-06-25 01:22:40 +02:00
Nuno Donato 25244e9843 * fix messages when modifying on switching the active axis
(cherry picked from commit a713188388)
2016-06-25 00:37:19 +02:00
Juan Linietsky 6a83c87dda fixes wrong bool return, closes #5037
(cherry picked from commit c5a2aff6db)
2016-06-25 00:31:10 +02:00
Juan Linietsky 64ac2272ce If a resource is delete from fs dialog, but the resource is currently loaded,
clear the path of the resource. Fixes #5110

(cherry picked from commit f4ff30dff0)
2016-06-25 00:30:06 +02:00
volzhs 2998b7c486 add line spacing option to script and shader editor (#5105)
(cherry picked from commit 990956c4e0)
2016-06-25 00:29:25 +02:00
Paulb23 13d3d217b1 Fixed editor help focus issues and input propagation
(cherry picked from commit eb14373d69)
2016-06-25 00:27:49 +02:00
CowThing a94f6108a9 Filling in documentation
Documentation for BoneAttachment, KinematicBody, ParallaxBackground,
ParallaxLayer, and TestCube

(cherry picked from commit 50de99f050)
2016-06-25 00:26:18 +02:00
Paulb23 93616e41f9 Caret blink no longer updates when hidden, issue 5100
(cherry picked from commit e260e3872c)
2016-06-25 00:26:10 +02:00
J08nY 1475f8d318 RtAudio: proper under/overflow warning
fix #5102

(cherry picked from commit 39260f9dca)
2016-06-25 00:25:50 +02:00
Rémi Verschelde 9bb6a0852b GLEW: Update to upstream version 1.13.0 (pristine)
This removes a custom redefinition of glewGetProcAddress,
which was apparently necessary for older Macs with buggy OpenGL
(see #5087).

The added source files are as provided in the upstream tarball.

(cherry picked from commit 5bed0af65e)
2016-06-25 00:24:18 +02:00
Rémi Verschelde 66ce012ca6 GLEW: Define static + enabled and includes via SCons
This allows us not to have to hack our definitions in the upstream files,
making it easier to upgrade to newer versions in the future.

For the include paths to work, the headers are moved to a GL subfolder to
match their upstream location.

(cherry picked from commit 768e925271)
2016-06-25 00:24:09 +02:00
Rémi Verschelde 64507f0085 Haiku: Do not define GLEW_ENABLED to undefine it later
Partial revert of f61eb5fd8e.

(cherry picked from commit 4c658dc523)
2016-06-25 00:24:02 +02:00
Pawel Kowal 08c9e566bf Improved Blender/Collada shadeless->unshaded import
(cherry picked from commit 101e0c9ec6)
2016-06-25 00:23:48 +02:00
Paulb23 afbc9d550f Improved breakpoint marker position, and scales with font size
(cherry picked from commit d66b034bd1)
2016-06-25 00:22:36 +02:00
J08nY d16375d005 Classref for: ImageTexture, Image, LargeTexture
(cherry picked from commit ec96e36bc9)
2016-06-25 00:22:06 +02:00
J08nY 74d0f8b65b Exposed Image.INTERPOLATE_*
(cherry picked from commit 8a4eca8aa8)
2016-06-25 00:21:56 +02:00
Rémi Verschelde 9791d2ef6d Fix indentation issues in last commits
Ping @reduz.

(cherry picked from commit 0729c852b4)
2016-06-25 00:19:27 +02:00
Juan Linietsky cb94271e9f properly pass events to parent controls, closes #4701
(cherry picked from commit aec5506414)
2016-06-25 00:16:35 +02:00
Juan Linietsky bb8b57cbae -Fix small bug regarding to canvas layer detection, closes #4381
(cherry picked from commit 2b9cab25c0)
2016-06-25 00:16:08 +02:00
TheoXD 5a45b295ae fixed interactive_loader() not returning a cached scene
(cherry picked from commit 47bd1e8688)
2016-06-25 00:15:28 +02:00
Roberto a39eaf4c66 Add missing license information (ogg/vorbis/opus)
(cherry picked from commit c0a8c4f6e4)
2016-06-25 00:12:01 +02:00
Roberto 9ac954e2a4 Add missing license information (Theora)
(cherry picked from commit 18fc2ccbe1)
2016-06-25 00:11:33 +02:00
Pedro J. Estébanez 73e455c22f Keep the default environment variables as set by SCons
(cherry picked from commit ad0af9d273)
2016-06-25 00:11:26 +02:00
Roberto 840ad26069 Add missing license information (WebP)
(cherry picked from commit f97f8971e3)
2016-06-25 00:11:05 +02:00
Roberto b18000349e Add missing license information (MiniZip)
(cherry picked from commit 04fc62c4e3)
2016-06-25 00:10:59 +02:00
Andreas Haas 7bff33ea92 fix ui_* input events in Editor
`input/` is the category for these in globals ^^
fixes #5050

(cherry picked from commit a9779efe82)
2016-06-25 00:09:26 +02:00
Bojidar Marinov aad9cd3e22 Document Viewport and ViewportSprite classes
(cherry picked from commit 662e0cc411)
2016-06-25 00:06:48 +02:00
Juan Linietsky d5bed26e42 Make Input Actions config not affect the editor
(cherry picked from commit 64fd75d91a)
2016-06-25 00:05:40 +02:00
volzhs 356c35954a change invalid characters when get user data dir on Windows & Unix
Can't create user data folder when project name has ``\ / : * ? " < > |`` characters on OS_Windows & OS_Unix.
So, change it to ``-`` to be able to make folder.

fixes #4928 and it's altanative to #4986.

(cherry picked from commit 9073dc9963)
2016-06-25 00:05:00 +02:00
Rémi Verschelde ff91f409bf Merge pull request #5224 from zaps166/2.0-fix-theora-no-audio
Fix Theora video playback without a Vorbis stream
2016-06-17 19:58:39 +02:00
Błażej Szczygieł 763b29f34e Fix Theora video playback without a Vorbis stream
- prevent audio resampler errors when number of channels is 0,
- don't check for 'audio_done' when there is no audio data.
2016-06-17 13:38:47 +02:00
Rémi Verschelde d412cb65be Doc: Make rst files as UTF-8 2016-06-05 00:19:45 +02:00
Rémi Verschelde da8fb5de7a classref: Sync with source 2016-06-05 00:11:15 +02:00
J08nY 845a0e2566 Added InputMap.get_actions()
get_actions() lists all actions in the InputMap.

(cherry picked from commit 1a80b2a04a)
2016-06-05 00:03:48 +02:00
marcelofg55 bed17e98c8 Right click->Quit on the godot icon will now close the application on OSX.
Fixed get_window_position that missed a return on OSX.

(cherry picked from commit 76ab7d3886)
2016-06-05 00:03:30 +02:00
Warlaan c6ef223498 The create dialog starts collapsed now.
The original behavior can be reactivated in the editor settings.

(cherry picked from commit 987192775a)
2016-06-05 00:01:29 +02:00
J08nY 8a7c4c017f Fix typo in http_client.h
(cherry picked from commit b4fb4a131d)
2016-06-05 00:00:28 +02:00
volzhs f22e13d24e deselect in help when click somewhere
(cherry picked from commit bf22e69822)
2016-06-05 00:00:17 +02:00
George Marques 47f8da5409 Fix Color8 constructor using wrong value range
Fix #5015

(cherry picked from commit 43dad78209)
2016-06-05 00:00:08 +02:00
J08nY 8ea940e99b Added classref for HTTPClient and HTTPRequest
(cherry picked from commit 4c5439f8cd)
2016-06-04 23:59:45 +02:00
Rémi Verschelde f97cbdec8f Update to libpng 1.5.27
No security relevant fix as far as I can see, but the version bump
does not hurt either.

(cherry picked from commit bc25492e63)
2016-06-04 22:20:46 +02:00
Warlaan fc15a842af Added classes' short descriptions as tooltips in the create dialog.
(cherry picked from commit fe3a68c4c2)
2016-06-04 22:20:33 +02:00
George Marques 6d45fc0717 Remove Make-related flags from Android build
They were wrongly placed, creating a file named "-fpic" instead of
applying "-fpic" to the build. This file was in .gitignore, which made it
less noticiable.

This also adds build.gradle to .gitignore.

(cherry picked from commit 408c26ce0b)
2016-06-04 22:20:02 +02:00
P-GLEZ 298be3356f StaticBody documentation
Documented StaticBody. Also corrected an error in StaticBody2D
documentation

(cherry picked from commit 35cb75220d)
2016-06-04 22:20:02 +02:00
P-GLEZ 436e968b43 classref: Area documentation
One method was missing.

(cherry picked from commit 0325944ee4)
2016-06-04 22:20:02 +02:00
Andreas Haas 2b06d7e6f7 Make Color.{rgba}8 return int instead float
According to the class doc, these should be int.
Also fixed a little bug: the setter for 'r8' changed the green value

(cherry picked from commit da3247a500)
2016-06-04 22:20:02 +02:00
P-GLEZ 79e9917367 Area Documentation
Ported the Area2D documentation into its 3D counterpart. Also fixed some
typos

(cherry picked from commit 617530832b)
2016-06-04 22:20:02 +02:00
jmintb 3efe43fb8b Switched the space shooter demo from none fixed process to fixed process
(cherry picked from commit a9d246ea6c)
2016-06-04 22:20:02 +02:00
marcelofg55 331a0aed71 Key modifiers (Ctrl, Alt, Meta and Shift) may be used as Input keys now on OSX
(cherry picked from commit bb223869e0)
2016-06-04 22:20:02 +02:00
J08nY 39773b6b9a Added classref for RigidBody, and finished classref for Resource
(cherry picked from commit 063d507a15)
2016-06-04 22:20:02 +02:00
CowThing 566d751e39 Filling in documentation
VisibilityNotifier and VisibilityEnabler (2D and 3D).

(cherry picked from commit 3ba4e6b2ac)
2016-06-04 22:20:02 +02:00
Paulb23 7928b5fef6 Current line draws behind line numbers and breakpont gutter
(cherry picked from commit 6ae126ef9b)
2016-06-04 22:20:02 +02:00
Rémi Verschelde 8b8a1a0cbb Icon: Remove more grey capsules behind official logo
(cherry picked from commit e6e878e139)
2016-06-04 22:20:02 +02:00
Julian Murgia - StraToN 5c52f4437a Documented Light2D and LightOccluder2D
(cherry picked from commit 9ac4b29322)
2016-06-04 22:20:02 +02:00
Julian Murgia - StraToN e8b1744325 Documented BackBufferCopy. Need validation for the different copy modes (constants)
(cherry picked from commit defe7f18c2)
2016-06-04 22:20:02 +02:00
Aleksandar Danilovic 24e5755e72 Fix MS Visual Studio build settings
NMake was not setup by the vsproj=yes compilation
parameter. After attempting other possible options,
this is the best fix for our current requirements.
Compiling via NMake is implementing an alternative
to SCons, so this fix escapes out of NMake
environment while also supporting different target
builds and IDE error list integration.

Also sets -j setting to 2 so that it's easy for
people to change it to a propper value and speed it
up a bit for those that do not.

Adds two missing .gitignore Visual Studio temp files
present in Visual Studio's .gitignore.

(cherry picked from commit ca876191e5)
2016-06-04 22:20:02 +02:00
Rémi Verschelde 1787ec12be Editor: Fix base dir when going back to project manager
This caused the PM to load with the parameters of the previously loaded project.
Was a regression from ea751724a2. Closes #4045.

(cherry picked from commit 6fefcfd46a)
2016-06-04 22:20:02 +02:00
MarianoGNU c67b1888b5 Remove focus from Sprite Region Editor dialog. Fixes #4751
(cherry picked from commit e7b7dfefd3)
2016-06-04 22:20:02 +02:00
Paulb23 7029c96221 Added, goto next and previous breakpoint and remove all, issue 1690
(cherry picked from commit daf0ed646f)
2016-06-04 22:20:02 +02:00
Geequlim 178168aa8a Add spaces to macros in memory.h to make C++11 compilers happy
(cherry picked from commit 728ce570a5)
2016-06-04 22:20:02 +02:00
Paulb23 71487793df Fix crash when redoing backspace to clear selection
(cherry picked from commit 4a5997ec1c)
2016-06-04 22:20:02 +02:00
Paulb23 99c948ba56 Added breakpoint markers, issue 4750
(cherry picked from commit 72fda444d1)
2016-06-04 22:20:02 +02:00
Ignacio Etcheverry 211a6d01bc Debugger: show error message if description is not available
(cherry picked from commit ea9cde8842)
2016-06-04 22:20:02 +02:00
marcelofg55 280899ee43 Added application/fat_bits property for EditorExportPlatformOSX::EditorExportPlatformOSX
(cherry picked from commit ba0fbe4f79)
2016-06-04 22:20:02 +02:00
Paulb23 652f82dae8 Fixed caret color not changing though properties
(cherry picked from commit 6dd538a7ae)
2016-06-04 22:20:02 +02:00
Carter Anderson 6844b580f6 Remove noisy print
(cherry picked from commit 7df5249779)
2016-06-04 22:20:02 +02:00
Daniel J. Ramirez ef4ac86656 Modified damp ranges
(cherry picked from commit ba0baa3ca7)
2016-06-04 22:20:02 +02:00
Daniel J. Ramirez f346733d80 Clamped some light2D ranges
(cherry picked from commit c9350d7897)
2016-06-04 22:20:02 +02:00
volzhs bbf08a48df fix unexpected char: '\' error on windows
error occurred when register additional directory for android module on windows.

### config.py ###
```
def can_build(plat):
 return plat=="android"

def configure(env):
 if (env['platform'] == 'android'):
  env.android_add_res_dir("android/res")
```

(cherry picked from commit 5eb14d3af0)
2016-06-04 22:20:02 +02:00
volzhs 4478f8cfbb use node name as filename when save scene
fix #4723

(cherry picked from commit 9e1ee568a6)
2016-06-04 22:20:02 +02:00
Hugo Locurcio 5ad050be2b Change the default comment color to #676767 (#4763)
A neutral gray color, more readable than the old brown one.
(cherry picked from commit e75701e0b5)
2016-06-04 22:20:02 +02:00
anatoly techtonik a5007d0e7a README.md docs are not wiki (#4770)
(cherry picked from commit e56f05c690)
2016-06-04 22:20:02 +02:00
est31 88e512547b README: use https links to main website
Thanks @akien-mga for having given me the idea:
926df79a7c

(cherry picked from commit da54a4d693)
2016-06-04 22:20:02 +02:00
est31 85018e185a README: Improve Documentation section
The move was over three months ago, it is irritating
to still read "has been moved to".

(cherry picked from commit d3515a1ccb)
2016-06-04 22:20:02 +02:00
Calinou 9b03b9e989 Change low processor usage mode to cap to 60 FPS rather than 40 FPS
This results in smoother operation in the editor, without needing to
resort to the "Update Always" method which uses more resources than
needed.

(cherry picked from commit cc5a020afe)
2016-06-04 22:20:02 +02:00
Ariel Manzur 803438d448 SCons: using 1 env for all drivers
(cherry picked from commit 6cf2353305)
(cherry picked from commit 12bd9ee6f2)
(cherry picked from commit 4c4d79e3c9)
(cherry picked from commit dbb4c0c9b7)
2016-06-04 22:20:02 +02:00
marcelofg55 4dc2d78d2e Added 'fat' option for bits param on scons for osx, this will produce a fat binary that contains both 32 bits and 64 bits binaries
(cherry picked from commit eeb83982e2)
2016-06-04 22:20:02 +02:00
Geequlim c2f48421d1 Document the FileDialog and partial OS methods
(cherry picked from commit a92652d578)
2016-06-04 22:20:02 +02:00
captainwasabi 08fa7a0ff1 Fix for tooltip blinking (#4713)
Moved where active tooltips are canceled to wait until the mouse actually moves off the control.
(cherry picked from commit 4b80895082)
2016-06-04 22:20:02 +02:00
Bojidar Marinov bea5135518 Fix a XML error with the documentation
(cherry picked from commit d208572906)
2016-06-04 22:20:02 +02:00
Paulb23 e95eb4b1dc Multiline duplication, issue #4661
(cherry picked from commit 2eb4e7c103)
2016-06-04 22:20:02 +02:00
Rémi Verschelde 01bdfa4d22 Android buildsystem: Drop obsolete NDK_TOOLCHAIN argument
It was a duplicate of NDK_TARGET, and not used for anything.
(cherry picked from commit 5e0f0a962a)
2016-06-04 22:20:02 +02:00
Wilhem Barbier 16d38b199a Check the save path before importing a 3D Mesh
(cherry picked from commit f38473f65b)
2016-06-04 22:20:02 +02:00
Rémi Verschelde 1d85dcb1fa GDScript: Fix method info for is_nan and is_inf
As reported on https://godotengine.org/qa/4114/why-isnan-and-isinf-arent-implemented
(cherry picked from commit b58e261d41)
2016-06-04 22:20:02 +02:00
CowThing c6e2c0f01d Filling in documentation.
AABB, Color, Rect2, Transform, Vector2, and Vector3.

(cherry picked from commit 0749db2cf8)
2016-06-04 22:20:02 +02:00
Paulb23 481c076feb Fixed hex notation highlighting
(cherry picked from commit b2bf266ddc)
2016-06-04 22:20:02 +02:00
Paulb23 86c0438f9d Member variable syntax highlighting
(cherry picked from commit fc9f9adcb2)
2016-06-04 22:20:02 +02:00
Bojidar Marinov d7e4fb4365 Save member information in docdata
Closes #4609

(cherry picked from commit 4cbf74da71)
2016-06-04 22:20:02 +02:00
volzhs a3979cc928 Add SpinBox to Lossy Quality on Image Groups
fixes #3653

(cherry picked from commit 82600944bd)
2016-06-04 22:20:02 +02:00
Daniel J. Ramirez 1864745e2a Documented @GlobalScope singletons and some keys
(cherry picked from commit cb0be4adaa)
2016-06-04 22:20:02 +02:00
Rémi Verschelde 0a64059937 Merge pull request #5021 from zaps166/2.0-last_sample_playing-fix
SampleLibraryEditor: Initialize "is_playing" variable
2016-06-03 20:02:46 +02:00
Błażej Szczygieł 9acb666320 SampleLibraryEditor: Initialize "is_playing" variable
Fixes crash caused by jumping to wrong place due to uninitialized
variable.

Closes #4703
2016-06-03 19:54:25 +02:00
Rémi Verschelde 3a1e69f45c Travis: Install android *DKs in verbose mode
Builds tend to fail due to the 10 min limit for stalled builds.
Most likely because the download is done silently and takes more than
10 min depending on the Travis connection.
(cherry picked from commit 83913e86fe)
(cherry picked from commit dfb9ba877e)
(cherry picked from commit 1bdda9a922)
2016-05-18 08:22:21 +02:00
Daniel J. Ramirez 6a85acdffb Fix some errors in some rotation functions, also clarify that certain parameters are expressed in radians
(cherry picked from commit 70ec87ecd2)
2016-05-18 08:21:44 +02:00
volzhs 094a9c3bcc open directory or file when double click
fixes #4607

(cherry picked from commit 81b4d38fa7)
2016-05-18 08:21:38 +02:00
Rémi Verschelde 5d2a23d99c Revert "Revert "-make sure single select after multi select works better""
This reverts commit 9ed2084b42.
Will then add the proper fix.
2016-05-18 08:21:16 +02:00
Rémi Verschelde 9ed2084b42 Revert "-make sure single select after multi select works better"
This reverts commit f909634832.
It caused various regressions (#4556 and #4607).
2016-05-13 08:06:31 +02:00
Rémi Verschelde c0df7da2ca Version 2.0.3 2016-05-12 19:54:11 +02:00
Rémi Verschelde 49bf494eac classref: Readd String.strip_edges description 2016-05-12 19:47:26 +02:00
eska b8d8ec09ee Remove nocpuid.c from builtin OpenSSL
Since opensslconf.h no longer defines OPENSSL_CPUID_OBJ, OpenSSL defines
OPENSSL_cpuid_setup itself (with the same empty definition)

(cherry picked from commit 2392824dba)
2016-05-12 19:35:49 +02:00
MattUV f120514402 classref: Fixed return types in Area and Area2D (#4635)
(cherry picked from commit 91c85ff1f5)
2016-05-12 19:35:41 +02:00
Rémi Verschelde 77573a76d1 classref: Sync with current source 2016-05-12 09:16:37 +02:00
Rémi Verschelde c734a508c3 classref: Directory and ConfigFile
(cherry picked from commit 22d1385caf)
2016-05-12 09:07:43 +02:00
Rémi Verschelde d66b04921f Windows: Fix GCC/Clang argument being passed to MSVC
Fixes #4620

(cherry picked from commits 972b0f78b3
and c7292b1f3d)
2016-05-12 09:06:48 +02:00
Paulb23 f61f515872 Updated caret blink method documentation
(cherry picked from commit 997476777a)
2016-05-12 09:06:10 +02:00
Paulb23 c5e17d553e Bind caret blink to gdscript and properties
(cherry picked from commit dc90cba42e)
2016-05-12 09:05:46 +02:00
marcelofg55 2bd6e2402b OS.get_screen_size now returns the correct value on OSX
(cherry picked from commit b697de92ef)
2016-05-12 09:05:32 +02:00
Mattias Cibien c575f31d5d Added possibility to strip left and right to strip_edges (#4594)
(cherry picked from commit 49c473bb36)
2016-05-12 09:04:59 +02:00
Andreas Haas 6d50ccfd32 Joystick demo script cleanup
Removes a leftover variable and uses constants instead of magic numbers.

(cherry picked from commit 86b46c0b7e)
2016-05-12 09:04:41 +02:00
Paulb23 bd51dea8f6 Added caret blink in text editor
(cherry picked from commit e03e7deb1b)
2016-05-12 09:04:03 +02:00
Paulb23 abc97d3bb4 Fixed autocomplete truncate, issue 4554
(cherry picked from commit accc2a195b)
2016-05-12 09:03:59 +02:00
George Marques a5e54b83ec Add ignore error flag to OpenSSL driver
(cherry picked from commit 2e44e255ed)
2016-05-12 09:00:39 +02:00
Paulb23 18782aec61 Fixed autocomlete strings not appearing for function arguments
(cherry picked from commit 9e6234201b)
2016-05-12 09:00:22 +02:00
Alexander Holland f58cfaf585 fix percent decode utf8 error
(cherry picked from commit f86cffd8e6)
2016-05-12 08:59:30 +02:00
Paulb23 5d98718c28 Fixed animation player auto-queue duplication and undo/redo
(cherry picked from commit 488495852b)
2016-05-12 08:58:39 +02:00
Paulb23 7ab1c1ea3b Fixed code completion after opening bracket, issue 3977
(cherry picked from commit 0a2b341d0a)
2016-05-12 08:55:43 +02:00
Ariel Manzur f8debd8152 cloning env for builtin_openssl _and_ openssl :)
(cherry picked from commit baaa74f215)
2016-05-12 08:55:34 +02:00
Ariel Manzur ac06e3d4db clonning env for builtin ssl
(cherry picked from commit 62c17d65a8)
2016-05-12 08:55:28 +02:00
Rémi Verschelde b6be2f503d Rotation APIs: Better exposure for degrees methods
Made public the various set/getters for rotations in degrees.
For consistency, renamed the exposed method names to remove the leading
underscore, and kept the old names with a deprecation warning.

Fixes #4511.

(cherry picked from commit 4eab767a6f)
2016-05-12 08:55:14 +02:00
Daniel J. Ramirez b224407770 Partial documentation for OS methods
(cherry picked from commit ed7c0a6caf)
2016-05-06 11:14:59 +02:00
George Marques 7556391d20 Fix build for Windows 64-bits with GCC
(cherry picked from commit 81297f0fa1)
2016-05-06 11:14:53 +02:00
Juan Linietsky 23c659fc47 -make sure single select after multi select works better
-fixed some warnings for OSX

(cherry picked from commit f909634832)
2016-05-06 11:14:11 +02:00
George Marques 4832731477 Fix memory leak
As pointed out by @sanikoyes in #4541.

(cherry picked from commit 5930408746)
2016-05-06 11:13:41 +02:00
Ignacio Etcheverry 19f08eaa5b Fix wrong return and argument types in documentation
(cherry picked from commit 1e752c0120)
2016-05-06 11:13:35 +02:00
Ignacio Etcheverry 975b4d2927 Add missing Vector2Array case to Variant::operator String()
- Correcly display Vector2Array default arguments in the documentation

(cherry picked from commit 2060e6616c)
2016-05-06 11:13:25 +02:00
Hinsbart 913818a246 Fix ds3 gamepad mapping
(cherry picked from commit d6cd5108e3)
2016-05-06 11:12:44 +02:00
Daniel J. Ramirez 4a4999451b Changed barely visible PROPERTY_HINT_ALL_FLAGS buttons for checkboxes
(cherry picked from commit 723c0d730c)
2016-05-06 11:12:38 +02:00
George Marques 4f57e532b8 Fix windows 64-bits build.
The change in `tools/doc/doc_data.cpp` is needed because the MSVC
compiler does not support variable length arrays.

Fix #4113

(cherry picked from commit 9424c6c58f)
2016-05-06 11:12:31 +02:00
Aleksandar Danilovic 3449c81bdb Fixes 64 bit MSVC builds, disables bits parameter
Also Enables automatic detection of architecture for the MSVC compilers.
Builds without assembly optimisations for x64
Closes issue #3098

Signed-off-by: Aleksandar Danilovic <greatgames.alexandar@gmail.com>
(cherry picked from commit 7762e1afe6)
2016-05-06 11:12:23 +02:00
mrezai 05857a5472 Update OpenSSL to 1.0.2h
(cherry picked from commit ab623c923d)
2016-05-06 11:11:21 +02:00
Paulb23 ec3b50fd65 Autocomplete no longer shows duplicates, issue 1824
(cherry picked from commit 084d0bef96)
2016-05-06 11:11:14 +02:00
CowThing f95918e05a Input Documentation
Input Documentation

(cherry picked from commit f6ae5e41de)
2016-05-06 11:11:09 +02:00
Mattias Cibien b3404c8c44 Fixed behavior of OS.set_window_resizable
Should fix #4428.
 * Minimize button is not hidden anymore
(cherry picked from commit 8fb7280f39)
2016-05-06 11:10:57 +02:00
Daniel J. Ramirez 7e077258c5 Fixed documentation generator for polymorphic functions
(cherry picked from commit 57d0b78426)
2016-05-06 11:10:48 +02:00
Daniel J. Ramirez fb3d10c579 Documented bool methods
(cherry picked from commit 3ca1d0f1d5)
2016-05-06 11:10:41 +02:00
Daniel J. Ramirez 0b75c39c2b Documented float
(cherry picked from commit 520e6f5b09)
2016-05-06 11:10:34 +02:00
Daniel J. Ramirez e0a13981fc Documented int methods
(cherry picked from commit 4453284388)
2016-05-06 11:10:28 +02:00
CowThing bdbb831261 Finished AnimationPlayer Documentation
(cherry picked from commit abf5f8c586)
2016-05-06 11:09:51 +02:00
Ignacio Etcheverry 97e30f4cd7 Fix checking unsaved changes only in current scene
(cherry picked from commit 107e62be70)
2016-05-06 11:07:46 +02:00
CowThing 78dc8e79c4 Documented YSort (#4515)
Documented YSort
(cherry picked from commit 957c265f11)
2016-05-06 11:07:25 +02:00
Rémi Verschelde 40681d90e5 Debugger: Fix breaked signal binding (#4508)
Closes #4270.
(cherry picked from commit 8ceab5ddaf)
2016-05-06 11:07:17 +02:00
Daniel J. Ramirez fbb8a2170c Documented ColorRamp
(cherry picked from commit c2bdb3727b)
2016-05-06 11:07:03 +02:00
Daniel J. Ramirez e8a972197c Partial documentation for Particles2D
(cherry picked from commit 3cd58fe0ba)
2016-05-06 11:06:56 +02:00
Bojidar Marinov 047767b824 Document Popup, PopupDialog, PopupMenu, and PopupPanel
(cherry picked from commit 5cdf4a6379)
2016-05-06 11:06:49 +02:00
Rémi Verschelde ef2f1ae811 Tabs: Fix align issue with right/close buttons
The stylebox around the close button was badly centered.
There were also bad margins applied when using right buttons.

(cherry picked from commit 21c181bd3c)
2016-05-06 11:06:42 +02:00
Rémi Verschelde 7c419032c7 Tabs: cleanup code, no functional change
Some dead code removed, a few cosmetic changes.

(cherry picked from commit 8b32c80529)
2016-05-06 11:06:35 +02:00
Rémi Verschelde 9bdcc97e56 Tabs: Fix navigation buttons overlap when resizing
It was not taking into account the minimum width of the stylebox.
Fixed by factorizing some duplicate code.

(cherry picked from commit 8574489dd2)
2016-05-06 11:06:29 +02:00
Rémi Verschelde 7f80fce464 Tabs: Fix icon size not taken into account for offset
Fixes #4107.

(cherry picked from commit bbaf296948)
2016-05-06 11:06:22 +02:00
Rémi Verschelde ea9b552e27 Variant: readd Dict.has_all
Erroneously removed in 4bc494ae2e.
2016-05-06 10:56:39 +02:00
Juan Linietsky 21ab3a030e missing default value 2016-05-05 18:44:29 -03:00
Juan Linietsky a14ff27337 fix to avoid video texture scaling 2016-05-05 18:44:20 -03:00
Juan Linietsky d6e30256ad ability to shrink all images x2 on load
this is for extreme cases when running on devices with very low video
memory, so you can still retain compatibility.
2016-05-05 18:43:47 -03:00
Ariel Manzur 4bc494ae2e export fix_alpha_edges 2016-05-05 18:42:55 -03:00
Rémi Verschelde d49fff6246 FileDialog: reset mkdir label after use (#4500)
Closes #1686.
(cherry picked from commit ab7886ffc4)
2016-05-01 12:28:27 +02:00
Rémi Verschelde d29087cc53 OSX: Fix lib suffix for Android lib (#4499)
Fixes #1452.
(cherry picked from commit 94274b9ab5)
2016-05-01 12:28:20 +02:00
Rémi Verschelde 27461a79dc GridMap: Fix backwards rotate hotkeys (#4498)
Fixes #1237
(cherry picked from commit 8259c46707)
2016-05-01 12:28:14 +02:00
Rémi Verschelde a86cfc258e AnimationPlayer: Prevent resetting timeline when pinned (#4497)
Fixes #1019
(cherry picked from commit 0b4f277184)
2016-05-01 12:28:07 +02:00
Rémi Verschelde 26c2e0d09d math: Fix rounding error for 0 in Math::round (#4495)
Thus revert the previous workaround in commit b123bc4a2a.
Fixes #3221.
(cherry picked from commit 6883325f92)
2016-05-01 12:28:01 +02:00
Rémi Verschelde 0b49d78a3f Project manager: unescape project names (#4494)
Fixes #3609
(cherry picked from commit 78adbf4790)
2016-05-01 12:27:54 +02:00
volzhs 40b546fb83 Allow any directory for custom character set and gradient image file when import font
fix #4486

(cherry picked from commit b172cb524d)
2016-05-01 12:27:43 +02:00
Rémi Verschelde 3c453b7bd2 Ignore invalid folders in `platform`
Fixes #4479

(cherry picked from commit f938793e78)
2016-05-01 12:27:14 +02:00
George Marques f033763700 Implement OS.get_process_ID for Windows
Based on code by @ratsdiov.
Closes #1733

(cherry picked from commit 2cd8e86aa0)
2016-05-01 12:27:04 +02:00
Rémi Verschelde 944ac2500a classref: Sync with source 2016-04-29 18:12:33 +02:00
Geequlim b4adb0d338 Add more documentations for this classes:
* BoxContainer
* CenterContainer
* ScrollContainer
* SplitContainer
* Vector2
* StringArray
* FileDiloags

(cherry picked from commit a518792d89)
2016-04-29 18:06:09 +02:00
Ariel Manzur 227604a566 Fix launching from .app on OSX
(cherry picked from commit 6962fd91c6)
2016-04-29 18:05:39 +02:00
Bojidar Marinov 70644301dd Allow dragging on only one (global) axis when holding down shift
Closes #1723

(cherry picked from commit d82ff4ed09)
2016-04-29 18:02:27 +02:00
Paulb23 4228505cf0 Shader editor now uses text editor settings
(cherry picked from commit 64751e0a75)
2016-04-29 18:02:19 +02:00
Rémi Verschelde 9086a929b2 Specify the demos license
It was already under the MIT as the rest of the engine,
but some users seemed not convinced about it.
(cherry picked from commit fa3240a8e9)
2016-04-29 18:02:10 +02:00
Geequlim 5365ae9212 Add more documentations and fix AcceptDialog::add_cancel
(cherry picked from commit 5c61e17c10)
2016-04-29 18:02:03 +02:00
Geequlim a3fd381a4f Fill in the blank in the Array, CenterContainer and Dictionary class reference (#4476)
(cherry picked from commit 4de3f8944e)
2016-04-29 07:44:23 +02:00
Daniel J. Ramirez d81ffaf2ab Documentation for Canvas Modulate, ColorPicker, ColorPickerButton
(cherry picked from commit faf21b81e8)
2016-04-29 07:43:43 +02:00
Paulb23 c77a5f910e Fixed shader editor syntax coloring
(cherry picked from commit bda5ea0871)
2016-04-29 07:43:30 +02:00
eska 91461b588d Move export GUI debug toggle to export settings window
(cherry picked from commit ab4caa7953)
2016-04-29 07:43:23 +02:00
Hinsbart 3a3f56689e More precise InputMap Axis descriptions in project settings.
Now it's "Left Stick {Up, Down, Left, Right}" instead of just "Left Stick" repeated 4x.

(cherry picked from commit 418049b741)
2016-04-29 07:43:16 +02:00
Daniel Ramirez 35e05b092c Partial documentation for Polygon2D and Raycast2D (#4467)
(cherry picked from commit 9f29b4b26a)
2016-04-29 07:43:09 +02:00
Rémi Verschelde 238bbb6539 Classref: Document Button and ButtonArray
Also bind relevant constants and define some object types and better
argument names for the docs.

(cherry picked from commit 3a4ec88b37)
2016-04-29 07:42:59 +02:00
Daniel J. Ramirez 946ef8d478 GridContainer, CheckBox documentation, descriptions for Vector2 and CenterContainer.set_use_top_left
(cherry picked from commit a5b4c1d64f)
2016-04-29 07:42:48 +02:00
Alexander Holland d3ee8de754 fix - HTTPClient connection keep-alive duplicate Headers #4208
(cherry picked from commit 6ad226ac38)
2016-04-29 07:42:40 +02:00
Paulb23 517518ae9a Added scroll lines, issue 4243
(cherry picked from commit 54244e0e1d)
2016-04-29 07:42:08 +02:00
Rémi Verschelde 084ce221d7 NACL removal: fix leftover 2016-04-27 23:17:18 +02:00
Jan Heemstra e38666b76a fixed some mistakes in WeakRef documentation
(cherry picked from commit e301ca3544)
2016-04-27 20:19:52 +02:00
Jan Heemstra 6f76eca883 Documented WeakRef and member functions
(cherry picked from commit edff81c214)
2016-04-27 20:19:46 +02:00
Julian Murgia - StraToN d183a5361f Documented Node2D
(cherry picked from commit 87aa128228)
2016-04-27 20:19:37 +02:00
Rémi Verschelde 11aa0d1405 Various improvements to doc_status.py
- Make comments opt-in (smaller table in width)
- Reduce length of Brief Description and Description (also smaller table as output)
- Make names cyan (blue is too dark on black terminal)
- Drop some redundant synonyms for the flags

(cherry picked from commit 034d6e811f)
2016-04-27 20:19:30 +02:00
Julian Murgia 6efe8818a7 Edited classes.xml : GraphEdit finished (#4450)
(cherry picked from commit 81e405545b)
2016-04-27 20:19:20 +02:00
Rémi Verschelde 9023a84a93 Remove last NACL references
(cherry picked from commit d3811b490d)
2016-04-27 20:19:12 +02:00
Rémi Verschelde 1bd2145e34 Drop NACL platform
It's no longer maintained and Chrome-specific, so it's not a viable solution
to deploy Godot games in browsers. The current prefered alternative is asm.js
(platform/javascript), and we're looking forward to WebAssembly.

(cherry picked from commit ec606f94dc)
2016-04-27 20:18:59 +02:00
Rémi Verschelde 382a8250ba Drop obsolete WIP for Flash platform
It was apparently never fully functional and has not been maintained.
Flash itself is nowadays clearly a deprecated technology, so there will
not be further work on it. platform/javascript and the upcoming
WebAssembly technologies should have a brighter future.

(cherry picked from commit f368d380e7)
2016-04-27 20:17:37 +02:00
Paulb23 73296a9a6d Trim trailing white space on save, issue 4383
(cherry picked from commit f3e6569e00)
2016-04-27 20:17:25 +02:00
Hinsbart 93b1f60ca2 Encode axis_value in Variant for InputEvent::JOYSTICK_MOTION.
Fixes a bug that caused InputMap actions which have been set to joystick axes
not to work correctly on exported builds as the axis_value property wouldn't be serialized into engine.cfb.
See recent discussion in #49 (Post 121+)

(cherry picked from commit 9201b5a27c)
2016-04-27 20:17:13 +02:00
Bojidar Marinov 7f4387d21e Fix continious update with Camera2D
Closes #4406

(cherry picked from commit b2e0cedbf0)
2016-04-27 20:17:07 +02:00
Bojidar Marinov c0748bad06 Add a python script to check the current doc status
(cherry picked from commit c9340cdcc6)
2016-04-27 20:17:00 +02:00
Hinsbart 94b321822d add sign comparison for joystick axis events in InputMap::_find_event
fixes #4400

(cherry picked from commit 3b12f9ea82)
2016-04-27 20:16:51 +02:00
Bojidar Marinov c523749662 Fix Camera2D ignoring zoom when checking limits
Closes #1912

(cherry picked from commit 7a8aea0be9)
2016-04-27 20:16:08 +02:00
eska 0f47311610 Add fallback to legacy KeyboardEvent in web export
Fallback to KeyboardEvent property `charCode` is absence of both `key`
and `char` for retrieval of unicode value.

(cherry picked from commit 45b90f16ca)
2016-04-27 20:16:01 +02:00
Bojidar Marinov 4c358b7043 Add preview of the Camera2D's screen boundaries
Closes #3365

(cherry picked from commit e7f66a88d6)
2016-04-27 20:15:46 +02:00
eska 98b30e3aff Reimplement key input events in Emscripten export
Scancodes work, but unicode values are now completely broken in some
browser/OS combinations.

(cherry picked from commit 0e9eefb7d4)
2016-04-27 19:42:31 +02:00
volzhs 9f5c6cf950 remove unused resources and add korean locale for android
- remove unused resources in platform/android/java/res/values/strings.xml
- add korean language resource for apk expansion download screen

(cherry picked from commit e94e710893)
2016-04-27 19:42:22 +02:00
Zher Huei Lee 07fc330241 Fixed zero-length arrays in nrex. Fixes #4346
(cherry picked from commit 48b2dfab9f)
2016-04-27 08:50:36 +02:00
Alex c712e54b63 tiny fix to loop restart (#4358)
Closes #4355
(cherry picked from commit e566b17f91)
2016-04-27 08:50:28 +02:00
Ignacio Etcheverry 6a2efc48c5 Fix 'Quit to Project Manager' not stopping the running application
(cherry picked from commit e48c07750f)
2016-04-27 08:50:09 +02:00
Bojidar Marinov ff1d370b9f Fix File.get_csv_line not including quoted newlines in the output
Close #1232

(cherry picked from commit 7a18bb8ace)
2016-04-27 08:50:03 +02:00
eska e654184888 Always set default clear color
(cherry picked from commit 0ee8b74101)
2016-04-27 08:49:56 +02:00
mrezai cabb80ecf4 Add openssl=builtin to build command in .travis.yml
(cherry picked from commit 1db2759f5e)
2016-04-27 08:49:45 +02:00
mrezai 3efa0f130d Update OpenSSL to version 1.0.2g
(cherry picked from commit e97922f220)
2016-04-27 08:49:39 +02:00
Saracen 47c7b535d2 BoneAttachments now position themselves instantly during bind.
(cherry picked from commit bc5ee6c98f)
2016-04-27 08:49:30 +02:00
Hearto Lazor 5fac497aa2 Fixed curve baking, now always start at origin point
(cherry picked from commit 08b93da28a)
2016-04-27 08:49:23 +02:00
volzhs 4bfcd14a6a correct typo "overwrite"
(cherry picked from commit 86c6326057)
2016-04-27 08:48:43 +02:00
Ignacio Etcheverry dbcf969fbf Keep editable instances data when replacing tree root node
(cherry picked from commit 3029f5ee02)
2016-04-27 08:48:34 +02:00
Ignacio Etcheverry 52bf4a76b2 x11: Flush the X output buffer after changing mouse mode
(cherry picked from commit 5907a007dc)
2016-04-27 08:48:23 +02:00
Marc Gilleron f32a4dc516 Made trackpad behaviour optional in 3D mode (issue #4265)
(cherry picked from commit 84d706cb35)
2016-04-27 08:44:40 +02:00
Marc Gilleron a0b6645858 Fixed #4163 (intersect_shape crashes on results limit)
(cherry picked from commit d239e6bc0e)
2016-04-27 08:44:31 +02:00
mrezai b24c3be564 Update OpenSSL to version 1.0.1s
(cherry picked from commit c860574d8b
and commit 2cbd850979)
2016-04-27 08:43:39 +02:00
Saracen b2b5c495e1 Subclasses can now extend from other subclasses contained in scripts derived from relative paths.
(cherry picked from commit d643a40f95)
2016-04-27 08:42:48 +02:00
Paulb23 e367c6cdd8 Fixed undo redo interaction with find replace
(cherry picked from commit 189b306722)
2016-04-27 08:42:23 +02:00
Paulb23 b5a438413a Setting to change line number color
(cherry picked from commit 8c328474f2)
2016-04-27 08:42:18 +02:00
Zher Huei Lee f4ebba513a Updated nrex to v0.2
* Fixed capturing groups matching to invalid results
 * Fixed parents of recursive quantifiers not expanding properly
 * Fixed LookAhead sometimes adding to result

(cherry picked from commit 6207d56b95)
2016-04-27 08:42:12 +02:00
Ignacio Etcheverry 40d21117f9 Fix RayCast not updating when debugging collissions
(cherry picked from commit 6cf3bdcf76)
2016-04-27 08:42:01 +02:00
Ignacio Etcheverry e120e2265b CanvasItemEditorPlugin: Avoid selecting items from instanced scenes
- This behaviour is only applied to click selection. Rect selection and List selection can still select these items

(cherry picked from commit fab57f2fbc)
2016-04-27 08:41:51 +02:00
Rémi Verschelde 8746966194 Doc: fix type of stream object
(cherry picked from commit 7820e590ea)
2016-04-27 08:40:49 +02:00
sanikoyes 76eeb457d3 Fix warn print when hide an control does not inside_tree
(cherry picked from commit 5ec7d3f264)
2016-04-27 08:40:38 +02:00
sanikoyes 02afea1e4e Fix crash when tween control object previous freed
(cherry picked from commit da28a2f062)
2016-04-27 08:40:19 +02:00
Bojidar Marinov 692878b7f4 Fix Ctrl+LaunchMedia showing up as a shortcut for "Make Bones"
Close #4044

(cherry picked from commit 4af1839073)
2016-04-27 08:38:28 +02:00
Paulb23 b7f5418f8d Ability to change the caret color
(cherry picked from commit c7519f091d)
2016-04-27 08:37:20 +02:00
Alexander Holland d4d810faac dictionary has_all
(cherry picked from commit a8ebd43ab7)
2016-04-27 08:36:08 +02:00
punto- 3a390e9b44 Update vector.h
using non-templated neares_power_of_2
2016-04-11 03:34:10 -03:00
Rémi Verschelde 5d63f4e758 Sync classref with source 2016-04-07 21:30:22 +02:00
Rémi Verschelde cbac9a2ca3 Remove duplicate
(cherry picked from commit 473de561f8)
2016-04-07 21:28:28 +02:00
Rémi Verschelde 837d50714a Version 2.0.2 2016-04-07 08:34:27 +02:00
Paulb23 bb6cfc130b Option to toggle syntax highlighting
(cherry picked from commit d78e98e2a4)
2016-04-06 19:39:36 +02:00
Paulb23 b3891246e5 Fixed block indent inconsistency, fixes issue 3803
(cherry picked from commit 93700676b5)
2016-04-06 19:39:30 +02:00
Rémi Verschelde 00566a8592 Revert "free Material 'shadow_material_double_sided' on ::finish()"
This reverts commit 43c74056b1.
2016-04-06 19:37:16 +02:00
Bojidar Marinov 63e33cfdd2 Add a `sleeping_state_changed` signal to RigidBody and RigidBody2D classes
Closes #3911

(cherry picked from commit 6dcd1354c2)
2016-04-06 18:49:51 +02:00
Bojidar Marinov dea6671d58 Bind Z key (without modifiers) to toggle wireframe in 3D view
Fixed #4124

(cherry picked from commit 8ee8802cbe)
2016-04-06 18:49:26 +02:00
Paul Batty 7c6d2e7062 Fixed text edit undo and redo operation interaction
(cherry picked from commit 646e089782)
2016-04-06 18:48:31 +02:00
SaracenOne eb927383f2 Fixes errors occurring when switching to a new scene with a spatial editor from a canvas editor.
(cherry picked from commit f303e3483d)
2016-04-06 18:48:25 +02:00
sunnystormy 5c98674a8b Added rotation/panning support for trackpads in 3D mode #53
(cherry picked from commit 3ebde34d8f)
2016-04-06 18:48:05 +02:00
Paulb23 4bde902de1 Fixed 'complex' typo in method name
(cherry picked from commit 971c3be52d)
2016-04-06 18:47:34 +02:00
Paulb23 a5f07d18ec Fixed undoing twice when removing selection
(cherry picked from commit 15f43149e1)
2016-04-06 18:47:28 +02:00
Rémi Verschelde 71da9a1a23 Separate help pages from scripts by default
Fixes #4199
(cherry picked from commit 9c89d3e042)
2016-04-06 18:47:22 +02:00
Luiz Paulo de Vasconcellos 44daccc861 Change toggle comment behaviour. Fixes #4198
(cherry picked from commit 1b6f14d810)
2016-04-06 18:47:18 +02:00
MSC 4220ffbd8e memdelete 'joy_thread' + 'joy_mutex' on ::~joystick_linux()
(cherry picked from commit 391095e0ef)
2016-04-06 18:46:53 +02:00
MSC 43c74056b1 free Material 'shadow_material_double_sided' on ::finish()
(cherry picked from commit 7a9998370f)
2016-04-06 18:46:46 +02:00
Paulb23 48438e4f3b Fixed insert mode interaction with auto complete
(cherry picked from commit a984adb5a6)
2016-04-06 18:46:36 +02:00
Paulb23 5f901e2b27 Fixed insert mode removing first unselected character
(cherry picked from commit fe779d4386)
2016-04-06 18:46:32 +02:00
Paulb23 22ef9673dd Added insert mode to text editor
(cherry picked from commit 2b57cb94da)
2016-04-06 18:45:56 +02:00
Zher Huei Lee 5b1aa3a5cd Progress bar minsize now checks percent_visible
Allows for really thin progress bars such as for pixel-art styles.

(cherry picked from commit 0bba09c4cb)
2016-04-06 18:45:33 +02:00
Rémi Verschelde f06f574735 Fix building against 2.0 API
812de22 used a method from the new plugin API in master,
so it failed building.
2016-04-02 23:11:38 +02:00
blubee aac3b9db5c Add support for gnu-libstc++-4.9 needed by recent NDK versions
The 4.9 version is the default one, people can still build using 4.8
with older NDK versions by setting the (optional) NDK_TARGET
and NDK_TARGET_X86 environment variables.

(cherry picked from commit a0fb5b5f95)
2016-04-02 23:05:18 +02:00
Rémi Verschelde 9fdc1279cc Make hardcoded Mac version 2.0.x
To avoid having to bump it up every time.
2016-04-02 22:22:38 +02:00
Paul Batty 01471e4c09 Function syntax highlighting
(cherry picked from commit 50aa78210c)
2016-04-02 22:19:54 +02:00
Rémi Verschelde bac8248316 Remove trailing spaces
(cherry picked from commit 0a5472e697)
2016-04-02 22:19:40 +02:00
Rémi Verschelde 69e67d51c7 Port 2D demos to TSCN/TRES formats
Part of #4196.

(cherry picked from commit 23cf6a85bd)
2016-04-02 22:19:30 +02:00
Rémi Verschelde c6ccd05fed Fix last two bindings in input_mapping demo
Also connect the signal from script, as it makes it easier to understand
than by having to check the connected signals via the GUI.

(cherry picked from commit 4eb49cc732)
2016-04-02 22:15:58 +02:00
Paulb23 937a96b26b Option to toggle line numbers
(cherry picked from commit 474911c533)
2016-04-02 22:15:38 +02:00
Maxwell Huang-Hobbs a52b1e866d inherit PKG_CONFIG_PATH from environment
(cherry picked from commit 32391ffd73)
2016-04-02 22:15:32 +02:00
Josh Grams fed11a662a doc/base/classes.xml: String.match, Node.find_node
Clarify wildcard behavior.

(cherry picked from commit ef08fed277)
2016-04-02 22:15:20 +02:00
Paulb23 26f2b7415c Fixed numbers not highlighting after space
(cherry picked from commit cd07badee3)
2016-04-02 22:15:11 +02:00
Paulb23 729dc5da83 Stopped save scene flicker, issue 4118
(cherry picked from commit 9d74b76a69)
2016-04-02 22:15:06 +02:00
sanikoyes 54625bb771 Fix GDScript crash when call show/hide in func _exit_tree
(cherry picked from commit 0c6f089ce4)
2016-04-02 22:14:49 +02:00
Paulb23 523625a3d1 Syntax highlighting for numbers
(cherry picked from commit c844c2d604)
2016-04-02 22:14:27 +02:00
Rémi Verschelde 5caf6ad8b9 Expose android/shutdown_adb_on_exit parameter and default to true
It was added in 30d0ca9 for the Steam build but only enabled
when parsing a ._sc_ file that would define it.
It is now available for all users to toggle, in and outside of Steam.

Fixes #4073.

(cherry picked from commit c584940387)
2016-04-02 22:14:20 +02:00
Ignacio Etcheverry 7ddc17b18e BoxContainer: Bind method add_spacer(bool)
(cherry picked from commit 0571f961a8)
2016-04-02 22:13:58 +02:00
Ignacio Etcheverry cf0a586a3e TextEdit: Fix Shift+Delete shortcut not calling cut()
(cherry picked from commit abb720438f)
2016-04-02 22:13:26 +02:00
demolitions 41cc4ffe98 Fixes #3942 - Throws an error when exporting for X11 with no filename
(cherry picked from commit fb58bafc54)
2016-04-02 22:13:14 +02:00
Bojidar Marinov 0ea354c12a Fix issues with tilemap covering child nodes and old quadrants
Closes #4070

(cherry picked from commit 2a581835ca)
2016-04-02 22:12:53 +02:00
demolitions 2bc4049b9b Fix for #4014, changed to 2 instead of 3 chars to trigger search
(cherry picked from commit 4e59d1c51f)
2016-04-02 22:12:41 +02:00
Paulb23 64a8fe6ad7 Option to toggle tab drawing
(cherry picked from commit 0fc7be89d3)
2016-04-02 22:12:29 +02:00
sanikoyes 05c620b7ad Add -r flag to adb install for keep app user data
(cherry picked from commit 9e026fecef)
2016-04-02 22:12:12 +02:00
Saracen ca1ca6c7df Fix cursor getting locked on tree control if tree is cleared while modifying numerical element.
(cherry picked from commit 44fe74bfc3)
2016-04-02 22:12:02 +02:00
Paulb23 1369b38d85 Fixed highlighting when word occurs as substring first
(cherry picked from commit 9c0e1524e5)
2016-04-02 22:11:37 +02:00
Paulb23 68b7f9d87a Fixed highliting with shift and mouse
(cherry picked from commit 4cc3fbeaff)
2016-04-02 22:11:30 +02:00
Paulb23 8a78112e5b Highlight all occurrences of selected word
(cherry picked from commit b0488cacf2)
2016-04-02 22:10:41 +02:00
Franklin Sobrinho 41326781d2 Fix editors panels, of the bottom panel, not resizing in some cases
(cherry picked from commit 4a0f835ece)
2016-04-02 22:10:31 +02:00
Ignacio Etcheverry cacf7d136f LineEdit/TextEdit: Add Shift+Delete shortcut for cut
(cherry picked from commit fac027cb14)
2016-04-02 22:10:20 +02:00
Ignacio Etcheverry a701c6ff68 TextEdit: Fix inconsistent copy, cut and paste behaviour
(cherry picked from commit 4dfd0c1863)
2016-04-02 22:10:15 +02:00
Franklin Sobrinho 812de22194 Fix file dialog, of Particles2D plugin, showing "Error" icons
(cherry picked from commit 8d2a957e36)
2016-04-02 22:09:33 +02:00
Franklin Sobrinho 8de0405032 Automatically create input node when creating a ShaderGraph
(cherry picked from commit 5ee67ba498)
2016-04-02 22:09:26 +02:00
Franklin Sobrinho e59c0610ca Fix crash when importing sub-scenes
(cherry picked from commit cb7db2d430)
2016-04-02 22:09:01 +02:00
Paulb23 8fd4c78caf Added configuable tab size
(cherry picked from commit 9234bd3ff9)
2016-04-02 22:08:41 +02:00
Brandon DeRosier 85820434de Correct spot light size conversion in Blender exporter.
The collada falloff angle is the angle from the center of the spot
light projection, whereas Blender's point light size is the angle from
one side to the opposite, meaning it's twice as much.

(cherry picked from commit 1f4a214987)
2016-04-02 22:08:23 +02:00
Saracen d0151daa69 Undo and redo commands on text editor now affect internal version which fixes inconsistent file saving validation.
(cherry picked from commit b2e471fd7c)
2016-04-02 22:07:40 +02:00
Rémi Verschelde 763b29ed18 Remove redundant buttons
Now the Load button is alone on its line,
we probably need to find it a better place.

(cherry picked from commit d36333b648)
2016-04-02 22:06:37 +02:00
Rémi Verschelde 1d096471dc Add stop and delete buttons to sample library
Based on the work by @rdcklinux in #3339.
The play button becomes a stop button while playing.
A delete button is added in the last column.

(cherry picked from commit 533b9b7342)
2016-04-02 22:06:30 +02:00
sanikoyes 7c44cbee67 Fix link error when disable_3d=yes
(cherry picked from commit a638af886e)
2016-04-02 22:05:49 +02:00
Ignacio Etcheverry d950a13c10 TileSet Export: Avoid invalid error when merge is enabled but file does not exist
(cherry picked from commit 897b33ce77)
2016-04-02 22:05:36 +02:00
Ignacio Etcheverry 6ce273b329 Fix crash when resizing ConcavePolygonShape2D segments
(cherry picked from commit 3fc16d4025)
2016-04-02 22:04:41 +02:00
Josh Grams 0635a639e9 TimeScale node: return +inf remaining for 0 scale.
(cherry picked from commit 65b7791263)
2016-04-02 22:04:35 +02:00
Hubert Jarosz 424a104666 remove trailing whitespace
(cherry picked from commit 4a4f247914)
2016-04-02 22:03:48 +02:00
Josh Grams 830947feaf AnimationTreePlayer: distinguish value tracks.
If the node had a 3D Transform, the transform would always get written,
even if the tracks on that node were supposed to be value tracks.

(cherry picked from commit 2fa200ff53)
2016-04-02 22:00:40 +02:00
Josh Grams ee20365f7c Variant::blend: add Quat, fix Vector3.
(cherry picked from commit f7fad32188)
2016-04-02 22:00:18 +02:00
RegalMedia 0a24f562fb Update version in Info.plist
Getting info on Godot.app still shows version 1.0.0.  Would be nice to have this reflect the real version number via the build system.
(cherry picked from commit 3d9e26bfce)
2016-04-02 21:59:49 +02:00
Josh Grams 60e4cfbcb7 TimeScale node: scale return value (time remaining).
(cherry picked from commit 2e1b1234a3)
2016-04-02 21:59:07 +02:00
hondres 656aa0a501 fix InputMap::action_erase_event()
fixes #3976

(cherry picked from commit 9544042adb)
2016-04-02 21:58:26 +02:00
volzhs 7ad50eaea8 This will disable png arm neon optimizing for android template if compile on windows, but make compiling successful.
And arm neon opt is enabled if not on windows.

(cherry picked from commit db89a47e28)
2016-04-02 21:58:09 +02:00
Hubert Jarosz 83887ae16d migrate to container-based Travis CI
(cherry picked from commit 1f83ae9b5a)
2016-04-02 21:57:38 +02:00
hondres 827f4a895a osx: fix inverted horizontal scrolling
(cherry picked from commit 02eddbf7da)
2016-04-02 21:57:26 +02:00
Paulb23 da356eca0f Enabled scrolling past end of file
(cherry picked from commit f19eea2f2d)
2016-04-02 21:57:10 +02:00
Rémi Verschelde 53aa9cd51a Release 2.0.1 2016-03-06 19:05:45 +01:00
Rémi Verschelde 706d576f7b Add support for patch versions (2.0.x) 2016-03-06 19:05:27 +01:00
Franklin Sobrinho 226e0a7f4f Fix Project Settings dialog add/delete global variable
(cherry picked from commit 48524384d6)
2016-03-06 18:07:42 +01:00
hondres c44060bb82 doc: fix joystick left/right trigger axis description (index 6/7 instead of 4/5)
(cherry picked from commit 1b806ef54e)
2016-03-06 18:06:47 +01:00
Martin Chuckeles 4fee5f3915 Add more verbose build-in functions descriptions
Add descriptions for some global constants

(cherry picked from commit ff7c89ebaf)
2016-03-06 10:39:21 +01:00
Franklin Sobrinho e69c9021b5 The help page now show the entire object hierarchy
(cherry picked from commit fdd1209276)
2016-03-06 09:48:26 +01:00
Franklin Sobrinho edb3716da7 Fix Sprite doesn't updating region_rect value in certain conditions
(cherry picked from commit 1d188c1c7b)
2016-03-06 09:48:20 +01:00
Franklin Sobrinho 1bdd5d24cb Removed "__editor_plugin_screen__" metadata creation
(cherry picked from commit b79e83ad6f)
2016-03-06 09:48:15 +01:00
Franklin Sobrinho a1a1c0b9f6 Added search box in Class List dialog (Script Editor)
(cherry picked from commit cc6a6ef08c)
2016-03-06 09:48:06 +01:00
Martin Chuckeles 450a7a9120 Write GDScript documentation
(cherry picked from commit cd1184d56c)
2016-03-05 15:12:24 +01:00
Zher Huei Lee c850fa7331 Added relative paths for DirAccess::remove()
Follows similar behaviour to DirAccess::rename()

(cherry picked from commit d7052ddba3)
2016-03-05 13:35:48 +01:00
hondres afd75013f9 html5: workaround for echo key events.
(cherry picked from commit 352db6b17e)
2016-03-05 13:35:36 +01:00
Martin Chuckeles 848c7378fd Add editor settings for call hint placement
Added settings: text_editor/put_callhint_tooltip_below_current_line
and text_editor/callhint_tooltip_offset

(cherry picked from commit 47206b409d)
2016-03-05 12:58:01 +01:00
Martin Chuckeles 4b2fcabb74 Hide hint if completion is active
(cherry picked from commit 26cc14e839)
2016-03-05 12:57:56 +01:00
Martin Chuckeles cb7693c533 Move the call hint under the current line
(cherry picked from commit 03025f60b6)
2016-03-05 12:57:52 +01:00
Stabington 7fea990b1b set_time_scale docs
This is correct?

(cherry picked from commit 6b7ec5de69)
2016-03-05 12:56:27 +01:00
volzhs 95e46e6eac fix gradle build on windows
(cherry picked from commit d6cc887627)
2016-03-05 12:56:19 +01:00
Josh Grams bea8e1654e AnimationTreePlayer (Blend3): process all inputs.
Always call _process_node on all three inputs so that looped animations
don't get out of sync.

(cherry picked from commit b79351aa45)
2016-03-05 12:55:54 +01:00
Josh Grams cafcdb015d AnimationTreePlayer: blend value tracks (closes #2299)
Variant:
- zero() sets a Variant to the appropriate type of zero value
- blend() blends part of one Variant on top of another.

(cherry picked from commit 391ce81c5e)
2016-03-05 12:55:43 +01:00
Rémi Verschelde 459b914d9c Quick fixes to tween documentation formatting
Maybe the reST parser should be improved instead though ;)

(cherry picked from commit a12c63ef9e)
2016-03-01 08:38:23 +01:00
Rémi Verschelde 9ed3d21d5a Sync classes 2016-03-01 08:25:04 +01:00
hinsbart 82d06b0027 use joystick name from mapping-db if available 2016-03-01 08:16:27 +01:00
Ariel Manzur e0a66b6e56 deleted files added accidentally
(cherry picked from commit 96b60c281f)
2016-02-29 09:03:31 +01:00
Bojidar Marinov 186b82c350 Document Tween class
(cherry picked from commit 49e1cc6fa9)
2016-02-29 09:03:06 +01:00
Rémi Verschelde 1af2e1101d Remove grey capsule on official logo
It had been added by a contributor without prior discussion
with the rest of the team, but the grey capsule did not look
so good. Closes #3848.

Also renamed godot_{icon,logo} to just {icon,logo}.

(cherry picked from commit eb5f9ed89b)
2016-02-29 09:01:02 +01:00
Rémi Verschelde a55f41e3d9 screen_shaders: convert demo images to JPG
(cherry picked from commit a97c1ca8f9)
2016-02-29 09:00:55 +01:00
Rémi Verschelde 439e29ea95 normalmap demo: convert images to JPG
To make the demos lighter

(cherry picked from commit 2fd177b2a5)
2016-02-29 09:00:48 +01:00
Rémi Verschelde f5e8e89f50 Remove Noto Sans font from translation demo (heavy!)
(cherry picked from commit 0f087755cc)
2016-02-29 09:00:43 +01:00
Ariel Manzur f619b05751 added [presets] to ._sc_ and "android/shutdown_adb_on_exit" to editor_settings
(cherry picked from commit 30d0ca9766)
2016-02-29 09:00:35 +01:00
Juan Linietsky aa94ff6dae fix transform localization event in mouse motion
(cherry picked from commit 08e0e64a19)
2016-02-29 09:00:14 +01:00
Krzysztof Jankowski ee5c250b63 OUYA gamepad mappings fix
Fix gamepad mappings for OUYA revision 4
2016-02-27 15:28:34 +01:00
Ariel Manzur e4d367e7a1 theora on server build 2016-02-27 15:28:22 +01:00
Ariel Manzur 45a0bbe56e adds -pm and -project_manager command line options to start project manager
fixes bug where the user has an engine.cfg on the executable directory so it runs the game instead of opening the project manager
2016-02-27 15:27:33 +01:00
Julian Murgia - StraToN d86b12a397 Fixed closing a scene tab when it was not the CURRENT tab. Fixes #3810 2016-02-27 15:27:25 +01:00
hinsbart f0ba9c7e78 x11: fix joysticks not recognizing some buttons
dpad on x360 pads with kernel < 4.3 is working now
2016-02-27 15:27:15 +01:00
David 61f17fb1bb applied some typo fixes. see godotengine/godot-docs#18 2016-02-27 15:27:10 +01:00
Dana Olson a43af20f31 added more Android gamepad mappings 2016-02-27 15:26:59 +01:00
est31 7ba92ae9eb Fix typo in error 2016-02-27 15:26:27 +01:00
est31 b05c27a27f Fix allocation bug if compiled with modern clang or gcc
* Add overflow checked intrinsic abstractions that check on overflow.
* Use them for memory allocation code.
* Use size_t type for memory allocation code to support full platform dependent width.

Fixes #3756.
2016-02-27 15:26:18 +01:00
Dana Olson e30cbc3b36 added a couple more Linux mappings, tweaked Ouya Linux mapping 2016-02-27 15:25:51 +01:00
1975 changed files with 291540 additions and 379174 deletions

10
.gitignore vendored
View File

@ -1,10 +1,9 @@
# GoDot auto generated files
# Godot auto generated files
platform/server/logo.h
platform/android/logo.h
platform/bb10/logo.h
platform/iphone/logo.h
platform/javascript/logo.h
platform/nacl/logo.h
platform/osx/logo.h
platform/windows/logo.h
platform/x11/logo.h
@ -19,7 +18,9 @@ drivers/unix/os_unix_global_settings_path.cpp
tools/editor/register_exporters.cpp
tools/editor/doc_data_compressed.h
tools/editor/editor_icons.cpp
-fpic
tools/editor/builtin_fonts.h
tools/editor/certs_compressed.h
tools/editor/translations.h
.fscache
make.bat
log.txt
@ -31,6 +32,7 @@ doc/_build/
*.bc
# Android specific
platform/android/java/build.gradle
platform/android/java/.gradle
platform/android/java/.gradletasknamecache
platform/android/java/local.properties
@ -145,6 +147,8 @@ ipch/
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess

View File

@ -1,7 +1,6 @@
language: cpp
sudo: required
dist: trusty
sudo: false
compiler:
- gcc
@ -41,12 +40,39 @@ matrix:
- compiler: clang
env: GODOT_TARGET=x11
addons:
apt:
packages:
- build-essential
- scons
- pkg-config
- libx11-dev
- libxcursor-dev
- libasound2-dev
- libfreetype6-dev
- libgl1-mesa-dev
- libglu1-mesa-dev
- libssl-dev
- libxinerama-dev
- libudev-dev
# For cross-compiling to Windows.
- binutils-mingw-w64-i686
- binutils-mingw-w64-x86-64
- gcc-mingw-w64-i686
- gcc-mingw-w64-x86-64
- g++-mingw-w64-i686
- g++-mingw-w64-x86-64
- mingw-w64
before_script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; sudo apt-get install -y scons pkg-config libx11-dev libxcursor-dev build-essential libasound2-dev libfreetype6-dev libgl1-mesa-dev libglu-dev libssl-dev libxinerama-dev libudev-dev; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$GODOT_TARGET" = "windows" ]; then sudo apt-get update -qq; sudo apt-get install -y mingw32 mingw-w64; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install scons; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then brew update; brew install android-sdk android-ndk; export ANDROID_HOME=/usr/local/opt/android-sdk; export ANDROID_NDK_ROOT=/usr/local/opt/android-ndk; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then
brew update; brew install -v android-sdk;
brew install -v android-ndk | grep -v "inflating:" | grep -v "creating:";
export ANDROID_HOME=/usr/local/opt/android-sdk; export ANDROID_NDK_ROOT=/usr/local/opt/android-ndk;
fi
script:
- scons platform=$GODOT_TARGET CXX=$CXX
- scons platform=$GODOT_TARGET CXX=$CXX openssl=builtin

View File

@ -1,6 +1,6 @@
![GODOT](/logo.png)
http://www.godotengine.org
https://godotengine.org
### The Engine
@ -13,17 +13,17 @@ Godot has been developed by Juan Linietsky and Ariel Manzur for several years, a
### Documentation
Documentation has been moved to [ReadTheDocs](http://docs.godotengine.org).
Documentation is hosted on [ReadTheDocs](http://docs.godotengine.org).
### Binary Downloads, Community, etc.
Binary downloads, community, etc. can be found in Godot homepage:
http://www.godotengine.org
https://godotengine.org
### Compiling from Source
Compilation instructions for every platform can be found in the Wiki:
See docs for compilation instructions for every platform:
http://docs.godotengine.org/en/latest/reference/_compiling.html
[![Build Status](https://travis-ci.org/godotengine/godot.svg?branch=master)](https://travis-ci.org/godotengine/godot)

View File

@ -23,7 +23,7 @@ platform_exporters=[]
global_defaults=[]
for x in glob.glob("platform/*"):
if (not os.path.isdir(x)):
if (not os.path.isdir(x) or not os.path.exists(x+"/detect.py")):
continue
tmppath="./"+x
@ -63,9 +63,9 @@ elif (os.name=="nt"):
if (os.getenv("VSINSTALLDIR")==None or platform_arg=="android"):
custom_tools=['mingw']
env_base=Environment(tools=custom_tools,ENV = {'PATH' : os.environ['PATH']});
#env_base=Environment(tools=custom_tools);
env_base=Environment(tools=custom_tools);
env_base.AppendENVPath('PATH', os.getenv('PATH'))
env_base.AppendENVPath('PKG_CONFIG_PATH', os.getenv('PKG_CONFIG_PATH'))
env_base.global_defaults=global_defaults
env_base.android_maven_repos=[]
env_base.android_dependencies=[]
@ -112,7 +112,8 @@ if profile:
opts=Variables(customs, ARGUMENTS)
opts.Add('target', 'Compile Target (debug/release_debug/release).', "debug")
opts.Add('bits', 'Compile Target Bits (default/32/64).', "default")
opts.Add('arch', 'Platform dependent architecture (arm/arm64/x86/x64/mips/etc)', "")
opts.Add('bits', 'Compile Target Bits (default/32/64/fat).', "default")
opts.Add('platform','Platform: '+str(platform_list)+'.',"")
opts.Add('p','Platform (same as platform=).',"")
opts.Add('tools','Build Tools (Including Editor): (yes/no)','yes')
@ -267,10 +268,14 @@ if selected_platform in platform_list:
else:
suffix+=".debug"
if (env["bits"]=="32"):
if env["arch"] != "":
suffix += "."+env["arch"]
elif (env["bits"]=="32"):
suffix+=".32"
elif (env["bits"]=="64"):
suffix+=".64"
elif (env["bits"]=="fat"):
suffix+=".fat"
suffix+=env.extra_suffix
@ -302,10 +307,10 @@ if selected_platform in platform_list:
if (env['musepack']=='yes'):
env.Append(CPPFLAGS=['-DMUSEPACK_ENABLED']);
if (env['openssl']!='no'):
env.Append(CPPFLAGS=['-DOPENSSL_ENABLED']);
if (env['openssl']=="builtin"):
env.Append(CPPPATH=['#drivers/builtin_openssl2'])
#if (env['openssl']!='no'):
# env.Append(CPPFLAGS=['-DOPENSSL_ENABLED']);
# if (env['openssl']=="builtin"):
# env.Append(CPPPATH=['#drivers/builtin_openssl2'])
if (env["builtin_zlib"]=='yes'):
env.Append(CPPPATH=['#drivers/builtin_zlib/zlib'])
@ -389,14 +394,25 @@ if selected_platform in platform_list:
AddToVSProject(env.servers_sources)
AddToVSProject(env.tool_sources)
# this env flag won't work, it needs to be set in env_base=Environment(MSVC_VERSION='9.0')
# Even then, SCons still seems to ignore it and builds with the latest MSVC...
# That said, it's not needed to be set so far but I'm leaving it here so that this comment
# has a purpose.
#env['MSVS_VERSION']='9.0'
env['MSVSBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
env['MSVSREBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes vsproj=true"
env['MSVSCLEANCOM'] = "scons --clean platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes"
debug_variants = ['Debug|Win32']+['Debug|x64']
release_variants = ['Release|Win32']+['Release|x64']
release_debug_variants = ['Release_Debug|Win32']+['Release_Debug|x64']
# Calls a CMD with /C(lose) and /V(delayed environment variable expansion) options.
# And runs vcvarsall bat for the propper arhitecture and scons for propper configuration
env['MSVSBUILDCOM'] = 'cmd /V /C set "plat=$(PlatformTarget)" ^& (if "$(PlatformTarget)"=="x64" (set "plat=x86_amd64")) ^& set "tools=yes" ^& (if "$(Configuration)"=="release" (set "tools=no")) ^& call "$(VCInstallDir)vcvarsall.bat" !plat! ^& scons platform=windows target=$(Configuration) tools=!tools! -j2'
env['MSVSREBUILDCOM'] = 'cmd /V /C set "plat=$(PlatformTarget)" ^& (if "$(PlatformTarget)"=="x64" (set "plat=x86_amd64")) ^& set "tools=yes" ^& (if "$(Configuration)"=="release" (set "tools=no")) & call "$(VCInstallDir)vcvarsall.bat" !plat! ^& scons platform=windows target=$(Configuration) tools=!tools! vsproj=yes -j2'
env['MSVSCLEANCOM'] = 'cmd /V /C set "plat=$(PlatformTarget)" ^& (if "$(PlatformTarget)"=="x64" (set "plat=x86_amd64")) ^& set "tools=yes" ^& (if "$(Configuration)"=="release" (set "tools=no")) ^& call "$(VCInstallDir)vcvarsall.bat" !plat! ^& scons --clean platform=windows target=$(Configuration) tools=!tools! -j2'
# This version information (Win32, x64, Debug, Release, Release_Debug seems to be
# required for Visual Studio to understand that it needs to generate an NMAKE
# project. Do not modify without knowing what you are doing.
debug_variants = ['debug|Win32']+['debug|x64']
release_variants = ['release|Win32']+['release|x64']
release_debug_variants = ['release_debug|Win32']+['release_debug|x64']
variants = debug_variants + release_variants + release_debug_variants
debug_targets = ['Debug']+['Debug']
release_targets = ['Release']+['Release']

View File

@ -1307,7 +1307,12 @@ DVector<uint8_t> _File::get_buffer(int p_length) const{
String _File::get_as_text() const {
ERR_FAIL_COND_V(!f, String());
String text;
size_t original_pos = f->get_pos();
f->seek(0);
String l = get_line();
while(!eof_reached()) {
text+=l+"\n";
@ -1315,6 +1320,8 @@ String _File::get_as_text() const {
}
text+=l;
f->seek(original_pos);
return text;
@ -1669,15 +1676,15 @@ void _Directory::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_drive","idx"),&_Directory::get_drive);
ObjectTypeDB::bind_method(_MD("change_dir:Error","todir"),&_Directory::change_dir);
ObjectTypeDB::bind_method(_MD("get_current_dir"),&_Directory::get_current_dir);
ObjectTypeDB::bind_method(_MD("make_dir:Error","name"),&_Directory::make_dir);
ObjectTypeDB::bind_method(_MD("make_dir_recursive:Error","name"),&_Directory::make_dir_recursive);
ObjectTypeDB::bind_method(_MD("file_exists","name"),&_Directory::file_exists);
ObjectTypeDB::bind_method(_MD("dir_exists","name"),&_Directory::dir_exists);
ObjectTypeDB::bind_method(_MD("make_dir:Error","path"),&_Directory::make_dir);
ObjectTypeDB::bind_method(_MD("make_dir_recursive:Error","path"),&_Directory::make_dir_recursive);
ObjectTypeDB::bind_method(_MD("file_exists","path"),&_Directory::file_exists);
ObjectTypeDB::bind_method(_MD("dir_exists","path"),&_Directory::dir_exists);
// ObjectTypeDB::bind_method(_MD("get_modified_time","file"),&_Directory::get_modified_time);
ObjectTypeDB::bind_method(_MD("get_space_left"),&_Directory::get_space_left);
ObjectTypeDB::bind_method(_MD("copy:Error","from","to"),&_Directory::copy);
ObjectTypeDB::bind_method(_MD("rename:Error","from","to"),&_Directory::rename);
ObjectTypeDB::bind_method(_MD("remove:Error","file"),&_Directory::remove);
ObjectTypeDB::bind_method(_MD("remove:Error","path"),&_Directory::remove);
}

View File

@ -110,6 +110,16 @@ bool Dictionary::has(const Variant& p_key) const {
return _p->variant_map.has(p_key);
}
bool Dictionary::has_all(const Array& p_keys) const {
for (int i=0;i<p_keys.size();i++) {
if( !has(p_keys[i]) ) {
return false;
}
}
return true;
}
void Dictionary::erase(const Variant& p_key) {
_copy_on_write();
_p->variant_map.erase(p_key);

View File

@ -69,6 +69,8 @@ public:
bool is_shared() const;
bool has(const Variant& p_key) const;
bool has_all(const Array& p_keys) const;
void erase(const Variant& p_key);
bool operator==(const Dictionary& p_dictionary) const;

View File

@ -92,7 +92,7 @@ Error EventQueue::push_call(uint32_t p_instance_ID, const StringName& p_method,
*v=p_arg5;
}
if (buffer_max_used>buffer_end);
if (buffer_end > buffer_max_used)
buffer_max_used=buffer_end;
return OK;

View File

@ -474,7 +474,6 @@ static _GlobalConstant _global_constants[]={
BIND_GLOBAL_CONSTANT( PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORAGE ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORAGE ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_EDITOR ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_NETWORK ),

View File

@ -901,6 +901,66 @@ static void _generate_po2_mipmap(const uint8_t* p_src, uint8_t* p_dst, uint32_t
}
void Image::shrink_x2() {
ERR_FAIL_COND(format==FORMAT_INDEXED || format==FORMAT_INDEXED_ALPHA);
ERR_FAIL_COND( data.size()==0 );
if (mipmaps) {
//just use the lower mipmap as base and copy all
DVector<uint8_t> new_img;
int ofs = get_mipmap_offset(1);
int new_size = data.size()-ofs;
new_img.resize(new_size);
{
DVector<uint8_t>::Write w=new_img.write();
DVector<uint8_t>::Read r=data.read();
copymem(w.ptr(),&r[ofs],new_size);
}
mipmaps--;
width/=2;
height/=2;
data=new_img;
} else {
DVector<uint8_t> new_img;
ERR_FAIL_COND( format>=FORMAT_INDEXED );
int ps = get_format_pixel_size(format);
new_img.resize((width/2)*(height/2)*ps);
{
DVector<uint8_t>::Write w=new_img.write();
DVector<uint8_t>::Read r=data.read();
switch(format) {
case FORMAT_GRAYSCALE:
case FORMAT_INTENSITY: _generate_po2_mipmap<1>(r.ptr(), w.ptr(), width,height); break;
case FORMAT_GRAYSCALE_ALPHA: _generate_po2_mipmap<2>(r.ptr(), w.ptr(), width,height); break;
case FORMAT_RGB: _generate_po2_mipmap<3>(r.ptr(), w.ptr(), width,height); break;
case FORMAT_RGBA: _generate_po2_mipmap<4>(r.ptr(), w.ptr(), width,height); break;
default: {}
}
}
width/=2;
height/=2;
data=new_img;
}
}
Error Image::generate_mipmaps(int p_mipmaps,bool p_keep_existing) {
if (!_can_modify(format)) {
@ -1637,8 +1697,17 @@ Error Image::_decompress_bc() {
print_line("decompressing bc");
int wd=width,ht=height;
if (wd%4!=0) {
wd+=4-(wd%4);
}
if (ht%4!=0) {
ht+=4-(ht%4);
}
int mm;
int size = _get_dst_image_size(width,height,FORMAT_RGBA,mm,mipmaps);
int size = _get_dst_image_size(wd,ht,FORMAT_RGBA,mm,mipmaps);
DVector<uint8_t> newdata;
newdata.resize(size);
@ -1648,7 +1717,8 @@ Error Image::_decompress_bc() {
int rofs=0;
int wofs=0;
int wd=width,ht=height;
//print_line("width: "+itos(wd)+" height: "+itos(ht));
for(int i=0;i<=mm;i++) {
@ -1953,6 +2023,11 @@ Error Image::_decompress_bc() {
data=newdata;
format=FORMAT_RGBA;
if (wd!=width || ht!=height) {
//todo, crop
width=wd;
height=ht;
}
return OK;
}

View File

@ -248,6 +248,7 @@ public:
void resize_to_po2(bool p_square=false);
void resize( int p_width, int p_height, Interpolation p_interpolation=INTERPOLATE_BILINEAR );
Image resized( int p_width, int p_height, int p_interpolation=INTERPOLATE_BILINEAR );
void shrink_x2();
/**
* Crop the image to a specific size, if larger, then the image is filled by black
*/

View File

@ -28,6 +28,7 @@
/*************************************************************************/
#include "input_map.h"
#include "globals.h"
#include "os/keyboard.h"
InputMap *InputMap::singleton=NULL;
@ -36,6 +37,7 @@ void InputMap::_bind_methods() {
ObjectTypeDB::bind_method(_MD("has_action","action"),&InputMap::has_action);
ObjectTypeDB::bind_method(_MD("get_action_id","action"),&InputMap::get_action_id);
ObjectTypeDB::bind_method(_MD("get_action_from_id","id"),&InputMap::get_action_from_id);
ObjectTypeDB::bind_method(_MD("get_actions"),&InputMap::_get_actions);
ObjectTypeDB::bind_method(_MD("add_action","action"),&InputMap::add_action);
ObjectTypeDB::bind_method(_MD("erase_action","action"),&InputMap::erase_action);
@ -75,6 +77,35 @@ StringName InputMap::get_action_from_id(int p_id) const {
return input_id_map[p_id];
}
Array InputMap::_get_actions() {
Array ret;
List<StringName> actions = get_actions();
if(actions.empty())
return ret;
for(const List<StringName>::Element *E=actions.front();E;E=E->next()) {
ret.push_back(E->get());
}
return ret;
}
List<StringName> InputMap::get_actions() const {
List<StringName> actions = List<StringName>();
if(input_map.empty()){
return actions;
}
for (Map<StringName, Action>::Element *E=input_map.front();E;E=E->next()) {
actions.push_back(E->key());
}
return actions;
}
List<InputEvent>::Element *InputMap::_find_event(List<InputEvent> &p_list,const InputEvent& p_event) const {
for (List<InputEvent>::Element *E=p_list.front();E;E=E->next()) {
@ -106,7 +137,7 @@ List<InputEvent>::Element *InputMap::_find_event(List<InputEvent> &p_list,const
} break;
case InputEvent::JOYSTICK_MOTION: {
same=(e.joy_motion.axis==p_event.joy_motion.axis);
same=(e.joy_motion.axis==p_event.joy_motion.axis && (e.joy_motion.axis_value < 0) == (p_event.joy_motion.axis_value < 0));
} break;
}
@ -156,10 +187,7 @@ void InputMap::action_erase_event(const StringName& p_action,const InputEvent& p
List<InputEvent>::Element *E=_find_event(input_map[p_action].inputs,p_event);
if (E)
return; //already gots
input_map[p_action].inputs.erase(E);
input_map[p_action].inputs.erase(E);
}
@ -292,6 +320,67 @@ void InputMap::load_from_globals() {
}
}
void InputMap::load_default() {
InputEvent key;
key.type=InputEvent::KEY;
add_action("ui_accept");
key.key.scancode=KEY_RETURN;
action_add_event("ui_accept",key);
key.key.scancode=KEY_ENTER;
action_add_event("ui_accept",key);
key.key.scancode=KEY_SPACE;
action_add_event("ui_accept",key);
add_action("ui_select");
key.key.scancode=KEY_SPACE;
action_add_event("ui_select",key);
add_action("ui_cancel");
key.key.scancode=KEY_ESCAPE;
action_add_event("ui_cancel",key);
add_action("ui_focus_next");
key.key.scancode=KEY_TAB;
action_add_event("ui_focus_next",key);
add_action("ui_focus_prev");
key.key.scancode=KEY_TAB;
key.key.mod.shift=true;
action_add_event("ui_focus_prev",key);
key.key.mod.shift=false;
add_action("ui_left");
key.key.scancode=KEY_LEFT;
action_add_event("ui_left",key);
add_action("ui_right");
key.key.scancode=KEY_RIGHT;
action_add_event("ui_right",key);
add_action("ui_up");
key.key.scancode=KEY_UP;
action_add_event("ui_up",key);
add_action("ui_down");
key.key.scancode=KEY_DOWN;
action_add_event("ui_down",key);
add_action("ui_page_up");
key.key.scancode=KEY_PAGEUP;
action_add_event("ui_page_up",key);
add_action("ui_page_down");
key.key.scancode=KEY_PAGEDOWN;
action_add_event("ui_page_down",key);
// set("display/orientation", "landscape");
}
InputMap::InputMap() {

View File

@ -47,6 +47,7 @@ class InputMap : public Object {
List<InputEvent>::Element *_find_event(List<InputEvent> &p_list,const InputEvent& p_event) const;
Array _get_action_list(const StringName& p_action);
Array _get_actions();
protected:
@ -59,6 +60,7 @@ public:
bool has_action(const StringName& p_action) const;
int get_action_id(const StringName& p_action) const;
StringName get_action_from_id(int p_id) const;
List<StringName> get_actions() const;
void add_action(const StringName& p_action);
void erase_action(const StringName& p_action);
@ -72,6 +74,7 @@ public:
void load_from_globals();
void load_default();
InputMap();
};

View File

@ -0,0 +1,60 @@
This is version 2007-Mar-4 of the Info-ZIP license.
The definitive version of this document should be available at
ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely and
a copy at http://www.info-zip.org/pub/infozip/license.html.
Copyright (c) 1990-2007 Info-ZIP. All rights reserved.
For the purposes of this copyright and license, "Info-ZIP" is defined as
the following set of individuals:
Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
Jean-loup Gailly, Hunter Goatley, Ed Gordon, Ian Gorman, Chris Herborth,
Dirk Haase, Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz,
David Kirschbaum, Johnny Lee, Onno van der Linden, Igor Mandrichenko,
Steve P. Miller, Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs,
Kai Uwe Rommel, Steve Salisbury, Dave Smith, Steven M. Schweda,
Christian Spieler, Cosmin Truta, Antoine Verheijen, Paul von Behren,
Rich Wales, Mike White.
This software is provided "as is," without warranty of any kind, express
or implied. In no event shall Info-ZIP or its contributors be held liable
for any direct, indirect, incidental, special or consequential damages
arising out of the use of or inability to use this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the above disclaimer and the following restrictions:
1. Redistributions of source code (in whole or in part) must retain
the above copyright notice, definition, disclaimer, and this list
of conditions.
2. Redistributions in binary form (compiled executables and libraries)
must reproduce the above copyright notice, definition, disclaimer,
and this list of conditions in documentation and/or other materials
provided with the distribution. The sole exception to this condition
is redistribution of a standard UnZipSFX binary (including SFXWiz) as
part of a self-extracting archive; that is permitted without inclusion
of this license, as long as the normal SFX banner has not been removed
from the binary or disabled.
3. Altered versions--including, but not limited to, ports to new operating
systems, existing ports with new graphical interfaces, versions with
modified or added functionality, and dynamic, shared, or static library
versions not from Info-ZIP--must be plainly marked as such and must not
be misrepresented as being the original source or, if binaries,
compiled from the original source. Such altered versions also must not
be misrepresented as being Info-ZIP releases--including, but not
limited to, labeling of the altered versions with the names "Info-ZIP"
(or any variation thereof, including, but not limited to, different
capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the
explicit permission of Info-ZIP. Such altered versions are further
prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP
e-mail addresses or the Info-ZIP URL(s), such as to imply Info-ZIP
will provide support for the altered versions.
4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip,"
"UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its
own source and binary releases.

View File

@ -0,0 +1,32 @@
Credits
Gilles Vollant - Original MiniZip author
Even Rouault - ZIP64 unzip Support
Daniel Borca - BZip Compression method support in unzip
Mathias Svensson - ZIP64 zip support
Mathias Svensson - BZip Compression method support in zip
This version has been modified for Godot Engine
License
----------------------------------------------------------------------------
Condition of use and distribution are the same than zlib :
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
----------------------------------------------------------------------------

View File

@ -207,7 +207,7 @@ Error ConfigFile::load(const String& p_path) {
void ConfigFile::_bind_methods(){
ObjectTypeDB::bind_method(_MD("set_value","section","key","value"),&ConfigFile::set_value);
ObjectTypeDB::bind_method(_MD("get_value","section","key","default"),&ConfigFile::get_value,DEFVAL(Variant()));
ObjectTypeDB::bind_method(_MD("get_value:Variant","section","key","default"),&ConfigFile::get_value,DEFVAL(Variant()));
ObjectTypeDB::bind_method(_MD("has_section","section"),&ConfigFile::has_section);
ObjectTypeDB::bind_method(_MD("has_section_key","section","key"),&ConfigFile::has_section_key);

View File

@ -81,6 +81,7 @@ void HTTPClient::set_connection(const Ref<StreamPeer>& p_connection){
close();
connection=p_connection;
status=STATUS_CONNECTED;
}
@ -301,6 +302,7 @@ Error HTTPClient::poll(){
chunked=false;
body_left=0;
chunk_left=0;
response_str.clear();
response_headers.clear();
response_num = RESPONSE_OK;

View File

@ -40,7 +40,7 @@ class HTTPClient : public Reference {
OBJ_TYPE(HTTPClient,Reference);
public:
enum RespondeCode {
enum ResponseCode {
// 1xx informational
RESPONSE_CONTINUE = 100,

View File

@ -6,7 +6,7 @@
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
For more info read LICENSE-MiniZip.txt
*/

View File

@ -5,7 +5,7 @@
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
For more info read LICENSE-MiniZip.txt
Changes

View File

@ -438,8 +438,9 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int *
case InputEvent::JOYSTICK_MOTION: {
ie.joy_motion.axis=decode_uint32(&buf[12]);
ie.joy_motion.axis_value=decode_float(&buf[16]);
if (r_len)
(*r_len)+=4;
(*r_len)+=8;
} break;
}
@ -1154,8 +1155,9 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) {
int axis = ie.joy_motion.axis;
encode_uint32(axis,&buf[llen]);
encode_float(ie.joy_motion.axis_value, &buf[llen+4]);
}
llen+=4;
llen+=8;
} break;
}

View File

@ -126,7 +126,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("get_var:Variant"),&PacketPeer::_bnd_get_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);

View File

@ -318,7 +318,11 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_
if (OS::get_singleton()->is_stdout_verbose())
print_line("load resource: "+local_path+" (cached)");
return RES( ResourceCache::get(local_path ) );
Ref<Resource> res_cached = ResourceCache::get(local_path);
Ref<ResourceInteractiveLoaderDefault> ril = Ref<ResourceInteractiveLoaderDefault>(memnew(ResourceInteractiveLoaderDefault));
ril->resource = res_cached;
return ril;
}
if (OS::get_singleton()->is_stdout_verbose())

View File

@ -357,7 +357,6 @@ String StreamPeer::get_string(int p_bytes){
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<uint8_t> buf;
buf.resize(p_bytes);

View File

@ -10,7 +10,7 @@
Modifications for Zip64 support on both zip and unzip
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
For more info read LICENSE-MiniZip.txt
------------------------------------------------------------------------------------

View File

@ -10,7 +10,7 @@
Modifications for Zip64 support on both zip and unzip
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
For more info read LICENSE-MiniZip.txt
---------------------------------------------------------------------------------

View File

@ -7,7 +7,7 @@
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
For more info read LICENSE-MiniZip.txt
Changes
Oct-2009 - Mathias Svensson - Remove old C style function prototypes

View File

@ -6,7 +6,7 @@
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
For more info read LICENSE-MiniZip.txt
---------------------------------------------------------------------------

View File

@ -39,11 +39,14 @@ static void* zipio_open(void* data, const char* p_fname, int mode) {
FileAccess *&f = *(FileAccess**)data;
String fname;
fname.parse_utf8(p_fname);
if (mode & ZLIB_FILEFUNC_MODE_WRITE) {
f = FileAccess::open(p_fname,FileAccess::WRITE);
f = FileAccess::open(fname,FileAccess::WRITE);
} else {
f = FileAccess::open(p_fname,FileAccess::READ);
f = FileAccess::open(fname,FileAccess::READ);
}
if (!f)

View File

@ -135,18 +135,20 @@ double Math::rad2deg(double p_y) {
double Math::round(double p_val) {
if (p_val>0) {
if (p_val>=0) {
return ::floor(p_val+0.5);
} else {
p_val=-p_val;
return -::floor(p_val+0.5);
}
}
double Math::asin(double p_x) {
return ::asin(p_x);
}
double Math::acos(double p_x) {
return ::acos(p_x);

View File

@ -320,7 +320,7 @@ void MessageQueue::_call_function(Object* p_target, const StringName& p_func, co
void MessageQueue::flush() {
if (buffer_max_used<buffer_end); {
if (buffer_end > buffer_max_used) {
buffer_max_used=buffer_end;
//statistics();
}

View File

@ -284,7 +284,7 @@ Vector<String> FileAccess::get_csv_line(String delim) const {
String l;
int qc=0;
do {
l+=get_line();
l+=get_line()+"\n";
qc=0;
for(int i=0;i<l.length();i++) {
@ -295,6 +295,8 @@ Vector<String> FileAccess::get_csv_line(String delim) const {
} while (qc%2);
l=l.substr(0, l.length()-1);
Vector<String> strings;
bool in_quote=false;

View File

@ -199,3 +199,62 @@ uint32_t InputEventKey::get_scancode_with_modifiers() const {
return sc;
}
InputEvent InputEvent::xform_by(const Matrix32& p_xform) const {
InputEvent ev=*this;
switch(ev.type) {
case InputEvent::MOUSE_BUTTON: {
Vector2 g = p_xform.xform(Vector2(ev.mouse_button.global_x,ev.mouse_button.global_y));
Vector2 l = p_xform.xform(Vector2(ev.mouse_button.x,ev.mouse_button.y));
ev.mouse_button.x=l.x;
ev.mouse_button.y=l.y;
ev.mouse_button.global_x=g.x;
ev.mouse_button.global_y=g.y;
} break;
case InputEvent::MOUSE_MOTION: {
Vector2 g = p_xform.xform(Vector2(ev.mouse_motion.global_x,ev.mouse_motion.global_y));
Vector2 l = p_xform.xform(Vector2(ev.mouse_motion.x,ev.mouse_motion.y));
Vector2 r = p_xform.basis_xform(Vector2(ev.mouse_motion.relative_x,ev.mouse_motion.relative_y));
Vector2 s = p_xform.basis_xform(Vector2(ev.mouse_motion.speed_x,ev.mouse_motion.speed_y));
ev.mouse_motion.x=l.x;
ev.mouse_motion.y=l.y;
ev.mouse_motion.global_x=g.x;
ev.mouse_motion.global_y=g.y;
ev.mouse_motion.relative_x=r.x;
ev.mouse_motion.relative_y=r.y;
ev.mouse_motion.speed_x=s.x;
ev.mouse_motion.speed_y=s.y;
} break;
case InputEvent::SCREEN_TOUCH: {
Vector2 t = p_xform.xform(Vector2(ev.screen_touch.x,ev.screen_touch.y));
ev.screen_touch.x=t.x;
ev.screen_touch.y=t.y;
} break;
case InputEvent::SCREEN_DRAG: {
Vector2 t = p_xform.xform(Vector2(ev.screen_drag.x,ev.screen_drag.y));
Vector2 r = p_xform.basis_xform(Vector2(ev.screen_drag.relative_x,ev.screen_drag.relative_y));
Vector2 s = p_xform.basis_xform(Vector2(ev.screen_drag.speed_x,ev.screen_drag.speed_y));
ev.screen_drag.x=t.x;
ev.screen_drag.y=t.y;
ev.screen_drag.relative_x=r.x;
ev.screen_drag.relative_y=r.y;
ev.screen_drag.speed_x=s.x;
ev.screen_drag.speed_y=s.y;
} break;
}
return ev;
}

View File

@ -33,7 +33,7 @@
#include "typedefs.h"
#include "os/copymem.h"
#include "ustring.h"
#include "math_2d.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
@ -297,6 +297,8 @@ struct InputEvent {
bool is_echo() const;
void set_as_action(const String& p_action, bool p_pressed);
InputEvent xform_by(const Matrix32& p_xform) const;
bool operator==(const InputEvent &p_event) const;
operator String() const;
InputEvent() { zeromem(this,sizeof(InputEvent)); }

View File

@ -211,7 +211,7 @@ void * operator new(size_t p_size,void *p_pointer,size_t check, const char *p_de
#ifdef DEBUG_MEMORY_ENABLED
#define memalloc(m_size) Memory::alloc_static(m_size, __FILE__":"__STR(__LINE__)", memalloc.")
#define memalloc(m_size) Memory::alloc_static(m_size, __FILE__ ":" __STR(__LINE__) ", memalloc.")
#define memrealloc(m_mem,m_size) Memory::realloc_static(m_mem,m_size)
#define memfree(m_size) Memory::free_static(m_size)
@ -224,8 +224,7 @@ void * operator new(size_t p_size,void *p_pointer,size_t check, const char *p_de
#endif
#ifdef DEBUG_MEMORY_ENABLED
#define dynalloc(m_size) Memory::alloc_dynamic(m_size, __FILE__":"__STR(__LINE__)", type: DYNAMIC")
#define dynalloc(m_size) Memory::alloc_dynamic(m_size, __FILE__ ":" __STR(__LINE__) ", type: DYNAMIC")
#define dynrealloc(m_mem,m_size) m_mem.resize(m_size)
#else
@ -248,7 +247,7 @@ _ALWAYS_INLINE_ T *_post_initialize(T *p_obj) {
#ifdef DEBUG_MEMORY_ENABLED
#define memnew(m_class) _post_initialize(new(__FILE__":"__STR(__LINE__)", memnew type: "__STR(m_class)) m_class)
#define memnew(m_class) _post_initialize(new(__FILE__ ":" __STR(__LINE__) ", memnew type: " __STR(m_class)) m_class)
#else
@ -291,7 +290,7 @@ void memdelete_allocator(T *p_class) {
#define memdelete_notnull(m_v) { if (m_v) memdelete(m_v); }
#ifdef DEBUG_MEMORY_ENABLED
#define memnew_arr( m_class, m_count ) memnew_arr_template<m_class>(m_count,__FILE__":"__STR(__LINE__)", memnew_arr type: "_STR(m_class))
#define memnew_arr( m_class, m_count ) memnew_arr_template<m_class>(m_count,__FILE__ ":" __STR(__LINE__) ", memnew_arr type: " _STR(m_class))
#else

View File

@ -306,6 +306,15 @@ String OS::get_system_dir(SystemDir p_dir) const {
return ".";
}
String OS::get_safe_application_name() const {
String an = Globals::get_singleton()->get("application/name");
Vector<String> invalid_char = String("\\ / : * ? \" < > |").split(" ");
for (int i=0;i<invalid_char.size();i++) {
an = an.replace(invalid_char[i],"-");
}
return an;
}
String OS::get_data_dir() const {
return ".";

View File

@ -319,6 +319,7 @@ public:
virtual String get_locale() const;
String get_safe_application_name() const;
virtual String get_data_dir() const;
virtual String get_resource_dir() const;

View File

@ -41,7 +41,11 @@
#define _MKSTR(m_x) _STR(m_x)
#endif
// have to include version.h for this to work, include it in the .cpp not the .h
#ifdef VERSION_PATCH
#define VERSION_MKSTRING _MKSTR(VERSION_MAJOR)"." _MKSTR(VERSION_MINOR)"." _MKSTR(VERSION_PATCH)"." _MKSTR(VERSION_STATUS)"." _MKSTR(VERSION_REVISION)
#else
#define VERSION_MKSTRING _MKSTR(VERSION_MAJOR)"." _MKSTR(VERSION_MINOR)"." _MKSTR(VERSION_STATUS)"." _MKSTR(VERSION_REVISION)
#endif // VERSION_PATCH
#define VERSION_FULL_NAME _MKSTR(VERSION_NAME)" v" VERSION_MKSTRING
@ -154,6 +158,23 @@ inline void __swap_tmpl(T &x, T &y ) {
((m_hex>='A' && m_hex<='F')?(10+m_hex-'A'):\
((m_hex>='a' && m_hex<='f')?(10+m_hex-'a'):0)))
// Macro to check whether we are compiled by clang
// and we have a specific builtin
#if defined(__llvm__) && defined(__has_builtin)
#define _llvm_has_builtin(x) __has_builtin(x)
#else
#define _llvm_has_builtin(x) 0
#endif
#if (defined(__GNUC__) && (__GNUC__ >= 5)) || _llvm_has_builtin(__builtin_mul_overflow)
# define _mul_overflow __builtin_mul_overflow
#endif
#if (defined(__GNUC__) && (__GNUC__ >= 5)) || _llvm_has_builtin(__builtin_add_overflow)
# define _add_overflow __builtin_add_overflow
#endif
@ -167,6 +188,19 @@ static _FORCE_INLINE_ unsigned int nearest_power_of_2(unsigned int x) {
x |= x >> 4;
x |= x >> 8;
x |= x >> 16;
return ++x;
}
template<class T>
static _FORCE_INLINE_ T nearest_power_of_2_templated(T x) {
--x;
// If the compiler is smart, it unrolls this loop
// If its dumb, this is a bit slow.
for (size_t i = 0; i < sizeof(T); i++)
x |= x >> (1 << i);
return ++x;
}

View File

@ -256,13 +256,10 @@ bool String::operator==(const StrRange &p_range) const {
return true;
const CharType *c_str=p_range.c_str;
int l=length();
const CharType *dst = p_range.c_str;
const CharType *dst = &operator[](0);
/* Compare char by char */
for (int i=0;i<l;i++) {
for (int i=0;i<len;i++) {
if (c_str[i]!=dst[i])
return false;
@ -2867,25 +2864,29 @@ CharType String::ord_at(int p_idx) const {
return operator[](p_idx);
}
String String::strip_edges() const {
String String::strip_edges(bool left, bool right) const {
int len=length();
int beg=0,end=len;
for (int i=0;i<length();i++) {
if(left) {
for (int i=0;i<len;i++) {
if (operator[](i)<=32)
beg++;
else
break;
if (operator[](i)<=32)
beg++;
else
break;
}
}
for (int i=(int)(length()-1);i>=0;i--) {
if(right) {
for (int i=(int)(len-1);i>=0;i--) {
if (operator[](i)<=32)
end--;
else
break;
if (operator[](i)<=32)
end--;
else
break;
}
}
if (beg==0 && end==len)
@ -3629,13 +3630,14 @@ String String::percent_decode() const {
CharString pe;
for(int i=0;i<length();i++) {
CharString cs = utf8();
for(int i=0;i<cs.length();i++) {
uint8_t c=operator[](i);
uint8_t c = cs[i];
if (c=='%' && i<length()-2) {
uint8_t a = LOWERCASE(operator[](i+1));
uint8_t b = LOWERCASE(operator[](i+2));
uint8_t a = LOWERCASE(cs[i+1]);
uint8_t b = LOWERCASE(cs[i+2]);
c=0;
if (a>='0' && a<='9')

View File

@ -169,7 +169,7 @@ public:
String left(int p_pos) const;
String right(int p_pos) const;
String strip_edges() const;
String strip_edges(bool left = true, bool right = true) const;
String strip_escapes() const;
String extension() const;
String basename() const;

View File

@ -1115,6 +1115,21 @@ void Variant::reference(const Variant& p_variant) {
}
}
void Variant::zero() {
switch(type) {
case NIL: break;
case BOOL: this->_data._bool = false; break;
case INT: this->_data._int = 0; break;
case REAL: this->_data._real = 0; break;
case VECTOR2: *reinterpret_cast<Vector2*>(this->_data._mem) = Vector2(); break;
case RECT2: *reinterpret_cast<Rect2*>(this->_data._mem) = Rect2(); break;
case VECTOR3: *reinterpret_cast<Vector3*>(this->_data._mem) = Vector3(); break;
case PLANE: *reinterpret_cast<Plane*>(this->_data._mem) = Plane(); break;
case QUAT: *reinterpret_cast<Quat*>(this->_data._mem) = Quat(); break;
case COLOR: *reinterpret_cast<Color*>(this->_data._mem) = Color(); break;
default: this->clear(); break;
}
}
void Variant::clear() {
@ -1541,63 +1556,81 @@ Variant::operator String() const {
return str;
} break;
case VECTOR3_ARRAY: {
case VECTOR2_ARRAY: {
DVector<Vector3> vec = operator DVector<Vector3>();
String str;
DVector<Vector2> vec = operator DVector<Vector2>();
String str("[");
for(int i=0;i<vec.size();i++) {
if (i>0)
str+=", ";
str=str+Variant( vec[i] );
}
str += "]";
return str;
} break;
case VECTOR3_ARRAY: {
DVector<Vector3> vec = operator DVector<Vector3>();
String str("[");
for(int i=0;i<vec.size();i++) {
if (i>0)
str+=", ";
str=str+Variant( vec[i] );
}
str += "]";
return str;
} break;
case STRING_ARRAY: {
DVector<String> vec = operator DVector<String>();
String str;
String str("[");
for(int i=0;i<vec.size();i++) {
if (i>0)
str+=", ";
str=str+vec[i];
}
str += "]";
return str;
} break;
case INT_ARRAY: {
DVector<int> vec = operator DVector<int>();
String str;
String str("[");
for(int i=0;i<vec.size();i++) {
if (i>0)
str+=", ";
str=str+itos(vec[i]);
}
str += "]";
return str;
} break;
case REAL_ARRAY: {
DVector<real_t> vec = operator DVector<real_t>();
String str;
String str("[");
for(int i=0;i<vec.size();i++) {
if (i>0)
str+=", ";
str=str+rtos(vec[i]);
}
str += "]";
return str;
} break;
case ARRAY: {
Array arr = operator Array();
String str;
String str("[");
for (int i=0; i<arr.size(); i++) {
if (i)
str+=", ";
str += String(arr[i]);
};
str += "]";
return str;
} break;
@ -3002,9 +3035,9 @@ String Variant::get_call_error_text(Object* p_base, const StringName& p_method,c
int errorarg=ce.argument;
err_text="Cannot convert argument "+itos(errorarg+1)+" from "+Variant::get_type_name(p_argptrs[errorarg]->get_type())+" to "+Variant::get_type_name(ce.expected)+".";
} else if (ce.error==Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS) {
err_text="Expected "+itos(ce.argument)+" arguments.";
err_text="Method expected "+itos(ce.argument)+" arguments, but called with "+itos(p_argcount)+".";
} else if (ce.error==Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS) {
err_text="Expected "+itos(ce.argument)+" arguments.";
err_text="Method expected "+itos(ce.argument)+" arguments, but called with "+itos(p_argcount)+".";
} else if (ce.error==Variant::CallError::CALL_ERROR_INVALID_METHOD) {
err_text="Method not found.";
} else if (ce.error==Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL) {

View File

@ -372,6 +372,8 @@ public:
return res;
}
void zero();
static void blend(const Variant& a, const Variant& b, float c,Variant &r_dst);
static void interpolate(const Variant& a, const Variant& b, float c,Variant &r_dst);
struct CallError {

View File

@ -256,7 +256,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_LOCALMEM0R(String,to_lower);
VCALL_LOCALMEM1R(String,left);
VCALL_LOCALMEM1R(String,right);
VCALL_LOCALMEM0R(String,strip_edges);
VCALL_LOCALMEM2R(String,strip_edges);
VCALL_LOCALMEM0R(String,extension);
VCALL_LOCALMEM0R(String,basename);
VCALL_LOCALMEM1R(String,plus_file);
@ -440,6 +440,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_LOCALMEM0R(Dictionary,empty);
VCALL_LOCALMEM0(Dictionary,clear);
VCALL_LOCALMEM1R(Dictionary,has);
VCALL_LOCALMEM1R(Dictionary,has_all);
VCALL_LOCALMEM1(Dictionary,erase);
VCALL_LOCALMEM0R(Dictionary,hash);
VCALL_LOCALMEM0R(Dictionary,keys);
@ -593,6 +594,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
VCALL_PTR0R(Image, get_data);
VCALL_PTR3(Image, blit_rect);
VCALL_PTR1R(Image, converted);
VCALL_PTR0(Image, fix_alpha_edges);
VCALL_PTR0R( AABB, get_area );
VCALL_PTR0R( AABB, has_no_area );
@ -912,10 +914,22 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var
struct ConstantData {
Map<StringName,int> value;
#ifdef DEBUG_ENABLED
List<StringName> value_ordered;
#endif
};
static ConstantData* constant_data;
static void add_constant(int p_type, StringName p_constant_name, int p_constant_value) {
constant_data[p_type].value[p_constant_name] = p_constant_value;
#ifdef DEBUG_ENABLED
constant_data[p_type].value_ordered.push_back(p_constant_name);
#endif
}
};
_VariantCall::TypeFunc* _VariantCall::type_funcs=NULL;
@ -1199,9 +1213,15 @@ void Variant::get_numeric_constants_for_type(Variant::Type p_type, List<StringNa
_VariantCall::ConstantData& cd = _VariantCall::constant_data[p_type];
#ifdef DEBUG_ENABLED
for(List<StringName>::Element *E=cd.value_ordered.front();E;E=E->next()) {
p_constants->push_back(E->get());
#else
for(Map<StringName,int>::Element *E=cd.value.front();E;E=E->next()) {
p_constants->push_back(E->key());
#endif
}
}
@ -1273,11 +1293,11 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC1(STRING,STRING,String,left,INT,"pos",varray());
ADDFUNC1(STRING,STRING,String,right,INT,"pos",varray());
ADDFUNC0(STRING,STRING,String,strip_edges,varray());
ADDFUNC2(STRING,STRING,String,strip_edges,BOOL,"left",BOOL,"right",varray(true,true));
ADDFUNC0(STRING,STRING,String,extension,varray());
ADDFUNC0(STRING,STRING,String,basename,varray());
ADDFUNC1(STRING,STRING,String,plus_file,STRING,"file",varray());
ADDFUNC1(STRING,STRING,String,ord_at,INT,"at",varray());
ADDFUNC1(STRING,INT,String,ord_at,INT,"at",varray());
// ADDFUNC2(STRING,String,erase,INT,INT,varray());
ADDFUNC0(STRING,INT,String,hash,varray());
ADDFUNC0(STRING,STRING,String,md5_text,varray());
@ -1408,6 +1428,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC0(IMAGE, RAW_ARRAY, Image, get_data, varray());
ADDFUNC3(IMAGE, NIL, Image, blit_rect, IMAGE, "src", RECT2, "src_rect", VECTOR2, "dest", varray(0));
ADDFUNC1(IMAGE, IMAGE, Image, converted, INT, "format", varray(0));
ADDFUNC0(IMAGE, NIL, Image, fix_alpha_edges, varray());
ADDFUNC0(_RID,INT,RID,get_id,varray());
@ -1422,8 +1443,9 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC0(DICTIONARY,INT,Dictionary,size,varray());
ADDFUNC0(DICTIONARY,BOOL,Dictionary,empty,varray());
ADDFUNC0(DICTIONARY,NIL,Dictionary,clear,varray());
ADDFUNC1(DICTIONARY,BOOL,Dictionary,has,NIL,"value",varray());
ADDFUNC1(DICTIONARY,NIL,Dictionary,erase,NIL,"value",varray());
ADDFUNC1(DICTIONARY,BOOL,Dictionary,has,NIL,"key",varray());
ADDFUNC1(DICTIONARY,BOOL,Dictionary,has_all,ARRAY,"keys",varray());
ADDFUNC1(DICTIONARY,NIL,Dictionary,erase,NIL,"key",varray());
ADDFUNC0(DICTIONARY,INT,Dictionary,hash,varray());
ADDFUNC0(DICTIONARY,ARRAY,Dictionary,keys,varray());
@ -1565,10 +1587,10 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
ADDFUNC0(INPUT_EVENT,BOOL,InputEvent,is_pressed,varray());
ADDFUNC1(INPUT_EVENT,BOOL,InputEvent,is_action,STRING,"action",varray());
ADDFUNC1(INPUT_EVENT,BOOL,InputEvent,is_action_pressed,STRING,"is_action_pressed",varray());
ADDFUNC1(INPUT_EVENT,BOOL,InputEvent,is_action_released,STRING,"is_action_released",varray());
ADDFUNC1(INPUT_EVENT,BOOL,InputEvent,is_action_pressed,STRING,"action",varray());
ADDFUNC1(INPUT_EVENT,BOOL,InputEvent,is_action_released,STRING,"action",varray());
ADDFUNC0(INPUT_EVENT,BOOL,InputEvent,is_echo,varray());
ADDFUNC2(INPUT_EVENT,NIL,InputEvent,set_as_action,STRING,"action",BOOL,"pressed",varray());
ADDFUNC2(INPUT_EVENT,NIL,InputEvent,set_as_action,STRING,"action",BOOL,"pressed",varray());
/* REGISTER CONSTRUCTORS */
@ -1587,7 +1609,7 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
_VariantCall::add_constructor(_VariantCall::Plane_init3,Variant::PLANE,"normal",Variant::VECTOR3,"d",Variant::REAL);
_VariantCall::add_constructor(_VariantCall::Quat_init1,Variant::QUAT,"x",Variant::REAL,"y",Variant::REAL,"z",Variant::REAL,"w",Variant::REAL);
_VariantCall::add_constructor(_VariantCall::Quat_init2,Variant::QUAT,"axis",Variant::VECTOR3,"angle",Variant::REAL);
_VariantCall::add_constructor(_VariantCall::Quat_init2,Variant::QUAT,"axis",Variant::VECTOR3,"angle",Variant::REAL);
_VariantCall::add_constructor(_VariantCall::Color_init1,Variant::COLOR,"r",Variant::REAL,"g",Variant::REAL,"b",Variant::REAL,"a",Variant::REAL);
_VariantCall::add_constructor(_VariantCall::Color_init2,Variant::COLOR,"r",Variant::REAL,"g",Variant::REAL,"b",Variant::REAL);
@ -1604,51 +1626,54 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl
/* REGISTER CONSTANTS */
_VariantCall::constant_data[Variant::VECTOR3].value["AXIS_X"]=Vector3::AXIS_X;
_VariantCall::constant_data[Variant::VECTOR3].value["AXIS_Y"]=Vector3::AXIS_Y;
_VariantCall::constant_data[Variant::VECTOR3].value["AXIS_Z"]=Vector3::AXIS_Z;
_VariantCall::constant_data[Variant::INPUT_EVENT].value["NONE"]=InputEvent::NONE;
_VariantCall::constant_data[Variant::INPUT_EVENT].value["KEY"]=InputEvent::KEY;
_VariantCall::constant_data[Variant::INPUT_EVENT].value["MOUSE_MOTION"]=InputEvent::MOUSE_MOTION;
_VariantCall::constant_data[Variant::INPUT_EVENT].value["MOUSE_BUTTON"]=InputEvent::MOUSE_BUTTON;
_VariantCall::constant_data[Variant::INPUT_EVENT].value["JOYSTICK_MOTION"]=InputEvent::JOYSTICK_MOTION;
_VariantCall::constant_data[Variant::INPUT_EVENT].value["JOYSTICK_BUTTON"]=InputEvent::JOYSTICK_BUTTON;
_VariantCall::constant_data[Variant::INPUT_EVENT].value["SCREEN_TOUCH"]=InputEvent::SCREEN_TOUCH;
_VariantCall::constant_data[Variant::INPUT_EVENT].value["SCREEN_DRAG"]=InputEvent::SCREEN_DRAG;
_VariantCall::constant_data[Variant::INPUT_EVENT].value["ACTION"]=InputEvent::ACTION;
_VariantCall::constant_data[Variant::IMAGE].value["COMPRESS_BC"]=Image::COMPRESS_BC;
_VariantCall::constant_data[Variant::IMAGE].value["COMPRESS_PVRTC2"]=Image::COMPRESS_PVRTC2;
_VariantCall::constant_data[Variant::IMAGE].value["COMPRESS_PVRTC4"]=Image::COMPRESS_PVRTC4;
_VariantCall::constant_data[Variant::IMAGE].value["COMPRESS_ETC"]=Image::COMPRESS_ETC;
_VariantCall::add_constant(Variant::VECTOR3,"AXIS_X",Vector3::AXIS_X);
_VariantCall::add_constant(Variant::VECTOR3,"AXIS_Y",Vector3::AXIS_Y);
_VariantCall::add_constant(Variant::VECTOR3,"AXIS_Z",Vector3::AXIS_Z);
_VariantCall::add_constant(Variant::INPUT_EVENT,"NONE",InputEvent::NONE);
_VariantCall::add_constant(Variant::INPUT_EVENT,"KEY",InputEvent::KEY);
_VariantCall::add_constant(Variant::INPUT_EVENT,"MOUSE_MOTION",InputEvent::MOUSE_MOTION);
_VariantCall::add_constant(Variant::INPUT_EVENT,"MOUSE_BUTTON",InputEvent::MOUSE_BUTTON);
_VariantCall::add_constant(Variant::INPUT_EVENT,"JOYSTICK_MOTION",InputEvent::JOYSTICK_MOTION);
_VariantCall::add_constant(Variant::INPUT_EVENT,"JOYSTICK_BUTTON",InputEvent::JOYSTICK_BUTTON);
_VariantCall::add_constant(Variant::INPUT_EVENT,"SCREEN_TOUCH",InputEvent::SCREEN_TOUCH);
_VariantCall::add_constant(Variant::INPUT_EVENT,"SCREEN_DRAG",InputEvent::SCREEN_DRAG);
_VariantCall::add_constant(Variant::INPUT_EVENT,"ACTION",InputEvent::ACTION);
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_GRAYSCALE"]=Image::FORMAT_GRAYSCALE;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_INTENSITY"]=Image::FORMAT_INTENSITY;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_GRAYSCALE_ALPHA"]=Image::FORMAT_GRAYSCALE_ALPHA;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_RGB"]=Image::FORMAT_RGB;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_RGBA"]=Image::FORMAT_RGBA;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_INDEXED"]=Image::FORMAT_INDEXED;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_INDEXED_ALPHA"]=Image::FORMAT_INDEXED_ALPHA;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_YUV_422"]=Image::FORMAT_YUV_422;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_YUV_444"]=Image::FORMAT_YUV_444;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_BC1"]=Image::FORMAT_BC1;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_BC2"]=Image::FORMAT_BC2;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_BC3"]=Image::FORMAT_BC3;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_BC4"]=Image::FORMAT_BC4;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_BC5"]=Image::FORMAT_BC5;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_PVRTC2"]=Image::FORMAT_PVRTC2;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_PVRTC2_ALPHA"]=Image::FORMAT_PVRTC2_ALPHA;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_PVRTC4"]=Image::FORMAT_PVRTC4;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_PVRTC4_ALPHA"]=Image::FORMAT_PVRTC4_ALPHA;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_ETC"]=Image::FORMAT_ETC;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_ATC"]=Image::FORMAT_ATC;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_ATC_ALPHA_EXPLICIT"]=Image::FORMAT_ATC_ALPHA_EXPLICIT;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_ATC_ALPHA_INTERPOLATED"]=Image::FORMAT_ATC_ALPHA_INTERPOLATED;
_VariantCall::constant_data[Variant::IMAGE].value["FORMAT_CUSTOM"]=Image::FORMAT_CUSTOM;
_VariantCall::add_constant(Variant::IMAGE,"COMPRESS_BC",Image::COMPRESS_BC);
_VariantCall::add_constant(Variant::IMAGE,"COMPRESS_PVRTC2",Image::COMPRESS_PVRTC2);
_VariantCall::add_constant(Variant::IMAGE,"COMPRESS_PVRTC4",Image::COMPRESS_PVRTC4);
_VariantCall::add_constant(Variant::IMAGE,"COMPRESS_ETC",Image::COMPRESS_ETC);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_GRAYSCALE",Image::FORMAT_GRAYSCALE);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_INTENSITY",Image::FORMAT_INTENSITY);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_GRAYSCALE_ALPHA",Image::FORMAT_GRAYSCALE_ALPHA);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGB",Image::FORMAT_RGB);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGBA",Image::FORMAT_RGBA);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_INDEXED",Image::FORMAT_INDEXED);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_INDEXED_ALPHA",Image::FORMAT_INDEXED_ALPHA);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_YUV_422",Image::FORMAT_YUV_422);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_YUV_444",Image::FORMAT_YUV_444);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC1",Image::FORMAT_BC1);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC2",Image::FORMAT_BC2);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC3",Image::FORMAT_BC3);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC4",Image::FORMAT_BC4);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC5",Image::FORMAT_BC5);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC2",Image::FORMAT_PVRTC2);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC2_ALPHA",Image::FORMAT_PVRTC2_ALPHA);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC4",Image::FORMAT_PVRTC4);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC4_ALPHA",Image::FORMAT_PVRTC4_ALPHA);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_ETC",Image::FORMAT_ETC);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_ATC",Image::FORMAT_ATC);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_ATC_ALPHA_EXPLICIT",Image::FORMAT_ATC_ALPHA_EXPLICIT);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_ATC_ALPHA_INTERPOLATED",Image::FORMAT_ATC_ALPHA_INTERPOLATED);
_VariantCall::add_constant(Variant::IMAGE,"FORMAT_CUSTOM",Image::FORMAT_CUSTOM);
_VariantCall::add_constant(Variant::IMAGE,"INTERPOLATE_NEAREST",Image::INTERPOLATE_NEAREST);
_VariantCall::add_constant(Variant::IMAGE,"INTERPOLATE_BILINEAR",Image::INTERPOLATE_BILINEAR);
_VariantCall::add_constant(Variant::IMAGE,"INTERPOLATE_CUBIC",Image::INTERPOLATE_CUBIC);
}
void unregister_variant_methods() {

View File

@ -1354,7 +1354,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid)
return;
} else if (*str=="r8" ) {
valid=true;
v->g=float(p_value)/255.0;
v->r=float(p_value)/255.0;
return;
} else if (*str=="g8" ) {
valid=true;
@ -2213,16 +2213,16 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const {
return v->get_v();
} else if (*str=="r8") {
valid=true;
return v->r*255.0;
return (int)Math::round(v->r*255.0);
} else if (*str=="g8" ) {
valid=true;
return v->g*255.0;
return (int)Math::round(v->g*255.0);
} else if (*str=="b8" ) {
valid=true;
return v->b*255.0;
return (int)Math::round(v->b*255.0);
} else if (*str=="a8" ) {
valid=true;
return v->a*255.0;
return (int)Math::round(v->a*255.0);
}
} else if (p_index.get_type()==Variant::INT) {
@ -3431,6 +3431,65 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const {
}
void Variant::blend(const Variant& a, const Variant& b, float c, Variant &r_dst) {
if (a.type!=b.type) {
if(a.is_num() && b.is_num()) {
real_t va=a;
real_t vb=b;
r_dst=va + vb * c;
} else {
r_dst=a;
}
return;
}
switch(a.type) {
case NIL: { r_dst=Variant(); } return;
case INT:{
int va=a._data._int;
int vb=b._data._int;
r_dst=int(va + vb * c + 0.5);
} return;
case REAL:{
double ra=a._data._real;
double rb=b._data._real;
r_dst=ra + rb * c;
} return;
case VECTOR2:{ r_dst=*reinterpret_cast<const Vector2*>(a._data._mem)+*reinterpret_cast<const Vector2*>(b._data._mem)*c; } return;
case RECT2:{
const Rect2 *ra = reinterpret_cast<const Rect2*>(a._data._mem);
const Rect2 *rb = reinterpret_cast<const Rect2*>(b._data._mem);
r_dst=Rect2(ra->pos + rb->pos * c, ra->size + rb->size * c);
} return;
case VECTOR3:{ r_dst=*reinterpret_cast<const Vector3*>(a._data._mem)+*reinterpret_cast<const Vector3*>(b._data._mem)*c; } return;
case _AABB:{
const AABB *ra = reinterpret_cast<const AABB*>(a._data._mem);
const AABB *rb = reinterpret_cast<const AABB*>(b._data._mem);
r_dst=AABB(ra->pos + rb->pos * c, ra->size + rb->size * c);
} return;
case QUAT:{
Quat empty_rot;
const Quat *qa = reinterpret_cast<const Quat*>(a._data._mem);
const Quat *qb = reinterpret_cast<const Quat*>(b._data._mem);
r_dst=*qa * empty_rot.slerp(*qb,c);
} return;
case COLOR:{
const Color *ca = reinterpret_cast<const Color*>(a._data._mem);
const Color *cb = reinterpret_cast<const Color*>(b._data._mem);
float r = ca->r + cb->r * c;
float g = ca->g + cb->g * c;
float b = ca->b + cb->b * c;
float a = ca->a + cb->a * c;
r = r > 1.0 ? 1.0 : r;
g = g > 1.0 ? 1.0 : g;
b = b > 1.0 ? 1.0 : b;
a = a > 1.0 ? 1.0 : a;
r_dst=Color(r, g, b, a);
} return;
default:{ r_dst = c<0.5 ? a : b; } return;
}
}
void Variant::interpolate(const Variant& a, const Variant& b, float c,Variant &r_dst) {
if (a.type!=b.type) {

View File

@ -1747,7 +1747,20 @@ Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r
}
if (c>32) {
if (c!='=') {
if (c=='"') { //quoted
p_stream->saved='"';
Token tk;
Error err = get_token(p_stream,tk,line,r_err_str);
if (err)
return err;
if (tk.type!=TK_STRING) {
r_err_str="Error reading quoted string";
return err;
}
what=tk.value;
} else if (c!='=') {
what+=String::chr(c);
} else {
r_assign=what;
@ -1789,6 +1802,13 @@ Error VariantParser::parse(Stream *p_stream, Variant& r_ret, String &r_err_str,
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
static String rtosfix(double p_value) {
if (p_value==0.0)
return "0"; //avoid negative zero being written, which may annoy git, svn, etc. for changes when they don't exist.
else
return rtoss(p_value);
}
Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_string_func, void *p_store_string_ud,EncodeResourceFunc p_encode_res_func,void* p_encode_res_ud) {
@ -1807,7 +1827,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
} break;
case Variant::REAL: {
String s = rtoss(p_variant.operator real_t());
String s = rtosfix(p_variant.operator real_t());
if (s.find(".")==-1 && s.find("e")==-1)
s+=".0";
p_store_string_func(p_store_string_ud, s );
@ -1822,35 +1842,35 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
case Variant::VECTOR2: {
Vector2 v = p_variant;
p_store_string_func(p_store_string_ud,"Vector2( "+rtoss(v.x) +", "+rtoss(v.y)+" )" );
p_store_string_func(p_store_string_ud,"Vector2( "+rtosfix(v.x) +", "+rtosfix(v.y)+" )" );
} break;
case Variant::RECT2: {
Rect2 aabb = p_variant;
p_store_string_func(p_store_string_ud,"Rect2( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y)+" )" );
p_store_string_func(p_store_string_ud,"Rect2( "+rtosfix(aabb.pos.x) +", "+rtosfix(aabb.pos.y) +", "+rtosfix(aabb.size.x) +", "+rtosfix(aabb.size.y)+" )" );
} break;
case Variant::VECTOR3: {
Vector3 v = p_variant;
p_store_string_func(p_store_string_ud,"Vector3( "+rtoss(v.x) +", "+rtoss(v.y)+", "+rtoss(v.z)+" )");
p_store_string_func(p_store_string_ud,"Vector3( "+rtosfix(v.x) +", "+rtosfix(v.y)+", "+rtosfix(v.z)+" )");
} break;
case Variant::PLANE: {
Plane p = p_variant;
p_store_string_func(p_store_string_ud,"Plane( "+rtoss(p.normal.x) +", "+rtoss(p.normal.y)+", "+rtoss(p.normal.z)+", "+rtoss(p.d)+" )" );
p_store_string_func(p_store_string_ud,"Plane( "+rtosfix(p.normal.x) +", "+rtosfix(p.normal.y)+", "+rtosfix(p.normal.z)+", "+rtosfix(p.d)+" )" );
} break;
case Variant::_AABB: {
AABB aabb = p_variant;
p_store_string_func(p_store_string_ud,"AABB( "+rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.pos.z) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y) +", "+rtoss(aabb.size.z)+" )" );
p_store_string_func(p_store_string_ud,"AABB( "+rtosfix(aabb.pos.x) +", "+rtosfix(aabb.pos.y) +", "+rtosfix(aabb.pos.z) +", "+rtosfix(aabb.size.x) +", "+rtosfix(aabb.size.y) +", "+rtosfix(aabb.size.z)+" )" );
} break;
case Variant::QUAT: {
Quat quat = p_variant;
p_store_string_func(p_store_string_ud,"Quat( "+rtoss(quat.x)+", "+rtoss(quat.y)+", "+rtoss(quat.z)+", "+rtoss(quat.w)+" )");
p_store_string_func(p_store_string_ud,"Quat( "+rtosfix(quat.x)+", "+rtosfix(quat.y)+", "+rtosfix(quat.z)+", "+rtosfix(quat.w)+" )");
} break;
case Variant::MATRIX32: {
@ -1862,7 +1882,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i!=0 || j!=0)
s+=", ";
s+=rtoss( m3.elements[i][j] );
s+=rtosfix( m3.elements[i][j] );
}
}
@ -1878,7 +1898,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i!=0 || j!=0)
s+=", ";
s+=rtoss( m3.elements[i][j] );
s+=rtosfix( m3.elements[i][j] );
}
}
@ -1895,11 +1915,11 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i!=0 || j!=0)
s+=", ";
s+=rtoss( m3.elements[i][j] );
s+=rtosfix( m3.elements[i][j] );
}
}
s=s+", "+rtoss(t.origin.x) +", "+rtoss(t.origin.y)+", "+rtoss(t.origin.z);
s=s+", "+rtosfix(t.origin.x) +", "+rtosfix(t.origin.y)+", "+rtosfix(t.origin.z);
p_store_string_func(p_store_string_ud,s+" )");
} break;
@ -1908,7 +1928,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
case Variant::COLOR: {
Color c = p_variant;
p_store_string_func(p_store_string_ud,"Color( "+rtoss(c.r) +", "+rtoss(c.g)+", "+rtoss(c.b)+", "+rtoss(c.a)+" )");
p_store_string_func(p_store_string_ud,"Color( "+rtosfix(c.r) +", "+rtosfix(c.g)+", "+rtosfix(c.b)+", "+rtosfix(c.a)+" )");
} break;
case Variant::IMAGE: {
@ -2106,7 +2126,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i>0)
p_store_string_func(p_store_string_ud,", ");
p_store_string_func(p_store_string_ud,rtoss(ptr[i]));
p_store_string_func(p_store_string_ud,rtosfix(ptr[i]));
}
p_store_string_func(p_store_string_ud," )");
@ -2147,7 +2167,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i>0)
p_store_string_func(p_store_string_ud,", ");
p_store_string_func(p_store_string_ud,rtoss(ptr[i].x)+", "+rtoss(ptr[i].y) );
p_store_string_func(p_store_string_ud,rtosfix(ptr[i].x)+", "+rtosfix(ptr[i].y) );
}
p_store_string_func(p_store_string_ud," )");
@ -2165,7 +2185,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i>0)
p_store_string_func(p_store_string_ud,", ");
p_store_string_func(p_store_string_ud,rtoss(ptr[i].x)+", "+rtoss(ptr[i].y)+", "+rtoss(ptr[i].z) );
p_store_string_func(p_store_string_ud,rtosfix(ptr[i].x)+", "+rtosfix(ptr[i].y)+", "+rtosfix(ptr[i].z) );
}
p_store_string_func(p_store_string_ud," )");
@ -2185,7 +2205,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
if (i>0)
p_store_string_func(p_store_string_ud,", ");
p_store_string_func(p_store_string_ud,rtoss(ptr[i].r)+", "+rtoss(ptr[i].g)+", "+rtoss(ptr[i].b)+", "+rtoss(ptr[i].a) );
p_store_string_func(p_store_string_ud,rtosfix(ptr[i].r)+", "+rtosfix(ptr[i].g)+", "+rtosfix(ptr[i].b)+", "+rtosfix(ptr[i].a) );
}
p_store_string_func(p_store_string_ud," )");

View File

@ -69,10 +69,26 @@ class Vector {
}
_FORCE_INLINE_ int _get_alloc_size(int p_elements) const {
_FORCE_INLINE_ size_t _get_alloc_size(size_t p_elements) const {
//return nearest_power_of_2_templated(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int));
return nearest_power_of_2(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int));
}
return nearest_power_of_2(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int));
}
_FORCE_INLINE_ bool _get_alloc_size_checked(size_t p_elements, size_t *out) const {
#if defined(_add_overflow) && defined(_mul_overflow)
size_t o;
size_t p;
if (_mul_overflow(p_elements, sizeof(T), &o)) return false;
if (_add_overflow(o, sizeof(SafeRefCount)+sizeof(int), &p)) return false;
*out = nearest_power_of_2(p);
return true;
#else
// Speed is more important than correctness here, do the operations unchecked
// and hope the best
*out = _get_alloc_size(p_elements);
return true;
#endif
}
void _unref(void *p_data);
@ -257,19 +273,21 @@ Error Vector<T>::resize(int p_size) {
// possibly changing size, copy on write
_copy_on_write();
size_t alloc_size;
ERR_FAIL_COND_V(!_get_alloc_size_checked(p_size, &alloc_size), ERR_OUT_OF_MEMORY);
if (p_size>size()) {
if (size()==0) {
// alloc from scratch
void* ptr=memalloc(_get_alloc_size(p_size));
void* ptr=memalloc(alloc_size);
ERR_FAIL_COND_V( !ptr ,ERR_OUT_OF_MEMORY);
_ptr=(T*)((uint8_t*)ptr+sizeof(int)+sizeof(SafeRefCount));
_get_refcount()->init(); // init refcount
*_get_size()=0; // init size (currently, none)
} else {
void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount),_get_alloc_size(p_size));
void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount), alloc_size);
ERR_FAIL_COND_V( !_ptrnew ,ERR_OUT_OF_MEMORY);
_ptr=(T*)((uint8_t*)_ptrnew+sizeof(int)+sizeof(SafeRefCount));
}
@ -293,7 +311,7 @@ Error Vector<T>::resize(int p_size) {
t->~T();
}
void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount),_get_alloc_size(p_size));
void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount), alloc_size);
ERR_FAIL_COND_V( !_ptrnew ,ERR_OUT_OF_MEMORY);
_ptr=(T*)((uint8_t*)_ptrnew+sizeof(int)+sizeof(SafeRefCount));

View File

@ -1,5 +1,5 @@
[application]
name="Area 2D Input Events"
main_scene="res://input.scn"
main_scene="res://input.tscn"
icon="res://icon.png"

Binary file not shown.

View File

@ -0,0 +1,109 @@
[gd_scene load_steps=6 format=1]
[ext_resource path="res://input.gd" type="Script" id=1]
[ext_resource path="res://box_area.png" type="Texture" id=2]
[ext_resource path="res://circle_area.png" type="Texture" id=3]
[sub_resource type="RectangleShape2D" id=1]
custom_solver_bias = 0.0
extents = Vector2( 64, 64 )
[sub_resource type="CircleShape2D" id=2]
custom_solver_bias = 0.0
radius = 64.0
[node name="base" type="Node2D"]
[node name="box" type="Area2D" parent="."]
transform/pos = Vector2( 212, 281 )
transform/rot = 35.4081
input/pickable = true
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
script/script = ExtResource( 1 )
[node name="sprite" type="Sprite" parent="box"]
texture = ExtResource( 2 )
[node name="label" type="Label" parent="box"]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = -43.0
margin/top = 71.0
margin/right = 43.0
margin/bottom = 84.0
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="shape" type="CollisionShape2D" parent="box"]
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="circle" type="Area2D" parent="."]
transform/pos = Vector2( 547.877, 286.808 )
transform/rot = -40.5985
input/pickable = true
shapes/0/shape = SubResource( 2 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
script/script = ExtResource( 1 )
[node name="sprite" type="Sprite" parent="circle"]
texture = ExtResource( 3 )
[node name="label" type="Label" parent="circle"]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = -43.0
margin/top = 71.0
margin/right = 43.0
margin/bottom = 84.0
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="shape" type="CollisionShape2D" parent="circle"]
shape = SubResource( 2 )
trigger = false
_update_shape_index = -1
[node name="Label" type="Label" parent="."]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 40.0
margin/bottom = 13.0
text = "This demo shows how to use a regular Area2D to get input events, and how to convert the input events to local coordinates of the node.\nUnlike controls, Input on Area2D or PhysicsBody2D nodes only works properly (with scrolling) on canvas layer 0."
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

View File

@ -0,0 +1,47 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://ball.gd" type="Script" id=1]
[ext_resource path="res://ball.png" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 7.45713
[node name="bal" type="RigidBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
mode = 0
mass = 1.0
friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = 0
contacts_reported = 0
contact_monitor = false
sleeping = false
can_sleep = true
velocity/linear = Vector2( 0, 0 )
velocity/angular = 0.0
damp_override/linear = -1.0
damp_override/angular = -1.0
script/script = ExtResource( 1 )
[node name="sprite" type="Sprite" parent="."]
transform/pos = Vector2( 0, 1 )
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
trigger = false
_update_shape_index = 0

View File

@ -10,7 +10,7 @@ func _process(delta):
timeout -= delta
if (timeout < 0):
timeout = EMIT_INTERVAL
var ball = preload("res://ball.scn").instance()
var ball = preload("res://ball.tscn").instance()
ball.set_pos(Vector2(randf()*get_viewport_rect().size.x, 0))
add_child(ball)

View File

@ -0,0 +1,178 @@
[gd_scene load_steps=13 format=1]
[ext_resource path="res://dynamic_colobjs.gd" type="Script" id=1]
[ext_resource path="res://circle.png" type="Texture" id=2]
[ext_resource path="res://box.png" type="Texture" id=3]
[ext_resource path="res://poly.png" type="Texture" id=4]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 28.8504
[sub_resource type="RectangleShape2D" id=2]
custom_solver_bias = 0.0
extents = Vector2( 32.1805, 30.0328 )
[sub_resource type="ConvexPolygonShape2D" id=3]
custom_solver_bias = 0.0
points = Vector2Array( 49.5669, -27.9744, 45.1564, 15.3961, 18.6931, -1.51105 )
[sub_resource type="ConvexPolygonShape2D" id=4]
custom_solver_bias = 0.0
points = Vector2Array( -55.093, -14.2052, -37.1739, 2.89948, -40.1345, 21.2602, -53.3067, 15.8716 )
[sub_resource type="ConvexPolygonShape2D" id=5]
custom_solver_bias = 0.0
points = Vector2Array( -40.1345, 21.2602, -37.1739, 2.89948, -14.386, -14.0076, -6.30005, 0.694214 )
[sub_resource type="ConvexPolygonShape2D" id=6]
custom_solver_bias = 0.0
points = Vector2Array( -14.386, -14.0076, 18.6931, -1.51105, 45.1564, 15.3961, -6.30005, 0.694214 )
[sub_resource type="Animation" id=7]
resource/name = "movethem"
length = 4.0
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("base/circle:transform/pos")
tracks/0/interp = 1
tracks/0/keys = { "cont":true, "times":FloatArray( 0, 2 ), "transitions":FloatArray( 1, 1 ), "values":[ Vector2( 0, 0 ), Vector2( 52.7569, -70.845 ) ] }
tracks/1/type = "value"
tracks/1/path = NodePath("base/box:transform/pos")
tracks/1/interp = 1
tracks/1/keys = { "cont":true, "times":FloatArray( 0, 2 ), "transitions":FloatArray( 1, 1 ), "values":[ Vector2( 193.173, -2.72076 ), Vector2( 195.894, -72.0999 ) ] }
tracks/2/type = "value"
tracks/2/path = NodePath("base/box:transform/rot")
tracks/2/interp = 1
tracks/2/keys = { "cont":true, "times":FloatArray( 0, 2 ), "transitions":FloatArray( 1, 1 ), "values":[ 0.0, 92.8111 ] }
tracks/3/type = "value"
tracks/3/path = NodePath("base/polygon:transform/pos")
tracks/3/interp = 1
tracks/3/keys = { "cont":true, "times":FloatArray( 0, 2 ), "transitions":FloatArray( 1, 1 ), "values":[ Vector2( 382.265, -2.72076 ), Vector2( 495.176, -10.883 ) ] }
[sub_resource type="Animation" id=8]
resource/name = "toggletrigger"
length = 6.0
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("base/box:trigger")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 4 ), "transitions":FloatArray( 1, 1 ), "values":[ false, true ] }
tracks/1/type = "value"
tracks/1/path = NodePath("base/box:visibility/opacity")
tracks/1/interp = 1
tracks/1/keys = { "cont":false, "times":FloatArray( 0, 4 ), "transitions":FloatArray( 1, 1 ), "values":[ 1.0, 0.2 ] }
[node name="base" type="Node2D"]
script/script = ExtResource( 1 )
[node name="base" type="KinematicBody2D" parent="."]
transform/pos = Vector2( 137, 470 )
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 7.91353, -10.6267 )
shapes/0/trigger = false
shapes/1/shape = SubResource( 2 )
shapes/1/transform = Matrix32( 0.970626, -0.240595, 0.240595, 0.970626, 193.581, -13.1276 )
shapes/1/trigger = false
shapes/2/shape = SubResource( 3 )
shapes/2/transform = Matrix32( 1, 0, 0, 1, 399.202, -3.9451 )
shapes/2/trigger = false
shapes/3/shape = SubResource( 4 )
shapes/3/transform = Matrix32( 1, 0, 0, 1, 399.202, -3.9451 )
shapes/3/trigger = false
shapes/4/shape = SubResource( 5 )
shapes/4/transform = Matrix32( 1, 0, 0, 1, 399.202, -3.9451 )
shapes/4/trigger = false
shapes/5/shape = SubResource( 6 )
shapes/5/transform = Matrix32( 1, 0, 0, 1, 399.202, -3.9451 )
shapes/5/trigger = false
collision/layers = 1
collision/mask = 1
collision/margin = 0.08
[node name="circle" type="CollisionShape2D" parent="base"]
transform/pos = Vector2( 7.91353, -10.6267 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = 0
[node name="sprite" type="Sprite" parent="base/circle"]
texture = ExtResource( 2 )
[node name="box" type="CollisionShape2D" parent="base"]
transform/pos = Vector2( 193.581, -13.1276 )
transform/rot = 13.9217
shape = SubResource( 2 )
trigger = false
_update_shape_index = 1
[node name="Sprite" type="Sprite" parent="base/box"]
texture = ExtResource( 3 )
[node name="polygon" type="CollisionPolygon2D" parent="base"]
transform/pos = Vector2( 399.202, -3.9451 )
build_mode = 0
polygon = Vector2Array( -55.093, -14.2052, -37.1739, 2.89948, -14.386, -14.0076, 18.6931, -1.51105, 49.5669, -27.9744, 45.1564, 15.3961, -6.30005, 0.694214, -40.1345, 21.2602, -53.3067, 15.8716 )
shape_range = Vector2( 2, 5 )
trigger = false
[node name="Sprite" type="Sprite" parent="base/polygon"]
texture = ExtResource( 4 )
[node name="shapemove" type="AnimationPlayer" parent="."]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/movethem = SubResource( 7 )
playback/active = true
playback/speed = 1.0
blend_times = [ ]
autoplay = "movethem"
[node name="triggertoggle" type="AnimationPlayer" parent="."]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/movethem = SubResource( 7 )
anims/toggletrigger = SubResource( 8 )
playback/active = true
playback/speed = 1.0
blend_times = [ ]
autoplay = "toggletrigger"
[node name="Label" type="Label" parent="."]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 21.0
margin/top = 21.0
margin/right = 719.0
margin/bottom = 73.0
text = "This demo simply shows that it\'s possible now to move a CollisionShape and CollisionPolygon after it was created\nand also turn it into a trigger at run-time. CollisionShape will remain alive during the running game and you can\ninteract with them, even though they are just meant to be helpers.\nIt is always recommended in a real use-case scenario, to move a body instead of a shape, as that path is better optimized."
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

View File

@ -1,5 +1,5 @@
[application]
name="Run-Time CollisionShape"
main_scene="res://dynamic_colobjs.scn"
main_scene="res://dynamic_colobjs.tscn"
icon="res://icon.png"

View File

@ -1,7 +1,7 @@
[application]
name="Fog of War"
main_scene="res://fog.scn"
main_scene="res://fog.tscn"
icon="res://icon.png"
[input]

Binary file not shown.

View File

@ -0,0 +1,51 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://tileset.tres" type="TileSet" id=1]
[ext_resource path="res://troll.tscn" type="PackedScene" id=2]
[ext_resource path="res://fog.gd" type="Script" id=3]
[node name="Node2D" type="Node2D"]
[node name="TileMap" type="TileMap" parent="."]
transform/pos = Vector2( 206, 112 )
mode = 0
tile_set = ExtResource( 1 )
cell/size = Vector2( 48, 48 )
cell/quadrant_size = 16
cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
cell/half_offset = 2
cell/tile_origin = 0
cell/y_sort = false
collision/use_kinematic = false
collision/friction = 1.0
collision/bounce = 0.0
collision/layers = 1
collision/mask = 1
occluder/light_mask = 1
tile_data = IntArray( -589834, 2, -589833, 2, -589832, 2, -589831, 2, -589830, 2, -589829, 2, -589828, 2, -589827, 2, -589826, 2, -589825, 2, -655360, 2, -655359, 2, -655358, 2, -655357, 2, -655356, 2, -655355, 2, -655354, 2, -655353, 2, -655352, 2, -655351, 2, -524298, 2, -524297, 2, -524296, 2, -524295, 2, -524294, 2, -524293, 2, -524292, 2, -524291, 2, -524290, 2, -524289, 2, -589824, 2, -589823, 2, -589822, 2, -589821, 2, -589820, 2, -589819, 2, -589818, 2, -589817, 2, -589816, 2, -589815, 2, -458762, 2, -458761, 2, -458760, 2, -458759, 2, -458758, 2, -458757, 2, -458756, 2, -458755, 2, -458754, 2, -458753, 2, -524288, 2, -524287, 2, -524286, 2, -524285, 2, -524284, 2, -524283, 2, -524282, 2, -524281, 2, -524280, 2, -524279, 2, -393226, 2, -393225, 2, -393224, 2, -393223, 2, -393222, 2, -393221, 2, -393220, 2, -393219, 2, -393218, 2, -393217, 2, -458752, 2, -458751, 2, -458750, 2, -458749, 2, -458748, 2, -458747, 2, -458746, 2, -458745, 2, -458744, 2, -458743, 2, -327690, 2, -327689, 2, -327688, 2, -327687, 2, -327686, 2, -327685, 2, -327684, 2, -327683, 2, -327682, 2, -327681, 2, -393216, 2, -393215, 2, -393214, 2, -393213, 2, -393212, 2, -393211, 2, -393210, 2, -393209, 2, -393208, 2, -393207, 2, -262154, 2, -262153, 2, -262152, 2, -262151, 2, -262150, 2, -262149, 2, -262148, 2, -262147, 2, -262146, 2, -262145, 2, -327680, 2, -327679, 2, -327678, 2, -327677, 2, -327676, 2, -327675, 2, -327674, 2, -327673, 2, -327672, 2, -327671, 2, -196618, 2, -196617, 2, -196616, 2, -196615, 2, -196614, 2, -196613, 2, -196612, 2, -196611, 2, -196610, 2, -196609, 2, -262144, 2, -262143, 2, -262142, 2, -262141, 2, -262140, 2, -262139, 2, -262138, 2, -262137, 2, -262136, 2, -262135, 2, -131082, 2, -131081, 2, -131080, 2, -131079, 2, -131078, 2, -131077, 2, -131076, 2, -131075, 2, -131074, 2, -131073, 2, -196608, 2, -196607, 2, -196606, 2, -196605, 2, -196604, 2, -196603, 2, -196602, 2, -196601, 2, -196600, 2, -196599, 2, -65546, 2, -65545, 2, -65544, 2, -65543, 2, -65542, 2, -65541, 2, -65540, 2, -65539, 2, -65538, 2, -65537, 2, -131072, 2, -131071, 2, -131070, 2, -131069, 2, -131068, 2, -131067, 2, -131066, 2, -131065, 2, -131064, 2, -131063, 2, -10, 2, -9, 2, -8, 2, -7, 2, -6, 2, -5, 2, -4, 2, -3, 2, -2, 2, -1, 2, -65536, 2, -65535, 2, -65534, 2, -65533, 2, -65532, 2, -65531, 2, -65530, 2, -65529, 2, -65528, 2, -65527, 2, 65526, 2, 65527, 2, 65528, 2, 65529, 2, 65530, 2, 65531, 2, 65532, 2, 65533, 2, 65534, 2, 65535, 2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 131062, 2, 131063, 2, 131064, 2, 131065, 2, 131066, 2, 131067, 2, 131068, 2, 131069, 2, 131070, 2, 131071, 2, 65536, 2, 65537, 2, 65538, 2, 65539, 2, 65540, 2, 65541, 2, 65542, 2, 65543, 2, 65544, 2, 65545, 2, 196598, 2, 196599, 2, 196600, 2, 196601, 2, 196602, 2, 196603, 2, 196604, 2, 196605, 2, 196606, 2, 196607, 2, 131072, 2, 131073, 2, 131074, 2, 131075, 2, 131076, 2, 131077, 2, 131078, 2, 131079, 2, 131080, 2, 131081, 2, 262134, 2, 262135, 2, 262136, 2, 262137, 2, 262138, 2, 262139, 2, 262140, 2, 262141, 2, 262142, 2, 262143, 2, 196608, 2, 196609, 2, 196610, 2, 196611, 2, 196612, 2, 196613, 2, 196614, 2, 196615, 2, 196616, 2, 196617, 2, 327670, 2, 327671, 2, 327672, 2, 327673, 2, 327674, 2, 327675, 2, 327676, 2, 327677, 2, 327678, 2, 327679, 2, 262144, 2, 262145, 2, 262146, 2, 262147, 2, 262148, 2, 262149, 2, 262150, 2, 262151, 2, 262152, 2, 262153, 2, 393206, 2, 393207, 2, 393208, 2, 393209, 2, 393210, 2, 393211, 2, 393212, 2, 393213, 2, 393214, 2, 393215, 2, 327680, 2, 327681, 2, 327682, 2, 327683, 2, 327684, 2, 327685, 2, 327686, 2, 327687, 2, 327688, 2, 327689, 2, 458742, 2, 458743, 2, 458744, 2, 458745, 2, 458746, 2, 458747, 2, 458748, 2, 458749, 2, 458750, 2, 458751, 2, 393216, 2, 393217, 2, 393218, 2, 393219, 2, 393220, 2, 393221, 2, 393222, 2, 393223, 2, 393224, 2, 393225, 2, 524278, 2, 524279, 2, 524280, 2, 524281, 2, 524282, 2, 524283, 2, 524284, 2, 524285, 2, 524286, 2, 524287, 2, 458752, 2, 458753, 2, 458754, 2, 458755, 2, 458756, 2, 458757, 2, 458758, 2, 458759, 2, 458760, 2, 458761, 2, 589814, 2, 589815, 2, 589816, 2, 589817, 2, 589818, 2, 589819, 2, 589820, 2, 589821, 2, 589822, 2, 589823, 2, 524288, 2, 524289, 2, 524290, 2, 524291, 2, 524292, 2, 524293, 2, 524294, 2, 524295, 2, 524296, 2, 524297, 2, 655350, 2, 655351, 2, 655352, 2, 655353, 2, 655354, 2, 655355, 2, 655356, 2, 655357, 2, 655358, 2, 655359, 2, 589824, 2, 589825, 2, 589826, 2, 589827, 2, 589828, 2, 589829, 2, 589830, 2, 589831, 2, 589832, 2, 589833, 2 )
[node name="troll" parent="." instance=ExtResource( 2 )]
collision/margin = 0.001
[node name="Fog" type="TileMap" parent="."]
mode = 0
tile_set = ExtResource( 1 )
cell/size = Vector2( 48, 48 )
cell/quadrant_size = 16
cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
cell/half_offset = 2
cell/tile_origin = 0
cell/y_sort = false
collision/use_kinematic = false
collision/friction = 1.0
collision/bounce = 0.0
collision/layers = 1
collision/mask = 1
occluder/light_mask = 1
tile_data = IntArray( )
script/script = ExtResource( 3 )

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<resource_file type="TileSet" subresource_count="3" version="1.0" version_name="Godot Engine v1.0.stable.custom_build">
<ext_resource path="res://floor.png" type="Texture"></ext_resource>
<ext_resource path="res://fog.png" type="Texture"></ext_resource>
<main_resource>
<string name="0/name"> "fog opaque" </string>
<resource name="0/texture" resource_type="Texture" path="res://fog.png"> </resource>
<vector2 name="0/tex_offset"> -48, -48 </vector2>
<vector2 name="0/shape_offset"> 0, 0 </vector2>
<rect2 name="0/region"> 0, 0, 144, 144 </rect2>
<array name="0/shapes" len="0" shared="false">
</array>
<string name="1/name"> "fog transparent" </string>
<resource name="1/texture" resource_type="Texture" path="res://fog.png"> </resource>
<vector2 name="1/tex_offset"> -48, -48 </vector2>
<vector2 name="1/shape_offset"> 0, 0 </vector2>
<rect2 name="1/region"> 144, 0, 144, 144 </rect2>
<array name="1/shapes" len="0" shared="false">
</array>
<string name="2/name"> "floor" </string>
<resource name="2/texture" resource_type="Texture" path="res://floor.png"> </resource>
<vector2 name="2/tex_offset"> 0, 0 </vector2>
<vector2 name="2/shape_offset"> 0, 0 </vector2>
<rect2 name="2/region"> 0, 0, 0, 0 </rect2>
<array name="2/shapes" len="0" shared="false">
</array>
</main_resource>
</resource_file>

Binary file not shown.

View File

@ -0,0 +1,32 @@
[gd_resource type="TileSet" load_steps=3 format=1]
[ext_resource path="res://fog.png" type="Texture" id=1]
[ext_resource path="res://floor.png" type="Texture" id=2]
[resource]
0/name = "fog opaque"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( -48, -48 )
0/region = Rect2( 0, 0, 144, 144 )
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shapes = [ ]
1/name = "fog transparent"
1/texture = ExtResource( 1 )
1/tex_offset = Vector2( -48, -48 )
1/region = Rect2( 144, 0, 144, 144 )
1/occluder_offset = Vector2( 0, 0 )
1/navigation_offset = Vector2( 0, 0 )
1/shape_offset = Vector2( 0, 0 )
1/shapes = [ ]
2/name = "floor"
2/texture = ExtResource( 2 )
2/tex_offset = Vector2( 0, 0 )
2/region = Rect2( 0, 0, 0, 0 )
2/occluder_offset = Vector2( 24, 24 )
2/navigation_offset = Vector2( 24, 24 )
2/shape_offset = Vector2( 0, 0 )
2/shapes = [ ]

View File

@ -0,0 +1,30 @@
[gd_scene load_steps=3 format=1]
[ext_resource path="res://fog.png" type="Texture" id=1]
[ext_resource path="res://floor.png" type="Texture" id=2]
[node name="Node2D" type="Node2D"]
[node name="fog opaque" type="Sprite" parent="."]
texture = ExtResource( 1 )
centered = false
offset = Vector2( -48, -48 )
region = true
region_rect = Rect2( 0, 0, 144, 144 )
[node name="fog transparent" type="Sprite" parent="."]
transform/pos = Vector2( 144, 0 )
texture = ExtResource( 1 )
centered = false
offset = Vector2( -48, -48 )
region = true
region_rect = Rect2( 144, 0, 144, 144 )
[node name="floor" type="Sprite" parent="."]
transform/pos = Vector2( 264, 24 )
texture = ExtResource( 2 )

Binary file not shown.

View File

@ -0,0 +1,52 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://troll.gd" type="Script" id=1]
[ext_resource path="res://troll.png" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 16.0
[node name="troll" type="KinematicBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 3.24216, 19.453 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
collision/margin = 0.001
script/script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/pos = Vector2( 3.24216, 19.453 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="Camera2D" type="Camera2D" parent="."]
anchor_mode = 1
rotating = false
current = true
zoom = Vector2( 1, 1 )
limit/left = -10000000
limit/top = -10000000
limit/right = 10000000
limit/bottom = 10000000
drag_margin/h_enabled = true
drag_margin/v_enabled = true
smoothing/enable = false
smoothing/speed = 5.0
drag_margin/left = 0.2
drag_margin/top = 0.2
drag_margin/right = 0.2
drag_margin/bottom = 0.2

Binary file not shown.

View File

@ -0,0 +1,88 @@
[gd_scene load_steps=5 format=1]
[ext_resource path="res://beach_cave.gd" type="Script" id=1]
[ext_resource path="res://ocean_beach.png" type="Texture" id=2]
[ext_resource path="res://ocean_cave.png" type="Texture" id=3]
[sub_resource type="Environment" id=1]
ambient_light/enabled = false
ambient_light/color = Color( 0, 0, 0, 1 )
ambient_light/energy = 1.0
fxaa/enabled = false
background/mode = 5
background/color = Color( 0, 0, 0, 1 )
background/energy = 1.0
background/scale = 1.0
background/glow = 0.0
background/canvas_max_layer = null
glow/enabled = true
glow/blur_passes = 3
glow/blur_scale = 1.2
glow/blur_strength = 1.2
glow/blur_blend_mode = 0
glow/bloom = 0.0
glow/bloom_treshold = 0.5
dof_blur/enabled = false
dof_blur/blur_passes = 1
dof_blur/begin = 100.0
dof_blur/range = 10.0
hdr/enabled = true
hdr/tonemapper = 0.0
hdr/exposure = 0.5
hdr/white = 1.0
hdr/glow_treshold = 0.7
hdr/glow_scale = 0.5
hdr/min_luminance = 0.3
hdr/max_luminance = 8.0
hdr/exposure_adj_speed = 2.0
fog/enabled = false
fog/begin = 100.0
fog/begin_color = Color( 0, 0, 0, 1 )
fog/end_color = Color( 0, 0, 0, 1 )
fog/attenuation = 1.0
fog/bg = true
bcs/enabled = false
bcs/brightness = 1.0
bcs/contrast = 1.0
bcs/saturation = 1.0
srgb/enabled = true
[node name="hdr" type="Node2D"]
script/script = ExtResource( 1 )
[node name="beach" type="Sprite" parent="."]
texture = ExtResource( 2 )
centered = false
modulate = Color( 2, 2, 2, 1 )
[node name="cave" type="Sprite" parent="."]
transform/scale = Vector2( 1.2, 1 )
texture = ExtResource( 3 )
centered = false
modulate = Color( 0.233166, 0.221219, 0.23582, 1 )
[node name="environment" type="WorldEnvironment" parent="."]
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
environment = SubResource( 1 )
[node name="Label" type="Label" parent="."]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 40.0
margin/bottom = 13.0
custom_colors/font_color = Color( 0.213955, 0.205626, 0.20313, 1 )
text = "Drag Left and Right"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

View File

@ -1,7 +1,7 @@
[application]
name="HDR for 2D"
main_scene="res://beach_cave.scn"
main_scene="res://beach_cave.tscn"
icon="res://icon.png"
[display]

View File

@ -1,7 +1,7 @@
[application]
name="Hexagonal Game"
main_scene="res://map.scn"
main_scene="res://map.tscn"
icon="res://icon.png"
[input]

Binary file not shown.

31
demos/2d/hexamap/map.tscn Normal file
View File

@ -0,0 +1,31 @@
[gd_scene load_steps=3 format=1]
[ext_resource path="res://tileset.tres" type="TileSet" id=1]
[ext_resource path="res://troll.tscn" type="PackedScene" id=2]
[node name="Node2D" type="Node2D"]
[node name="TileMap" type="TileMap" parent="."]
mode = 0
tile_set = ExtResource( 1 )
cell/size = Vector2( 82, 94 )
cell/quadrant_size = 16
cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
cell/half_offset = 1
cell/tile_origin = 0
cell/y_sort = false
collision/use_kinematic = false
collision/friction = 1.0
collision/bounce = 0.0
collision/layers = 1
collision/mask = 1
occluder/light_mask = 1
tile_data = IntArray( -458747, 1073741831, -393213, 1073741831, -393212, 1073741831, -393211, 6, -393210, 1073741831, -393209, 1073741830, -393208, 1073741830, -393207, 6, -393206, 8, -327679, 1073741831, -327678, 1073741831, -327677, 1073741831, -327676, 1073741830, -327675, 1073741831, -327674, 6, -327673, 6, -327672, 6, -327671, 6, -327670, 6, -327669, 0, -327668, 0, -262143, 1073741831, -262142, 1073741831, -262141, 6, -262140, 6, -262139, 0, -262138, 6, -262137, 1, -262136, 0, -262135, 1, -262134, 1, -262133, 0, -262132, 0, -262131, 0, -196608, 9, -196607, 1073741832, -196606, 1073741830, -196605, 2, -196604, 2, -196603, 1073741845, -196602, 21, -196601, 19, -196600, 1073741826, -196599, 0, -196598, 16, -196597, 0, -196596, 0, -196595, 0, -196594, 0, -196593, 0, -131071, 0, -131070, 1, -131069, 1073741827, -131068, 1073741846, -131067, 20, -131066, 19, -131065, 2, -131064, 0, -131063, 14, -131062, 0, -131061, 0, -131060, 0, -131059, 0, -131058, 0, -131057, 0, -131056, 0, -65534, 1, -65533, 2, -65532, 1073741827, -65531, 1, -65530, 1, -65529, 0, -65528, 10, -65527, 12, -65526, 0, -65525, 0, -65524, 0, -65523, 0, -65522, 0, -65521, 0, -65520, 0, 1, 0, 2, 0, 3, 2, 4, 1073741826, 5, 1, 6, 15, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, 0, 65537, 0, 65538, 1, 65539, 1610612749, 65540, 1, 65541, 0, 65542, 0, 65543, 0, 65544, 0, 65545, 1610612753, 65546, 0, 65547, 0, 65548, 0, 65549, 0, 65550, 1073741848, 65551, 1073741849, 65552, 0, 131073, 0, 131074, 0, 131075, 0, 131076, 0, 131077, 1610612751, 131078, 1610612752, 131079, 1610612752, 131080, 1610612751, 131081, 1610612751, 131082, 0, 131083, 0, 131084, 0, 131085, 0, 131086, 0, 196612, 0, 196613, 1610612751, 196614, 1610612752, 196615, 1610612751, 196616, 1610612751, 196617, 1073741839, 196618, 1073741839, 196619, 0, 196620, 0, 196621, 0, 262150, 0, 262152, 0, 262154, 0, 262156, 0 )
[node name="troll" parent="." instance=ExtResource( 2 )]
transform/pos = Vector2( 602.819, -39.2876 )
collision/margin = 0.001

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,240 @@
[gd_resource type="TileSet" load_steps=27 format=1]
[ext_resource path="res://WWT-01.png" type="Texture" id=1]
[ext_resource path="res://WWT-02.png" type="Texture" id=2]
[ext_resource path="res://WWT-11.png" type="Texture" id=3]
[ext_resource path="res://WWT-12.png" type="Texture" id=4]
[ext_resource path="res://WWT-13.png" type="Texture" id=5]
[ext_resource path="res://WWT-14.png" type="Texture" id=6]
[ext_resource path="res://WWT-15.png" type="Texture" id=7]
[ext_resource path="res://WWT-16.png" type="Texture" id=8]
[ext_resource path="res://WWT-17.png" type="Texture" id=9]
[ext_resource path="res://WWT-18.png" type="Texture" id=10]
[ext_resource path="res://WWT-19.png" type="Texture" id=11]
[ext_resource path="res://WWT-20.png" type="Texture" id=12]
[ext_resource path="res://WWT-03.png" type="Texture" id=13]
[ext_resource path="res://WWT-21.png" type="Texture" id=14]
[ext_resource path="res://WWT-22.png" type="Texture" id=15]
[ext_resource path="res://WWT-23.png" type="Texture" id=16]
[ext_resource path="res://WWT-24.png" type="Texture" id=17]
[ext_resource path="res://WWT-25.png" type="Texture" id=18]
[ext_resource path="res://WWT-26.png" type="Texture" id=19]
[ext_resource path="res://WWT-04.png" type="Texture" id=20]
[ext_resource path="res://WWT-05.png" type="Texture" id=21]
[ext_resource path="res://WWT-06.png" type="Texture" id=22]
[ext_resource path="res://WWT-07.png" type="Texture" id=23]
[ext_resource path="res://WWT-08.png" type="Texture" id=24]
[ext_resource path="res://WWT-09.png" type="Texture" id=25]
[ext_resource path="res://WWT-10.png" type="Texture" id=26]
[resource]
0/name = "Tile 1"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( -24, -17 )
0/region = Rect2( 0, 0, 0, 0 )
0/occluder_offset = Vector2( -0, -0 )
0/navigation_offset = Vector2( -0, -0 )
0/shape_offset = Vector2( 0, 0 )
0/shapes = [ ]
1/name = "Tile 2"
1/texture = ExtResource( 2 )
1/tex_offset = Vector2( -24, -17 )
1/region = Rect2( 0, 0, 0, 0 )
1/occluder_offset = Vector2( -0, -0 )
1/navigation_offset = Vector2( -0, -0 )
1/shape_offset = Vector2( 0, 0 )
1/shapes = [ ]
2/name = "Tile 3"
2/texture = ExtResource( 13 )
2/tex_offset = Vector2( -24, -17 )
2/region = Rect2( 0, 0, 0, 0 )
2/occluder_offset = Vector2( -0, -0 )
2/navigation_offset = Vector2( -0, -0 )
2/shape_offset = Vector2( 0, 0 )
2/shapes = [ ]
3/name = "Tile 4"
3/texture = ExtResource( 20 )
3/tex_offset = Vector2( -24, -17 )
3/region = Rect2( 0, 0, 0, 0 )
3/occluder_offset = Vector2( -0, -0 )
3/navigation_offset = Vector2( -0, -0 )
3/shape_offset = Vector2( 0, 0 )
3/shapes = [ ]
4/name = "Tile 5"
4/texture = ExtResource( 21 )
4/tex_offset = Vector2( -24, -17 )
4/region = Rect2( 0, 0, 0, 0 )
4/occluder_offset = Vector2( -0, -0 )
4/navigation_offset = Vector2( -0, -0 )
4/shape_offset = Vector2( 0, 0 )
4/shapes = [ ]
5/name = "Tile 6"
5/texture = ExtResource( 22 )
5/tex_offset = Vector2( -24, -17 )
5/region = Rect2( 0, 0, 0, 0 )
5/occluder_offset = Vector2( -0, -0 )
5/navigation_offset = Vector2( -0, -0 )
5/shape_offset = Vector2( 0, 0 )
5/shapes = [ ]
6/name = "Tile 7"
6/texture = ExtResource( 23 )
6/tex_offset = Vector2( -24, -17 )
6/region = Rect2( 0, 0, 0, 0 )
6/occluder_offset = Vector2( -0, -0 )
6/navigation_offset = Vector2( -0, -0 )
6/shape_offset = Vector2( 0, 0 )
6/shapes = [ ]
7/name = "Tile 8"
7/texture = ExtResource( 24 )
7/tex_offset = Vector2( -24, -17 )
7/region = Rect2( 0, 0, 0, 0 )
7/occluder_offset = Vector2( -0, -0 )
7/navigation_offset = Vector2( -0, -0 )
7/shape_offset = Vector2( 0, 0 )
7/shapes = [ ]
8/name = "Tile 9"
8/texture = ExtResource( 25 )
8/tex_offset = Vector2( -24, -17 )
8/region = Rect2( 0, 0, 0, 0 )
8/occluder_offset = Vector2( -0, -0 )
8/navigation_offset = Vector2( -0, -0 )
8/shape_offset = Vector2( 0, 0 )
8/shapes = [ ]
9/name = "Tile 10"
9/texture = ExtResource( 26 )
9/tex_offset = Vector2( -24, -17 )
9/region = Rect2( 0, 0, 0, 0 )
9/occluder_offset = Vector2( -0, -0 )
9/navigation_offset = Vector2( -0, -0 )
9/shape_offset = Vector2( 0, 0 )
9/shapes = [ ]
10/name = "Tile 11"
10/texture = ExtResource( 3 )
10/tex_offset = Vector2( -24, -17 )
10/region = Rect2( 0, 0, 0, 0 )
10/occluder_offset = Vector2( -0, -0 )
10/navigation_offset = Vector2( -0, -0 )
10/shape_offset = Vector2( 0, 0 )
10/shapes = [ ]
11/name = "Tile 12"
11/texture = ExtResource( 4 )
11/tex_offset = Vector2( -24, -17 )
11/region = Rect2( 0, 0, 0, 0 )
11/occluder_offset = Vector2( -0, -0 )
11/navigation_offset = Vector2( -0, -0 )
11/shape_offset = Vector2( 0, 0 )
11/shapes = [ ]
12/name = "Tile 13"
12/texture = ExtResource( 5 )
12/tex_offset = Vector2( -24, -17 )
12/region = Rect2( 0, 0, 0, 0 )
12/occluder_offset = Vector2( -0, -0 )
12/navigation_offset = Vector2( -0, -0 )
12/shape_offset = Vector2( 0, 0 )
12/shapes = [ ]
13/name = "Tile 14"
13/texture = ExtResource( 6 )
13/tex_offset = Vector2( -24, -17 )
13/region = Rect2( 0, 0, 0, 0 )
13/occluder_offset = Vector2( -0, -0 )
13/navigation_offset = Vector2( -0, -0 )
13/shape_offset = Vector2( 0, 0 )
13/shapes = [ ]
14/name = "Tile 15"
14/texture = ExtResource( 7 )
14/tex_offset = Vector2( -24, -17 )
14/region = Rect2( 0, 0, 0, 0 )
14/occluder_offset = Vector2( -0, -0 )
14/navigation_offset = Vector2( -0, -0 )
14/shape_offset = Vector2( 0, 0 )
14/shapes = [ ]
15/name = "Tile 16"
15/texture = ExtResource( 8 )
15/tex_offset = Vector2( -24, -17 )
15/region = Rect2( 0, 0, 0, 0 )
15/occluder_offset = Vector2( -0, -0 )
15/navigation_offset = Vector2( -0, -0 )
15/shape_offset = Vector2( 0, 0 )
15/shapes = [ ]
16/name = "Tile 17"
16/texture = ExtResource( 9 )
16/tex_offset = Vector2( -24, -17 )
16/region = Rect2( 0, 0, 0, 0 )
16/occluder_offset = Vector2( -0, -0 )
16/navigation_offset = Vector2( -0, -0 )
16/shape_offset = Vector2( 0, 0 )
16/shapes = [ ]
17/name = "Tile 18"
17/texture = ExtResource( 10 )
17/tex_offset = Vector2( -24, -17 )
17/region = Rect2( 0, 0, 0, 0 )
17/occluder_offset = Vector2( -0, -0 )
17/navigation_offset = Vector2( -0, -0 )
17/shape_offset = Vector2( 0, 0 )
17/shapes = [ ]
18/name = "Tile 19"
18/texture = ExtResource( 11 )
18/tex_offset = Vector2( -24, -17 )
18/region = Rect2( 0, 0, 0, 0 )
18/occluder_offset = Vector2( -0, -0 )
18/navigation_offset = Vector2( -0, -0 )
18/shape_offset = Vector2( 0, 0 )
18/shapes = [ ]
19/name = "Tile 20"
19/texture = ExtResource( 12 )
19/tex_offset = Vector2( -24, -17 )
19/region = Rect2( 0, 0, 0, 0 )
19/occluder_offset = Vector2( -0, -0 )
19/navigation_offset = Vector2( -0, -0 )
19/shape_offset = Vector2( 0, 0 )
19/shapes = [ ]
20/name = "Tile 21"
20/texture = ExtResource( 14 )
20/tex_offset = Vector2( -24, -17 )
20/region = Rect2( 0, 0, 0, 0 )
20/occluder_offset = Vector2( -0, -0 )
20/navigation_offset = Vector2( -0, -0 )
20/shape_offset = Vector2( 0, 0 )
20/shapes = [ ]
21/name = "Tile 22"
21/texture = ExtResource( 15 )
21/tex_offset = Vector2( -24, -17 )
21/region = Rect2( 0, 0, 0, 0 )
21/occluder_offset = Vector2( -0, -0 )
21/navigation_offset = Vector2( -0, -0 )
21/shape_offset = Vector2( 0, 0 )
21/shapes = [ ]
22/name = "Tile 23"
22/texture = ExtResource( 16 )
22/tex_offset = Vector2( -24, -17 )
22/region = Rect2( 0, 0, 0, 0 )
22/occluder_offset = Vector2( -0, -0 )
22/navigation_offset = Vector2( -0, -0 )
22/shape_offset = Vector2( 0, 0 )
22/shapes = [ ]
23/name = "Tile 24"
23/texture = ExtResource( 17 )
23/tex_offset = Vector2( -24, -17 )
23/region = Rect2( 0, 0, 0, 0 )
23/occluder_offset = Vector2( -0, -0 )
23/navigation_offset = Vector2( -0, -0 )
23/shape_offset = Vector2( 0, 0 )
23/shapes = [ ]
24/name = "Tile 25"
24/texture = ExtResource( 18 )
24/tex_offset = Vector2( -24, -17 )
24/region = Rect2( 0, 0, 0, 0 )
24/occluder_offset = Vector2( -0, -0 )
24/navigation_offset = Vector2( -0, -0 )
24/shape_offset = Vector2( 0, 0 )
24/shapes = [ ]
25/name = "Tile 26"
25/texture = ExtResource( 19 )
25/tex_offset = Vector2( -24, -17 )
25/region = Rect2( 0, 0, 0, 0 )
25/occluder_offset = Vector2( -0, -0 )
25/navigation_offset = Vector2( -0, -0 )
25/shape_offset = Vector2( 0, 0 )
25/shapes = [ ]

View File

@ -0,0 +1,214 @@
[gd_scene load_steps=27 format=1]
[ext_resource path="res://WWT-01.png" type="Texture" id=1]
[ext_resource path="res://WWT-02.png" type="Texture" id=2]
[ext_resource path="res://WWT-03.png" type="Texture" id=3]
[ext_resource path="res://WWT-04.png" type="Texture" id=4]
[ext_resource path="res://WWT-05.png" type="Texture" id=5]
[ext_resource path="res://WWT-06.png" type="Texture" id=6]
[ext_resource path="res://WWT-07.png" type="Texture" id=7]
[ext_resource path="res://WWT-08.png" type="Texture" id=8]
[ext_resource path="res://WWT-09.png" type="Texture" id=9]
[ext_resource path="res://WWT-10.png" type="Texture" id=10]
[ext_resource path="res://WWT-11.png" type="Texture" id=11]
[ext_resource path="res://WWT-12.png" type="Texture" id=12]
[ext_resource path="res://WWT-13.png" type="Texture" id=13]
[ext_resource path="res://WWT-14.png" type="Texture" id=14]
[ext_resource path="res://WWT-15.png" type="Texture" id=15]
[ext_resource path="res://WWT-16.png" type="Texture" id=16]
[ext_resource path="res://WWT-17.png" type="Texture" id=17]
[ext_resource path="res://WWT-18.png" type="Texture" id=18]
[ext_resource path="res://WWT-19.png" type="Texture" id=19]
[ext_resource path="res://WWT-20.png" type="Texture" id=20]
[ext_resource path="res://WWT-21.png" type="Texture" id=21]
[ext_resource path="res://WWT-22.png" type="Texture" id=22]
[ext_resource path="res://WWT-23.png" type="Texture" id=23]
[ext_resource path="res://WWT-24.png" type="Texture" id=24]
[ext_resource path="res://WWT-25.png" type="Texture" id=25]
[ext_resource path="res://WWT-26.png" type="Texture" id=26]
[node name="Node2D" type="Node2D"]
[node name="Tile 1" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 1 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 2" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 2 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 3" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 3 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 4" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 4 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 5" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 5 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 6" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 6 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 7" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 7 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 8" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 8 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 9" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 9 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 10" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 10 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 11" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 11 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 12" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 12 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 13" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 13 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 14" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 14 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 15" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 15 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 16" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 16 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 17" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 17 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 18" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 18 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 19" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 19 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 20" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 20 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 21" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 21 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 22" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 22 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 23" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 23 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 24" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 24 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 25" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 25 )
centered = false
offset = Vector2( -24, -17 )
[node name="Tile 26" type="Sprite" parent="."]
transform/pos = Vector2( 96.6174, 42.2665 )
texture = ExtResource( 26 )
centered = false
offset = Vector2( -24, -17 )

Binary file not shown.

View File

@ -0,0 +1,52 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://troll.gd" type="Script" id=1]
[ext_resource path="res://troll.png" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 16.0
[node name="troll" type="KinematicBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 3.24216, 19.453 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
collision/margin = 0.001
script/script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/pos = Vector2( 3.24216, 19.453 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="Camera2D" type="Camera2D" parent="."]
anchor_mode = 1
rotating = false
current = true
zoom = Vector2( 1, 1 )
limit/left = -10000000
limit/top = -10000000
limit/right = 10000000
limit/bottom = 10000000
drag_margin/h_enabled = true
drag_margin/v_enabled = true
smoothing/enable = false
smoothing/speed = 5.0
drag_margin/left = 0.2
drag_margin/top = 0.2
drag_margin/right = 0.2
drag_margin/bottom = 0.2

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,49 @@
[gd_scene load_steps=3 format=1]
[ext_resource path="res://tileset.tres" type="TileSet" id=1]
[ext_resource path="res://troll.tscn" type="PackedScene" id=2]
[node name="dungeon" type="Node2D"]
[node name="floor" type="TileMap" parent="."]
mode = 1
tile_set = ExtResource( 1 )
cell/size = Vector2( 128, 64 )
cell/quadrant_size = 16
cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
cell/half_offset = 2
cell/tile_origin = 1
cell/y_sort = false
collision/use_kinematic = false
collision/friction = 1.0
collision/bounce = 0.0
collision/layers = 1
collision/mask = 1
occluder/light_mask = 1
tile_data = IntArray( -851956, 0, -851955, 0, -851954, 0, -786420, 1, -786419, 0, -786418, 0, -720884, 0, -720883, 0, -720882, 0, -655348, 1, -655347, 0, -655346, 0, -589812, 1, -589811, 0, -589810, 0, -524276, 0, -524275, 1, -524274, 0, -458740, 0, -458739, 0, -458738, 0, -393210, 0, -393209, 0, -393208, 0, -393207, 0, -393206, 0, -393205, 0, -393204, 0, -393203, 0, -393202, 0, -327674, 0, -327673, 0, -327672, 1, -327671, 1, -327670, 1, -327669, 1, -327668, 1, -327667, 0, -327666, 0, -262138, 0, -262137, 0, -262136, 0, -262135, 0, -262134, 0, -262133, 0, -262132, 0, -262131, 0, -262130, 0, -196602, 0, -196601, 0, -196600, 0, -196599, 0, -196598, 0, -196597, 0, -196596, 0, -196595, 0, -196594, 0, -131066, 0, -131065, 0, -131064, 0, -131063, 0, -65530, 0, -65529, 0, -65528, 0, -65527, 0, 6, 0, 7, 1, 8, 0, 9, 0, 65542, 0, 65543, 0, 65544, 0, 65545, 0, 131078, 0, 131079, 0, 131080, 0, 131081, 0, 196614, 0, 196615, 0, 196616, 0 )
[node name="walls" type="TileMap" parent="."]
mode = 1
tile_set = ExtResource( 1 )
cell/size = Vector2( 128, 64 )
cell/quadrant_size = 16
cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
cell/half_offset = 2
cell/tile_origin = 1
cell/y_sort = true
collision/use_kinematic = false
collision/friction = 1.0
collision/bounce = 0.0
collision/layers = 1
collision/mask = 1
occluder/light_mask = 1
tile_data = IntArray( -917493, 2, -917492, 2, -917491, 2, -917490, 2, -917489, 2, -851957, 2, -851956, 3, -851954, 3, -851953, 2, -786421, 2, -786420, 3, -786418, 3, -786417, 2, -720885, 2, -720881, 2, -655349, 2, -655348, 2, -655346, 3, -655345, 2, -589813, 2, -589809, 2, -524277, 2, -524273, 2, -458747, 2, -458746, 2, -458745, 2, -458744, 536870916, -458743, 536870916, -458742, 2, -458741, 2, -458740, 2, -458738, 2, -458737, 2, -393211, 2, -393209, 3, -393205, 3, -393201, 2, -327675, 4, -327665, 2, -262139, 4, -262134, 3, -262133, 3, -262129, 2, -196603, 2, -196601, 3, -196593, 2, -131067, 2, -131066, 3, -131062, 2, -131061, 2, -131060, 2, -131059, 2, -131058, 2, -131057, 2, -65531, 2, -65530, 2, -65527, 2, -65526, 2, 5, 2, 10, 2, 65541, 2, 65543, 3, 65546, 2, 131077, 2, 131082, 2, 196613, 2, 196618, 2, 262149, 2, 262150, 2, 262151, 2, 262152, 2, 262153, 2, 262154, 2 )
[node name="troll" parent="walls" instance=ExtResource( 2 )]
transform/pos = Vector2( 299.38, 326.037 )
collision/margin = 0.001

View File

@ -1,7 +1,7 @@
[application]
name="Isometric Game"
main_scene="res://dungeon.scn"
main_scene="res://dungeon.tscn"
icon="res://icon.png"
[image_loader]

Binary file not shown.

View File

@ -0,0 +1,67 @@
[gd_resource type="TileSet" load_steps=6 format=1]
[ext_resource path="res://isotiles.png" type="Texture" id=1]
[sub_resource type="ConvexPolygonShape2D" id=1]
custom_solver_bias = 0.0
points = Vector2Array( -68, 2, -4, -30, 60, 2, -4, 34 )
[sub_resource type="ConvexPolygonShape2D" id=2]
custom_solver_bias = 0.0
points = Vector2Array( -20, -6, -4, -22, 12, -22, 4, 10, -4, 10 )
[sub_resource type="ConvexPolygonShape2D" id=3]
custom_solver_bias = 0.0
points = Vector2Array( 28, -6, 4, 10, 12, -22 )
[sub_resource type="ConvexPolygonShape2D" id=4]
custom_solver_bias = 0.0
points = Vector2Array( 66.095, -0.62516, -5.90501, 31.3748, -21.905, 23.3748, 50.095, -8.62516 )
[resource]
0/name = "base"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( -4, 6 )
0/region = Rect2( 28, 92, 132, 84 )
0/occluder_offset = Vector2( 66, 42 )
0/navigation_offset = Vector2( 66, 42 )
0/shape_offset = Vector2( 0, 0 )
0/shapes = [ ]
1/name = "base2"
1/texture = ExtResource( 1 )
1/tex_offset = Vector2( -4, 6 )
1/region = Rect2( 220, 92, 132, 84 )
1/occluder_offset = Vector2( 66, 42 )
1/navigation_offset = Vector2( 66, 42 )
1/shape_offset = Vector2( 0, 0 )
1/shapes = [ ]
2/name = "wall"
2/texture = ExtResource( 1 )
2/tex_offset = Vector2( -4, -32 )
2/region = Rect2( 28, 220, 132, 136 )
2/occluder_offset = Vector2( 66, 68 )
2/navigation_offset = Vector2( 66, 68 )
2/shape_offset = Vector2( 66, 68 )
2/shapes = [ SubResource( 1 ) ]
3/name = "column"
3/texture = ExtResource( 1 )
3/tex_offset = Vector2( -2, -32 )
3/region = Rect2( 220, 220, 132, 136 )
3/occluder_offset = Vector2( 66, 68 )
3/navigation_offset = Vector2( 66, 68 )
3/shape_offset = Vector2( 66, 68 )
3/shapes = [ SubResource( 2 ), SubResource( 3 ) ]
4/name = "door1"
4/texture = ExtResource( 1 )
4/tex_offset = Vector2( 16, -22 )
4/region = Rect2( 24, 408, 132, 136 )
4/occluder_offset = Vector2( 66, 68 )
4/navigation_offset = Vector2( 66, 68 )
4/shape_offset = Vector2( 66, 68 )
4/shapes = [ SubResource( 4 ) ]

View File

@ -0,0 +1,130 @@
[gd_scene load_steps=6 format=1]
[ext_resource path="res://isotiles.png" type="Texture" id=1]
[sub_resource type="ConvexPolygonShape2D" id=1]
custom_solver_bias = 0.0
points = Vector2Array( -68, 2, -4, -30, 60, 2, -4, 34 )
[sub_resource type="ConvexPolygonShape2D" id=2]
custom_solver_bias = 0.0
points = Vector2Array( -20, -6, -4, -22, 12, -22, 4, 10, -4, 10 )
[sub_resource type="ConvexPolygonShape2D" id=3]
custom_solver_bias = 0.0
points = Vector2Array( 28, -6, 4, 10, 12, -22 )
[sub_resource type="ConvexPolygonShape2D" id=4]
custom_solver_bias = 0.0
points = Vector2Array( 66.095, -0.62516, -5.90501, 31.3748, -21.905, 23.3748, 50.095, -8.62516 )
[node name="Node2D" type="Node2D"]
[node name="base" type="Sprite" parent="."]
transform/pos = Vector2( 87.5658, 0.113792 )
texture = ExtResource( 1 )
offset = Vector2( -4, 6 )
region = true
region_rect = Rect2( 28, 92, 132, 84 )
[node name="base2" type="Sprite" parent="."]
transform/pos = Vector2( 196, 44 )
texture = ExtResource( 1 )
offset = Vector2( -4, 6 )
region = true
region_rect = Rect2( 220, 92, 132, 84 )
[node name="wall" type="Sprite" parent="."]
transform/pos = Vector2( 356, 70 )
texture = ExtResource( 1 )
offset = Vector2( -4, -32 )
region = true
region_rect = Rect2( 28, 220, 132, 136 )
[node name="StaticBody2D" type="StaticBody2D" parent="wall"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="collision" type="CollisionPolygon2D" parent="wall/StaticBody2D"]
build_mode = 0
polygon = Vector2Array( -68, 2, -4, 34, 60, 2, -4, -30 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="column" type="Sprite" parent="."]
transform/pos = Vector2( 292, 198 )
texture = ExtResource( 1 )
offset = Vector2( -2, -32 )
region = true
region_rect = Rect2( 220, 220, 132, 136 )
[node name="StaticBody" type="StaticBody2D" parent="column"]
input/pickable = false
shapes/0/shape = SubResource( 2 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
shapes/1/shape = SubResource( 3 )
shapes/1/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/1/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="column/StaticBody"]
build_mode = 0
polygon = Vector2Array( -20, -6, -4, 10, 4, 10, 28, -6, 12, -22, -4, -22 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="door1" type="Sprite" parent="."]
transform/pos = Vector2( 85.905, 0.62516 )
texture = ExtResource( 1 )
offset = Vector2( 16, -22 )
region = true
region_rect = Rect2( 24, 408, 132, 136 )
[node name="StaticBody2D" type="StaticBody2D" parent="door1"]
input/pickable = false
shapes/0/shape = SubResource( 4 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="door1/StaticBody2D"]
build_mode = 0
polygon = Vector2Array( -5.90501, 31.3748, 66.095, -0.62516, 50.095, -8.62516, -21.905, 23.3748 )
shape_range = Vector2( -1, -1 )
trigger = false

Binary file not shown.

View File

@ -0,0 +1,53 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://troll.gd" type="Script" id=1]
[ext_resource path="res://troll.png" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 16.0
[node name="troll" type="KinematicBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, -0.342697, -0.980721 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
collision/margin = 0.001
script/script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
transform/pos = Vector2( -3.94334, -36.924 )
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/pos = Vector2( -0.342697, -0.980721 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="Camera2D" type="Camera2D" parent="."]
anchor_mode = 1
rotating = false
current = true
zoom = Vector2( 1, 1 )
limit/left = -10000000
limit/top = -10000000
limit/right = 10000000
limit/bottom = 10000000
drag_margin/h_enabled = true
drag_margin/v_enabled = true
smoothing/enable = false
smoothing/speed = 5.0
drag_margin/left = 0.2
drag_margin/top = 0.2
drag_margin/right = 0.2
drag_margin/bottom = 0.2

View File

@ -0,0 +1,12 @@
[gd_resource type="CanvasItemMaterial" load_steps=2 format=1]
[sub_resource type="CanvasItemShader" id=1]
_code = { "fragment":"//there is no albedo (all shading is normal)\nuniform color col;\nCOLOR=col;\n//sample normal texture\nvec4 ntex = tex(TEXTURE,UV);\n//take the alpha from the normal texture\nCOLOR.a=ntex.a;\n//adjust normalmap from [0..1] to [-1..1]\nntex.rgb = ntex.rgb * vec3(-2,-2,1) - vec3(-1,-1,0);\n//half size of the tile \nvec2 tile_vec=vec2(47,22);\n//rotation to convert the normal to pseudo 3d coordinates\n//this could be optimized\nfloat r = asin(tile_vec.y / tile_vec.x);\nmat3 rot_mat = mat3( vec3(1,0,0), vec3(0,cos(r),-sin(r)), vec3(0,sin(r),cos(r)));\n\n//pass the normal\nNORMAL = rot_mat * ntex.rgb;\n\n\n\n\n", "fragment_ofs":0, "light":"//apply the normal as simple diffuse (same as default code)\nvec3 light_normal = normalize(vec3(LIGHT_VEC,-LIGHT_HEIGHT));\nLIGHT=LIGHT_COLOR*COLOR*max(dot(-light_normal,NORMAL),0.0);\n//substract light position to be always aligned to the bottom of the sprite\n//this makes lighting on it look like a billboard\nLIGHT_VEC.y-=VAR1.y;\n", "light_ofs":0, "vertex":"// pass the local sprite coordinates through a varying\n// the red cross in the sprite is the 0,0\nVAR1.xy=SRC_VERTEX;", "vertex_ofs":0 }
[resource]
shader/shader = SubResource( 1 )
shader/shading_mode = 0
shader_param/col = Color( 1, 0.836638, 0.693806, 1 )

Binary file not shown.

View File

@ -0,0 +1,52 @@
[gd_scene load_steps=5 format=1]
[ext_resource path="res://wall_shader.tres" type="CanvasItemMaterial" id=1]
[ext_resource path="res://faceColor.png" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 20.0
[sub_resource type="OccluderPolygon2D" id=2]
closed = false
cull_mode = 0
polygon = Vector2Array( -16.1183, 62.9508, 4.32091, 74.9223, 23.3002, 65.2867 )
[node name="column" type="StaticBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 1.36365, 7.83751 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="Sprite" type="Sprite" parent="."]
material/material = ExtResource( 1 )
transform/pos = Vector2( 0.487671, 0.487679 )
texture = ExtResource( 2 )
offset = Vector2( -4.37984, -50.8523 )
region = true
region_rect = Rect2( 569, 179, 48, 154 )
[node name="occluder" type="LightOccluder2D" parent="."]
transform/pos = Vector2( -3.90138, -50.97 )
occluder = SubResource( 2 )
light_mask = 1
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/pos = Vector2( 1.36365, 7.83751 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1

View File

@ -19,7 +19,7 @@ func _input(event):
if (event.type == InputEvent.MOUSE_BUTTON and event.button_index == 1 and event.pressed and shoot_countdown <= 0):
var pos = get_canvas_transform().affine_inverse()*event.pos
var dir = (pos - get_global_pos()).normalized()
var bullet = preload("res://shoot.scn").instance()
var bullet = preload("res://shoot.tscn").instance()
bullet.advance_dir = dir
bullet.set_pos(get_global_pos() + dir*60)
get_parent().add_child(bullet)

Binary file not shown.

View File

@ -0,0 +1,327 @@
[gd_scene load_steps=173 format=1]
[ext_resource path="res://cubio.gd" type="Script" id=1]
[ext_resource path="res://character_shader.tres" type="CanvasItemMaterial" id=2]
[ext_resource path="res://cubio/idle0001.png" type="Texture" id=3]
[ext_resource path="res://cubio/idle0002.png" type="Texture" id=4]
[ext_resource path="res://cubio/idle0003.png" type="Texture" id=5]
[ext_resource path="res://cubio/idle0004.png" type="Texture" id=6]
[ext_resource path="res://cubio/idle0005.png" type="Texture" id=7]
[ext_resource path="res://cubio/idle0006.png" type="Texture" id=8]
[ext_resource path="res://cubio/idle0007.png" type="Texture" id=9]
[ext_resource path="res://cubio/idle0008.png" type="Texture" id=10]
[ext_resource path="res://cubio/idle0009.png" type="Texture" id=11]
[ext_resource path="res://cubio/idle0010.png" type="Texture" id=12]
[ext_resource path="res://cubio/idle0011.png" type="Texture" id=13]
[ext_resource path="res://cubio/idle0012.png" type="Texture" id=14]
[ext_resource path="res://cubio/idle0013.png" type="Texture" id=15]
[ext_resource path="res://cubio/idle0014.png" type="Texture" id=16]
[ext_resource path="res://cubio/idle0015.png" type="Texture" id=17]
[ext_resource path="res://cubio/idle0016.png" type="Texture" id=18]
[ext_resource path="res://cubio/idle0017.png" type="Texture" id=19]
[ext_resource path="res://cubio/idle0018.png" type="Texture" id=20]
[ext_resource path="res://cubio/idle0019.png" type="Texture" id=21]
[ext_resource path="res://cubio/idle0020.png" type="Texture" id=22]
[ext_resource path="res://cubio/idle0021.png" type="Texture" id=23]
[ext_resource path="res://cubio/idle0022.png" type="Texture" id=24]
[ext_resource path="res://cubio/idle0023.png" type="Texture" id=25]
[ext_resource path="res://cubio/idle0024.png" type="Texture" id=26]
[ext_resource path="res://cubio/idle0025.png" type="Texture" id=27]
[ext_resource path="res://cubio/idle0026.png" type="Texture" id=28]
[ext_resource path="res://cubio/idle0027.png" type="Texture" id=29]
[ext_resource path="res://cubio/idle0028.png" type="Texture" id=30]
[ext_resource path="res://cubio/idle0029.png" type="Texture" id=31]
[ext_resource path="res://cubio/idle0030.png" type="Texture" id=32]
[ext_resource path="res://cubio/idle0031.png" type="Texture" id=33]
[ext_resource path="res://cubio/idle0032.png" type="Texture" id=34]
[ext_resource path="res://cubio/idle0033.png" type="Texture" id=35]
[ext_resource path="res://cubio/idle0034.png" type="Texture" id=36]
[ext_resource path="res://cubio/idle0035.png" type="Texture" id=37]
[ext_resource path="res://cubio/idle0036.png" type="Texture" id=38]
[ext_resource path="res://cubio/idle0037.png" type="Texture" id=39]
[ext_resource path="res://cubio/idle0038.png" type="Texture" id=40]
[ext_resource path="res://cubio/idle0039.png" type="Texture" id=41]
[ext_resource path="res://cubio/idle0040.png" type="Texture" id=42]
[ext_resource path="res://cubio/idle0041.png" type="Texture" id=43]
[ext_resource path="res://cubio/idle0042.png" type="Texture" id=44]
[ext_resource path="res://cubio/idle0043.png" type="Texture" id=45]
[ext_resource path="res://cubio/idle0044.png" type="Texture" id=46]
[ext_resource path="res://cubio/idle0045.png" type="Texture" id=47]
[ext_resource path="res://cubio/idle0046.png" type="Texture" id=48]
[ext_resource path="res://cubio/idle0047.png" type="Texture" id=49]
[ext_resource path="res://cubio/idle0048.png" type="Texture" id=50]
[ext_resource path="res://cubio/idle0049.png" type="Texture" id=51]
[ext_resource path="res://cubio/idle0050.png" type="Texture" id=52]
[ext_resource path="res://cubio/idle0051.png" type="Texture" id=53]
[ext_resource path="res://cubio/idle0052.png" type="Texture" id=54]
[ext_resource path="res://cubio/idle0053.png" type="Texture" id=55]
[ext_resource path="res://cubio/idle0054.png" type="Texture" id=56]
[ext_resource path="res://cubio/idle0055.png" type="Texture" id=57]
[ext_resource path="res://cubio/idle0056.png" type="Texture" id=58]
[ext_resource path="res://cubio/idle0057.png" type="Texture" id=59]
[ext_resource path="res://cubio/idle0058.png" type="Texture" id=60]
[ext_resource path="res://cubio/idle0059.png" type="Texture" id=61]
[ext_resource path="res://cubio/idle0060.png" type="Texture" id=62]
[ext_resource path="res://cubio/norm-b-0001.png" type="Texture" id=63]
[ext_resource path="res://cubio/norm-b-0002.png" type="Texture" id=64]
[ext_resource path="res://cubio/norm-b-0003.png" type="Texture" id=65]
[ext_resource path="res://cubio/norm-b-0004.png" type="Texture" id=66]
[ext_resource path="res://cubio/norm-b-0005.png" type="Texture" id=67]
[ext_resource path="res://cubio/norm-b-0006.png" type="Texture" id=68]
[ext_resource path="res://cubio/norm-b-0007.png" type="Texture" id=69]
[ext_resource path="res://cubio/norm-b-0008.png" type="Texture" id=70]
[ext_resource path="res://cubio/norm-b-0009.png" type="Texture" id=71]
[ext_resource path="res://cubio/norm-b-0010.png" type="Texture" id=72]
[ext_resource path="res://cubio/norm-b-0011.png" type="Texture" id=73]
[ext_resource path="res://cubio/norm-b-0012.png" type="Texture" id=74]
[ext_resource path="res://cubio/norm-b-0013.png" type="Texture" id=75]
[ext_resource path="res://cubio/norm-b-0014.png" type="Texture" id=76]
[ext_resource path="res://cubio/norm-b-0015.png" type="Texture" id=77]
[ext_resource path="res://cubio/norm-b-0016.png" type="Texture" id=78]
[ext_resource path="res://cubio/norm-b-0017.png" type="Texture" id=79]
[ext_resource path="res://cubio/norm-b-0018.png" type="Texture" id=80]
[ext_resource path="res://cubio/norm-b-0019.png" type="Texture" id=81]
[ext_resource path="res://cubio/norm-b-0020.png" type="Texture" id=82]
[ext_resource path="res://cubio/norm-bl-0001.png" type="Texture" id=83]
[ext_resource path="res://cubio/norm-bl-0002.png" type="Texture" id=84]
[ext_resource path="res://cubio/norm-bl-0003.png" type="Texture" id=85]
[ext_resource path="res://cubio/norm-bl-0004.png" type="Texture" id=86]
[ext_resource path="res://cubio/norm-bl-0005.png" type="Texture" id=87]
[ext_resource path="res://cubio/norm-bl-0006.png" type="Texture" id=88]
[ext_resource path="res://cubio/norm-bl-0007.png" type="Texture" id=89]
[ext_resource path="res://cubio/norm-bl-0008.png" type="Texture" id=90]
[ext_resource path="res://cubio/norm-bl-0009.png" type="Texture" id=91]
[ext_resource path="res://cubio/norm-bl-0010.png" type="Texture" id=92]
[ext_resource path="res://cubio/norm-bl-0011.png" type="Texture" id=93]
[ext_resource path="res://cubio/norm-bl-0012.png" type="Texture" id=94]
[ext_resource path="res://cubio/norm-bl-0013.png" type="Texture" id=95]
[ext_resource path="res://cubio/norm-bl-0014.png" type="Texture" id=96]
[ext_resource path="res://cubio/norm-bl-0015.png" type="Texture" id=97]
[ext_resource path="res://cubio/norm-bl-0016.png" type="Texture" id=98]
[ext_resource path="res://cubio/norm-bl-0017.png" type="Texture" id=99]
[ext_resource path="res://cubio/norm-bl-0018.png" type="Texture" id=100]
[ext_resource path="res://cubio/norm-bl-0019.png" type="Texture" id=101]
[ext_resource path="res://cubio/norm-bl-0020.png" type="Texture" id=102]
[ext_resource path="res://cubio/norm-l-0001.png" type="Texture" id=103]
[ext_resource path="res://cubio/norm-l-0002.png" type="Texture" id=104]
[ext_resource path="res://cubio/norm-l-0003.png" type="Texture" id=105]
[ext_resource path="res://cubio/norm-l-0004.png" type="Texture" id=106]
[ext_resource path="res://cubio/norm-l-0005.png" type="Texture" id=107]
[ext_resource path="res://cubio/norm-l-0006.png" type="Texture" id=108]
[ext_resource path="res://cubio/norm-l-0007.png" type="Texture" id=109]
[ext_resource path="res://cubio/norm-l-0008.png" type="Texture" id=110]
[ext_resource path="res://cubio/norm-l-0009.png" type="Texture" id=111]
[ext_resource path="res://cubio/norm-l-0010.png" type="Texture" id=112]
[ext_resource path="res://cubio/norm-l-0011.png" type="Texture" id=113]
[ext_resource path="res://cubio/norm-l-0012.png" type="Texture" id=114]
[ext_resource path="res://cubio/norm-l-0013.png" type="Texture" id=115]
[ext_resource path="res://cubio/norm-l-0014.png" type="Texture" id=116]
[ext_resource path="res://cubio/norm-l-0015.png" type="Texture" id=117]
[ext_resource path="res://cubio/norm-l-0016.png" type="Texture" id=118]
[ext_resource path="res://cubio/norm-l-0017.png" type="Texture" id=119]
[ext_resource path="res://cubio/norm-l-0018.png" type="Texture" id=120]
[ext_resource path="res://cubio/norm-l-0019.png" type="Texture" id=121]
[ext_resource path="res://cubio/norm-l-0020.png" type="Texture" id=122]
[ext_resource path="res://cubio/norm-u-0001.png" type="Texture" id=123]
[ext_resource path="res://cubio/norm-u-0002.png" type="Texture" id=124]
[ext_resource path="res://cubio/norm-u-0003.png" type="Texture" id=125]
[ext_resource path="res://cubio/norm-u-0004.png" type="Texture" id=126]
[ext_resource path="res://cubio/norm-u-0005.png" type="Texture" id=127]
[ext_resource path="res://cubio/norm-u-0006.png" type="Texture" id=128]
[ext_resource path="res://cubio/norm-u-0007.png" type="Texture" id=129]
[ext_resource path="res://cubio/norm-u-0008.png" type="Texture" id=130]
[ext_resource path="res://cubio/norm-u-0009.png" type="Texture" id=131]
[ext_resource path="res://cubio/norm-u-0010.png" type="Texture" id=132]
[ext_resource path="res://cubio/norm-u-0011.png" type="Texture" id=133]
[ext_resource path="res://cubio/norm-u-0012.png" type="Texture" id=134]
[ext_resource path="res://cubio/norm-u-0013.png" type="Texture" id=135]
[ext_resource path="res://cubio/norm-u-0014.png" type="Texture" id=136]
[ext_resource path="res://cubio/norm-u-0015.png" type="Texture" id=137]
[ext_resource path="res://cubio/norm-u-0016.png" type="Texture" id=138]
[ext_resource path="res://cubio/norm-u-0017.png" type="Texture" id=139]
[ext_resource path="res://cubio/norm-u-0018.png" type="Texture" id=140]
[ext_resource path="res://cubio/norm-u-0019.png" type="Texture" id=141]
[ext_resource path="res://cubio/norm-u-0020.png" type="Texture" id=142]
[ext_resource path="res://cubio/norm-ul-0001.png" type="Texture" id=143]
[ext_resource path="res://cubio/norm-ul-0002.png" type="Texture" id=144]
[ext_resource path="res://cubio/norm-ul-0003.png" type="Texture" id=145]
[ext_resource path="res://cubio/norm-ul-0004.png" type="Texture" id=146]
[ext_resource path="res://cubio/norm-ul-0005.png" type="Texture" id=147]
[ext_resource path="res://cubio/norm-ul-0006.png" type="Texture" id=148]
[ext_resource path="res://cubio/norm-ul-0007.png" type="Texture" id=149]
[ext_resource path="res://cubio/norm-ul-0008.png" type="Texture" id=150]
[ext_resource path="res://cubio/norm-ul-0009.png" type="Texture" id=151]
[ext_resource path="res://cubio/norm-ul-0010.png" type="Texture" id=152]
[ext_resource path="res://cubio/norm-ul-0011.png" type="Texture" id=153]
[ext_resource path="res://cubio/norm-ul-0012.png" type="Texture" id=154]
[ext_resource path="res://cubio/norm-ul-0013.png" type="Texture" id=155]
[ext_resource path="res://cubio/norm-ul-0014.png" type="Texture" id=156]
[ext_resource path="res://cubio/norm-ul-0015.png" type="Texture" id=157]
[ext_resource path="res://cubio/norm-ul-0016.png" type="Texture" id=158]
[ext_resource path="res://cubio/norm-ul-0017.png" type="Texture" id=159]
[ext_resource path="res://cubio/norm-ul-0018.png" type="Texture" id=160]
[ext_resource path="res://cubio/norm-ul-0019.png" type="Texture" id=161]
[ext_resource path="res://cubio/norm-ul-0020.png" type="Texture" id=162]
[ext_resource path="res://light2.png" type="Texture" id=163]
[ext_resource path="res://shadow_blob.png" type="Texture" id=164]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 20.0
[sub_resource type="SpriteFrames" id=2]
frames = [ ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 10 ), ExtResource( 11 ), ExtResource( 12 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 18 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 21 ), ExtResource( 22 ), ExtResource( 23 ), ExtResource( 24 ), ExtResource( 25 ), ExtResource( 26 ), ExtResource( 27 ), ExtResource( 28 ), ExtResource( 29 ), ExtResource( 30 ), ExtResource( 31 ), ExtResource( 32 ), ExtResource( 33 ), ExtResource( 34 ), ExtResource( 35 ), ExtResource( 36 ), ExtResource( 37 ), ExtResource( 38 ), ExtResource( 39 ), ExtResource( 40 ), ExtResource( 41 ), ExtResource( 42 ), ExtResource( 43 ), ExtResource( 44 ), ExtResource( 45 ), ExtResource( 46 ), ExtResource( 47 ), ExtResource( 48 ), ExtResource( 49 ), ExtResource( 50 ), ExtResource( 51 ), ExtResource( 52 ), ExtResource( 53 ), ExtResource( 54 ), ExtResource( 55 ), ExtResource( 56 ), ExtResource( 57 ), ExtResource( 58 ), ExtResource( 59 ), ExtResource( 60 ), ExtResource( 61 ), ExtResource( 62 ), ExtResource( 63 ), ExtResource( 64 ), ExtResource( 65 ), ExtResource( 66 ), ExtResource( 67 ), ExtResource( 68 ), ExtResource( 69 ), ExtResource( 70 ), ExtResource( 71 ), ExtResource( 72 ), ExtResource( 73 ), ExtResource( 74 ), ExtResource( 75 ), ExtResource( 76 ), ExtResource( 77 ), ExtResource( 78 ), ExtResource( 79 ), ExtResource( 80 ), ExtResource( 81 ), ExtResource( 82 ), ExtResource( 83 ), ExtResource( 84 ), ExtResource( 85 ), ExtResource( 86 ), ExtResource( 87 ), ExtResource( 88 ), ExtResource( 89 ), ExtResource( 90 ), ExtResource( 91 ), ExtResource( 92 ), ExtResource( 93 ), ExtResource( 94 ), ExtResource( 95 ), ExtResource( 96 ), ExtResource( 97 ), ExtResource( 98 ), ExtResource( 99 ), ExtResource( 100 ), ExtResource( 101 ), ExtResource( 102 ), ExtResource( 103 ), ExtResource( 104 ), ExtResource( 105 ), ExtResource( 106 ), ExtResource( 107 ), ExtResource( 108 ), ExtResource( 109 ), ExtResource( 110 ), ExtResource( 111 ), ExtResource( 112 ), ExtResource( 113 ), ExtResource( 114 ), ExtResource( 115 ), ExtResource( 116 ), ExtResource( 117 ), ExtResource( 118 ), ExtResource( 119 ), ExtResource( 120 ), ExtResource( 121 ), ExtResource( 122 ), ExtResource( 123 ), ExtResource( 124 ), ExtResource( 125 ), ExtResource( 126 ), ExtResource( 127 ), ExtResource( 128 ), ExtResource( 129 ), ExtResource( 130 ), ExtResource( 131 ), ExtResource( 132 ), ExtResource( 133 ), ExtResource( 134 ), ExtResource( 135 ), ExtResource( 136 ), ExtResource( 137 ), ExtResource( 138 ), ExtResource( 139 ), ExtResource( 140 ), ExtResource( 141 ), ExtResource( 142 ), ExtResource( 143 ), ExtResource( 144 ), ExtResource( 145 ), ExtResource( 146 ), ExtResource( 147 ), ExtResource( 148 ), ExtResource( 149 ), ExtResource( 150 ), ExtResource( 151 ), ExtResource( 152 ), ExtResource( 153 ), ExtResource( 154 ), ExtResource( 155 ), ExtResource( 156 ), ExtResource( 157 ), ExtResource( 158 ), ExtResource( 159 ), ExtResource( 160 ), ExtResource( 161 ), ExtResource( 162 ) ]
[sub_resource type="Animation" id=3]
resource/name = "bottom"
length = 0.95
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("frames:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), "values":[ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 ] }
[sub_resource type="Animation" id=4]
length = 0.95
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("frames:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), "values":[ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 ] }
[sub_resource type="Animation" id=5]
length = 3.0
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("frames:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35, 1.4, 1.45, 1.5, 1.55, 1.6, 1.65, 1.7, 1.75, 1.8, 1.85, 1.9, 1.95, 2, 2.05, 2.1, 2.15, 2.2, 2.25, 2.3, 2.35, 2.4, 2.45, 2.5, 2.55, 2.6, 2.65, 2.7, 2.75, 2.8, 2.85, 2.9, 2.95, 3 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), "values":[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59 ] }
[sub_resource type="Animation" id=6]
length = 0.95
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("frames:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), "values":[ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 ] }
[sub_resource type="Animation" id=7]
length = 0.95
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("frames:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), "values":[ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139 ] }
[sub_resource type="Animation" id=8]
length = 0.95
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("frames:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), "values":[ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159 ] }
[node name="cubio" type="KinematicBody2D"]
visibility/light_mask = 2
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, -0.397217, -9.30363 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
collision/margin = 0.08
script/script = ExtResource( 1 )
[node name="frames" type="AnimatedSprite" parent="."]
material/material = ExtResource( 2 )
frames = SubResource( 2 )
frame = 140
offset = Vector2( 0.397217, -52.4323 )
[node name="shape" type="CollisionShape2D" parent="."]
transform/pos = Vector2( -0.397217, -9.30363 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="camera" type="Camera2D" parent="."]
anchor_mode = 1
rotating = false
current = true
zoom = Vector2( 1, 1 )
limit/left = -10000000
limit/top = -10000000
limit/right = 10000000
limit/bottom = 10000000
drag_margin/h_enabled = true
drag_margin/v_enabled = true
smoothing/enable = false
smoothing/speed = 5.0
drag_margin/left = 0.2
drag_margin/top = 0.2
drag_margin/right = 0.2
drag_margin/bottom = 0.2
[node name="anim" type="AnimationPlayer" parent="."]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/bottom = SubResource( 3 )
anims/bottom_left = SubResource( 4 )
anims/idle = SubResource( 5 )
anims/left = SubResource( 6 )
anims/top = SubResource( 7 )
anims/top_left = SubResource( 8 )
playback/active = true
playback/speed = 1.0
blend_times = [ ]
autoplay = "idle"
[node name="Light2D" type="Light2D" parent="."]
transform/pos = Vector2( -0.140442, 2.64355 )
enabled = true
texture = ExtResource( 163 )
offset = Vector2( 0, 0 )
scale = 8.0
color = Color( 1, 1, 1, 1 )
energy = 1.0
mode = 0
range/height = 100.0
range/z_min = -1024
range/z_max = 1024
range/layer_min = 0
range/layer_max = 0
range/item_mask = 3
shadow/enabled = true
shadow/color = Color( 0, 0, 0, 0 )
shadow/buffer_size = 2048
shadow/esm_multiplier = 80.0
shadow/item_mask = 1
[node name="Sprite" type="Sprite" parent="."]
visibility/opacity = 0.3
texture = ExtResource( 164 )
offset = Vector2( 0, -5.72164 )

View File

@ -1,7 +1,7 @@
[application]
name="Isometric 2D + Lighting"
main_scene="res://map.scn"
main_scene="res://map.tscn"
icon="res://icon.png"
[input]

View File

@ -0,0 +1,14 @@
[gd_resource type="CanvasItemMaterial" load_steps=3 format=1]
[ext_resource path="res://faceNormal.png" type="Texture" id=1]
[sub_resource type="CanvasItemShader" id=1]
_code = { "fragment":"// just pass the normal\n\nuniform texture normal;\nvec2 ywnormal=tex( normal,UV).wy * vec2(2.0,2.0) - vec2(1.0,1.0);\nNORMAL=vec3(ywnormal,sqrt(1 - (ywnormal.x * ywnormal.x) - (ywnormal.y * ywnormal.y) ));\n\n", "fragment_ofs":0, "light":"//the tile half size in pixels\nvec2 tile_vec=vec2(140,70);\nfloat z_scale = 1.0;\n//compute a 3D postion fot thelight\nvec3 light_3d = vec3(-LIGHT_VEC.x,LIGHT_HEIGHT,LIGHT_VEC.y);\n\n//rotate the normal map to the same coordinates as the pseudo 3d ponit\n//this could be optimized\nfloat r = asin(tile_vec.y/tile_vec.x);\nmat3 rot_mat = mat3( vec3(1,0,0), vec3(0,cos(r),-sin(r)), vec3(0,sin(r),cos(r)));\nvec3 n = rot_mat * NORMAL;\nn.y=-n.y;\n\n//compute diffuse light\nfloat dp = max(dot(normalize(n),-normalize(light_3d)),0);\nLIGHT=vec4(vec3(dp),1.0)*COLOR*LIGHT_COLOR;\n", "light_ofs":0, "vertex":"//pass the x1 in local sprite coordinates.\n//the sprite center (small red cross) is 0,0\nVAR1.xy=SRC_VERTEX;", "vertex_ofs":0 }
[resource]
shader/shader = SubResource( 1 )
shader/shading_mode = 0
shader_param/normal = ExtResource( 1 )

Binary file not shown.

View File

@ -0,0 +1,261 @@
[gd_scene load_steps=10 format=1]
[ext_resource path="res://map.gd" type="Script" id=1]
[ext_resource path="res://tileset.tres" type="TileSet" id=2]
[ext_resource path="res://cubio.tscn" type="PackedScene" id=3]
[ext_resource path="res://torch.tscn" type="PackedScene" id=4]
[ext_resource path="res://column.tscn" type="PackedScene" id=5]
[ext_resource path="res://cubio/idle0001.png" type="Texture" id=6]
[ext_resource path="res://light2.png" type="Texture" id=7]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 100.0
[sub_resource type="CanvasItemMaterial" id=2]
shader/shading_mode = 1
[node name="node" type="Node2D"]
transform/pos = Vector2( -0.735077, -20.5826 )
script/script = ExtResource( 1 )
[node name="floor_map" type="TileMap" parent="."]
mode = 1
tile_set = ExtResource( 2 )
cell/size = Vector2( 192, 88 )
cell/quadrant_size = 16
cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
cell/half_offset = 2
cell/tile_origin = 1
cell/y_sort = true
collision/use_kinematic = false
collision/friction = 1.0
collision/bounce = 0.0
collision/layers = 1
collision/mask = 1
occluder/light_mask = 1
tile_data = IntArray( -1900531, 0, -1900530, 1, -1900529, 0, -1900528, 0, -1900527, 0, -1834995, 0, -1834994, 0, -1834993, 0, -1834992, 1, -1834991, 0, -1769459, 0, -1769458, 0, -1769457, 0, -1769456, 1, -1769455, 0, -1703923, 0, -1703922, 0, -1703921, 0, -1703920, 0, -1703919, 1, -1638387, 0, -1638386, 0, -1638385, 0, -1638384, 0, -1638383, 0, -1572855, 0, -1572854, 0, -1572853, 0, -1572852, 0, -1572851, 0, -1572850, 0, -1572849, 1, -1572848, 0, -1572847, 0, -1507319, 0, -1507318, 0, -1507317, 0, -1507316, 0, -1507315, 1, -1507314, 1, -1507313, 1, -1507312, 0, -1507311, 0, -1441783, 0, -1441782, 0, -1441781, 0, -1441780, 0, -1441779, 0, -1441778, 0, -1441777, 0, -1441776, 0, -1441775, 0, -1376247, 0, -1376246, 0, -1376245, 0, -1376244, 0, -1310711, 1, -1310710, 0, -1310709, 0, -1310708, 0, -1245175, 0, -1245174, 0, -1245173, 0, -1245172, 0, -1179639, 0, -1179638, 0, -1179637, 1, -1179636, 0, -1114103, 0, -1114102, 0, -1114101, 0, -1114100, 0, -1048567, 0, -1048566, 0, -1048565, 0, -1048564, 0, -983031, 0, -983030, 0, -983029, 0, -983028, 0, -917495, 0, -917494, 1, -917493, 1, -917492, 0, -851959, 0, -851958, 0, -851957, 0, -851956, 0, -786423, 0, -786422, 0, -786421, 0, -786420, 0, -720894, 0, -720893, 0, -720892, 0, -720891, 0, -720890, 0, -720889, 0, -720888, 0, -720887, 0, -720886, 0, -720885, 0, -720884, 0, -720883, 0, -720882, 0, -720881, 0, -655358, 0, -655357, 0, -655356, 0, -655355, 0, -655354, 0, -655353, 0, -655352, 0, -655351, 0, -655350, 0, -655349, 0, -655348, 0, -655347, 0, -655346, 0, -655345, 0, -589822, 0, -589821, 0, -589820, 0, -589819, 0, -589818, 0, -589817, 0, -589816, 0, -589815, 0, -589814, 0, -589813, 0, -589812, 0, -589811, 0, -589810, 0, -589809, 0, -524286, 0, -524285, 0, -524284, 1, -524283, 0, -524282, 0, -524281, 0, -524280, 0, -524279, 1, -524278, 1, -524277, 1, -524276, 1, -524275, 0, -524274, 0, -524273, 0, -458750, 0, -458749, 0, -458748, 1, -458747, 0, -458746, 0, -458745, 0, -458744, 0, -458743, 0, -458742, 0, -458741, 0, -458740, 0, -458739, 0, -458738, 1, -458737, 0, -393214, 0, -393213, 0, -393212, 0, -393211, 0, -393210, 0, -393209, 0, -393208, 0, -393207, 0, -393206, 0, -393205, 0, -393204, 0, -393203, 0, -393202, 0, -393201, 0, -262149, 0, -262148, 0, -262147, 0, -262146, 0, -262145, 0, -327680, 0, -327679, 0, -327678, 0, -327677, 0, -327676, 0, -327675, 0, -196613, 0, -196612, 0, -196611, 0, -196610, 0, -196609, 0, -262144, 0, -262143, 0, -262142, 0, -262141, 0, -262140, 0, -262139, 0, -131077, 0, -131076, 0, -131075, 0, -131074, 0, -131073, 0, -196608, 0, -196607, 0, -196606, 0, -196605, 0, -196604, 0, -196603, 0, -65541, 0, -65540, 0, -65539, 0, -65538, 0, -65537, 0, -131072, 0, -131071, 0, -131070, 0, -131069, 1, -131068, 0, -131067, 0, -5, 0, -4, 0, -3, 0, -2, 0, -1, 0, -65536, 0, -65535, 0, -65534, 0, -65533, 0, -65532, 1, -65531, 0, 65531, 0, 65532, 1, 65533, 0, 65534, 0, 65535, 1, 0, 0, 1, 0, 2, 0, 3, 0, 4, 1, 5, 0, 131067, 0, 131068, 1, 131069, 0, 131070, 0, 131071, 0, 65536, 0, 65537, 0, 65538, 0, 65539, 0, 65540, 0, 65541, 0, 196603, 0, 196604, 0, 196605, 0, 196606, 1, 196607, 0, 131072, 0, 131073, 0, 131074, 0, 131075, 0, 131076, 1, 131077, 0, 262139, 0, 262140, 0, 262141, 0, 262142, 0, 262143, 0, 196608, 0, 196609, 0, 196610, 0, 196611, 0, 196612, 0, 196613, 0, 327676, 0, 327677, 0, 327678, 0, 327679, 0, 262144, 0, 262145, 0, 262146, 0, 262147, 0, 262148, 0, 262149, 0 )
[node name="wall_map" type="TileMap" parent="."]
mode = 1
tile_set = ExtResource( 2 )
cell/size = Vector2( 94, 43 )
cell/quadrant_size = 16
cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
cell/half_offset = 2
cell/tile_origin = 1
cell/y_sort = true
collision/use_kinematic = false
collision/friction = 1.0
collision/bounce = 0.0
collision/layers = 1
collision/mask = 1
occluder/light_mask = 1
tile_data = IntArray( -3801060, 5, -3801059, 10, -3801058, 10, -3801057, 10, -3801056, 10, -3801055, 10, -3801054, 10, -3801053, 10, -3801052, 536870916, -3735524, 9, -3735516, 7, -3669988, 9, -3669980, 7, -3604452, 9, -3604444, 7, -3538916, 9, -3538908, 7, -3473380, 9, -3473372, 7, -3407844, 9, -3407836, 7, -3342308, 9, -3342300, 7, -3276772, 9, -3276764, 7, -3211236, 9, -3211228, 7, -3145709, 5, -3145708, 10, -3145707, 10, -3145706, 10, -3145705, 10, -3145704, 10, -3145703, 10, -3145702, 10, -3145701, 10, -3145692, 7, -3080173, 9, -3080156, 7, -3014637, 9, -3014634, 2, -3014620, 7, -2949101, 2, -2949084, 7, -2883565, 9, -2883558, 8, -2883557, 8, -2883556, 8, -2883555, 8, -2883554, 8, -2883553, 8, -2883552, 8, -2883551, 8, -2883550, 8, -2883549, 8, -2883548, 6, -2818029, 9, -2818023, 7, -2752493, 9, -2752487, 7, -2686957, 9, -2686955, 2, -2686951, 7, -2621421, 9, -2621415, 7, -2555885, 9, -2555879, 2, -2490349, 2, -2490343, 7, -2424813, 9, -2424807, 7, -2359277, 9, -2359274, 2, -2359271, 7, -2293741, 9, -2293735, 7, -2228205, 4, -2228199, 7, -2162669, 9, -2162668, 10, -2162667, 536870916, -2162663, 7, -2097133, 8, -2097132, 8, -2097131, 6, -2097127, 7, -2031597, 9, -2031591, 7, -1966061, 9, -1966055, 7, -1900525, 9, -1900519, 7, -1834989, 9, -1834986, 8, -1834985, 8, -1834984, 8, -1834983, 7, -1769453, 9, -1769450, 7, -1769447, 7, -1703917, 9, -1703916, 8, -1703915, 8, -1703914, 8, -1703911, 7, -1638381, 9, -1638375, 7, -1572845, 9, -1572839, 7, -1507309, 9, -1507303, 7, -1441787, 5, -1441786, 10, -1441785, 10, -1441784, 10, -1441783, 10, -1441782, 10, -1441781, 10, -1441780, 10, -1441779, 10, -1441778, 10, -1441777, 10, -1441776, 10, -1441775, 10, -1441774, 10, -1441766, 10, -1441765, 10, -1441764, 10, -1441763, 10, -1441762, 10, -1441761, 536870916, -1376251, 9, -1376225, 7, -1310715, 9, -1310689, 7, -1245179, 9, -1245153, 7, -1179643, 9, -1179617, 7, -1114107, 9, -1114081, 7, -1048571, 9, -1048545, 7, -983035, 9, -983009, 7, -917499, 9, -917473, 7, -851963, 9, -851937, 7, -786427, 9, -786401, 7, -720891, 9, -720884, 8, -720883, 8, -720882, 8, -720881, 8, -720880, 8, -720879, 8, -720878, 8, -720877, 8, -720876, 8, -720875, 8, -720874, 8, -720873, 8, -720872, 8, -720871, 8, -720870, 8, -720869, 8, -720868, 8, -720867, 8, -720866, 8, -720865, 6, -589834, 5, -589833, 10, -589832, 10, -589831, 10, -589830, 10, -589829, 10, -589828, 10, -589827, 10, -589826, 10, -589825, 10, -655360, 10, -655359, 10, -655358, 10, -655357, 10, -655356, 10, -655349, 7, -524298, 9, -589813, 7, -458762, 9, -524277, 7, -393226, 9, -458741, 7, -327690, 9, -393205, 7, -262154, 9, -262150, 5, -262149, 10, -262148, 10, -262147, 10, -262146, 10, -262145, 10, -327680, 10, -327679, 10, -327678, 10, -327677, 10, -327676, 3, -327669, 7, -196618, 9, -196614, 9, -262140, 7, -262133, 7, -131082, 9, -131078, 9, -196604, 7, -196597, 7, -65546, 9, -65542, 9, -131068, 7, -131061, 7, -10, 9, -6, 4, -5, 8, -4, 8, -3, 8, -2, 8, -65535, 8, -65534, 8, -65533, 8, -65532, 6, -65525, 7, 65526, 9, 11, 7, 131062, 9, 65547, 7, 196598, 9, 131083, 7, 262134, 9, 196619, 7, 327670, 9, 262155, 7, 393206, 9, 327691, 7, 458742, 9, 393227, 7, 524278, 4, 524279, 8, 458763, 7, 589816, 9, 524299, 7, 655352, 4, 655353, 8, 655354, 8, 655355, 8, 655356, 8, 655357, 8, 655358, 8, 655359, 8, 589824, 8, 589825, 8, 589826, 8, 589827, 8, 589828, 8, 589829, 8, 589830, 8, 589831, 8, 589832, 8, 589833, 8, 589834, 8, 589835, 6 )
__meta__ = { "_editor_collapsed":true }
[node name="cubio" parent="wall_map" instance=ExtResource( 3 )]
transform/pos = Vector2( -184.284, 6.7328 )
collision/margin = 0.08
[node name="toch" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( -42.0531, -74.8855 )
[node name="toch1" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 96.0294, -19.8329 )
[node name="toch2" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 954.802, -147.456 )
[node name="toch3" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 1247.08, 42.9454 )
[node name="toch4" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 1257.11, -167.498 )
[node name="toch5" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 1632.9, -73.9674 )
[node name="toch6" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 1566.09, 113.093 )
[node name="toch7" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 1935.2, 64.6577 )
[node name="toch8" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 2000.34, 258.399 )
[node name="toch9" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 3738.07, -328.247 )
[node name="toch10" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 4034.17, -585.483 )
[node name="toch11" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 4261.79, -472.595 )
[node name="toch12" parent="wall_map" instance=ExtResource( 4 )]
transform/pos = Vector2( 4006.41, -479.998 )
[node name="column" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( -122.203, 119.689 )
[node name="column1" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 95.2993, 99.8337 )
[node name="column2" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 138.619, 246.039 )
[node name="column3" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 324.534, 82.6862 )
[node name="column4" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 1046.53, -175.429 )
[node name="column5" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 1347.07, -179.039 )
[node name="column6" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 1184.62, -261.166 )
[node name="column7" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 1520.35, -139.329 )
[node name="column8" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 1409.34, 25.8286 )
[node name="column9" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 1804.63, -13.8814 )
[node name="column10" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 1782.97, 170.229 )
[node name="column11" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 2223.9, 158.537 )
[node name="column12" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 3744.95, -480.43 )
[node name="column13" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 3838.62, -526.042 )
[node name="column14" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 3937.17, -573.283 )
[node name="column15" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 4123.69, -474.728 )
[node name="column16" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 4027.58, -427.487 )
[node name="column17" parent="wall_map" instance=ExtResource( 5 )]
transform/pos = Vector2( 3935.54, -377.802 )
[node name="prince_area" type="Area2D" parent="wall_map"]
transform/pos = Vector2( 4133.07, -561.046 )
input/pickable = true
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, -37.4897 )
shapes/0/trigger = false
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
[node name="prince" type="Sprite" parent="wall_map/prince_area"]
material/material = SubResource( 2 )
texture = ExtResource( 6 )
offset = Vector2( -1.10803, -49.8615 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="wall_map/prince_area"]
transform/pos = Vector2( 0, -37.4897 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="Light2D" type="Light2D" parent="."]
transform/pos = Vector2( -191.788, 32.4743 )
enabled = true
texture = ExtResource( 7 )
offset = Vector2( 0, 0 )
scale = 8.0
color = Color( 1, 1, 1, 1 )
energy = 1.0
mode = 0
range/height = 60.0
range/z_min = -1024
range/z_max = 1024
range/layer_min = 0
range/layer_max = 0
range/item_mask = 1
shadow/enabled = true
shadow/color = Color( 0, 0, 0, 0 )
shadow/buffer_size = 2048
shadow/esm_multiplier = 80.0
shadow/item_mask = 1
[node name="CanvasModulate" type="CanvasModulate" parent="."]
color = Color( 0.361304, 0.36638, 0.384393, 1 )
[node name="message" type="Label" parent="."]
visibility/visible = false
material/material = SubResource( 2 )
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 4067.0
margin/top = -597.0
margin/right = 4200.0
margin/bottom = -571.0
text = "Thank You Cubio!\nYou saved The Prince!"
align = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[connection signal="body_enter" from="wall_map/prince_area" to="." method="_on_prince_area_body_enter"]

Binary file not shown.

View File

@ -0,0 +1,172 @@
[gd_scene load_steps=10 format=1]
[ext_resource path="res://shoot.gd" type="Script" id=1]
[ext_resource path="res://energy.png" type="Texture" id=2]
[ext_resource path="res://shoot_halo.png" type="Texture" id=3]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 10.0
[sub_resource type="CanvasItemMaterial" id=2]
shader/shading_mode = 0
[sub_resource type="Animation" id=3]
length = 1.0
loop = false
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("explosion:config/emitting")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.3 ), "transitions":FloatArray( 1, 1 ), "values":[ true, false ] }
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:visibility/opacity")
tracks/1/interp = 1
tracks/1/keys = { "cont":true, "times":FloatArray( 0, 0.2 ), "transitions":FloatArray( 1, 1 ), "values":[ 1.0, 0.0 ] }
tracks/2/type = "value"
tracks/2/path = NodePath("energy1:config/emitting")
tracks/2/interp = 1
tracks/2/keys = { "cont":false, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ false ] }
tracks/3/type = "value"
tracks/3/path = NodePath("light:color")
tracks/3/interp = 1
tracks/3/keys = { "cont":true, "times":FloatArray( 0, 0.5 ), "transitions":FloatArray( 1, 1 ), "values":[ Color( 1, 3, 2, 1 ), Color( 0, 0, 0, 0 ) ] }
tracks/4/type = "method"
tracks/4/path = NodePath(".")
tracks/4/interp = 1
tracks/4/keys = { "times":FloatArray( 0.9 ), "transitions":FloatArray( 1 ), "values":[ { "args":[ ], "method":"queue_free" } ] }
[sub_resource type="Animation" id=4]
length = 1.0
loop = true
step = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:transform/rot")
tracks/0/interp = 1
tracks/0/keys = { "cont":true, "times":FloatArray( 0, 1 ), "transitions":FloatArray( 1, 1 ), "values":[ 0.0, 360.0 ] }
[sub_resource type="ColorRamp" id=5]
offsets = FloatArray( 0, 1 )
colors = ColorArray( 1, 1, 1, 1, 1, 0.617074, 0.704795, 0.0653235 )
[sub_resource type="ColorRamp" id=6]
offsets = FloatArray( 0, 1 )
colors = ColorArray( 1, 1, 1, 1, 1, 0.617074, 0.704795, 0.0653235 )
[node name="shoot" type="KinematicBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
collision/margin = 0.08
script/script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
material/material = SubResource( 2 )
transform/pos = Vector2( -1.46303, -58.521 )
texture = ExtResource( 2 )
[node name="anim" type="AnimationPlayer" parent="."]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/explode = SubResource( 3 )
anims/spin = SubResource( 4 )
playback/active = true
playback/speed = 1.0
blend_times = [ ]
autoplay = ""
[node name="light" type="Light2D" parent="."]
enabled = true
texture = ExtResource( 3 )
offset = Vector2( 0, 0 )
scale = 1.0
color = Color( 1, 3, 2, 1 )
energy = 1.0
mode = 0
range/height = 80.0
range/z_min = -1024
range/z_max = 1024
range/layer_min = 0
range/layer_max = 0
range/item_mask = 1
shadow/enabled = true
shadow/color = Color( 0, 0, 0, 0 )
shadow/buffer_size = 2048
shadow/esm_multiplier = 80.0
shadow/item_mask = 1
[node name="shape" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="energy1" type="Particles2D" parent="."]
visibility/blend_mode = 1
transform/pos = Vector2( -1.06581, -61.3015 )
config/amount = 32
config/lifetime = 0.6
config/local_space = false
config/texture = ExtResource( 2 )
params/direction = 0.0
params/spread = 180.0
params/linear_velocity = 60.0
params/spin_velocity = 0.0
params/orbit_velocity = 0.0
params/gravity_direction = 0.0
params/gravity_strength = 9.8
params/radial_accel = 0.0
params/tangential_accel = 0.0
params/damping = 0.0
params/initial_angle = 0.0
params/initial_size = 0.8
params/final_size = 0.1
params/hue_variation = 0.0
params/anim_speed_scale = 1.0
params/anim_initial_pos = 0.0
color/color_ramp = SubResource( 5 )
[node name="explosion" type="Particles2D" parent="."]
visibility/blend_mode = 1
transform/pos = Vector2( -1.06581, -61.3015 )
config/amount = 32
config/lifetime = 0.6
config/emitting = false
config/local_space = false
config/explosiveness = 0.1
config/texture = ExtResource( 2 )
params/direction = 0.0
params/spread = 180.0
params/linear_velocity = 200.0
params/spin_velocity = 0.0
params/orbit_velocity = 0.0
params/gravity_direction = 0.0
params/gravity_strength = 200.0
params/radial_accel = 0.0
params/tangential_accel = 0.0
params/damping = 0.0
params/initial_angle = 0.0
params/initial_size = 0.8
params/final_size = 0.1
params/hue_variation = 0.0
params/anim_speed_scale = 1.0
params/anim_initial_pos = 0.0
color/color_ramp = SubResource( 6 )

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More