summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-03-16 00:47:37 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-03-16 01:14:59 -0300
commit53e1694e1e2b76026d862e84c1de88f62601cbc3 (patch)
tree545ef1e271b6df173d0626db887c87c4f6bdf4ba /scene
parent5b54361daf933e33d4b1545f14e2cebbd04d93ff (diff)
New option to send canvas to render buffer
allows to use 3D environment effects for post processing such as Glow, Bloom, HDR, etc. in 2D.
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp4
-rw-r--r--scene/resources/environment.cpp7
-rw-r--r--scene/resources/environment.h6
3 files changed, 9 insertions, 8 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 8855627bb4..e0bf4587bc 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1345,7 +1345,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
return;
}
- if (k.scancode==KEY_HOME) {
+ if (k.scancode==KEY_HOME && completion_index>0) {
completion_index=0;
completion_current=completion_options[completion_index];
@@ -1354,7 +1354,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
return;
}
- if (k.scancode==KEY_END) {
+ if (k.scancode==KEY_END && completion_index<completion_options.size()-1) {
completion_index=completion_options.size()-1;
completion_current=completion_options[completion_index];
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index 3c4bc3ac75..1e3b9772ee 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -108,13 +108,14 @@ void Environment::_bind_methods() {
ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"fxaa/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_FXAA);
- ADD_PROPERTY( PropertyInfo(Variant::INT,"background/mode",PROPERTY_HINT_ENUM,"Keep,Default Color,Color,Texture,Cubemap,Texture RGBE,Cubemap RGBE"),_SCS("set_background"),_SCS("get_background"));
+ ADD_PROPERTY( PropertyInfo(Variant::INT,"background/mode",PROPERTY_HINT_ENUM,"Keep,Default Color,Color,Texture,Cubemap,Canvas"),_SCS("set_background"),_SCS("get_background"));
ADD_PROPERTYI( PropertyInfo(Variant::COLOR,"background/color"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_COLOR);
ADD_PROPERTYI( PropertyInfo(Variant::OBJECT,"background/texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_TEXTURE);
ADD_PROPERTYI( PropertyInfo(Variant::OBJECT,"background/cubemap",PROPERTY_HINT_RESOURCE_TYPE,"CubeMap"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_CUBEMAP);
ADD_PROPERTYI( PropertyInfo(Variant::REAL,"background/energy",PROPERTY_HINT_RANGE,"0,128,0.01"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_ENERGY);
ADD_PROPERTYI( PropertyInfo(Variant::REAL,"background/scale",PROPERTY_HINT_RANGE,"0.001,16,0.001"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_SCALE);
ADD_PROPERTYI( PropertyInfo(Variant::REAL,"background/glow",PROPERTY_HINT_RANGE,"0.00,8,0.01"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_GLOW);
+ ADD_PROPERTYI( PropertyInfo(Variant::INT,"background/canvas_max_layer"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_CANVAS_MAX_LAYER);
ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"glow/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_GLOW);
ADD_PROPERTYI( PropertyInfo(Variant::INT,"glow/blur_passes",PROPERTY_HINT_RANGE,"1,4,1"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLUR_PASSES);
@@ -182,10 +183,10 @@ void Environment::_bind_methods() {
BIND_CONSTANT( BG_COLOR );
BIND_CONSTANT( BG_TEXTURE );
BIND_CONSTANT( BG_CUBEMAP );
- BIND_CONSTANT( BG_TEXTURE_RGBE );
- BIND_CONSTANT( BG_CUBEMAP_RGBE );
+ BIND_CONSTANT( BG_CANVAS );
BIND_CONSTANT( BG_MAX );
+ BIND_CONSTANT( BG_PARAM_CANVAS_MAX_LAYER );
BIND_CONSTANT( BG_PARAM_COLOR );
BIND_CONSTANT( BG_PARAM_TEXTURE );
BIND_CONSTANT( BG_PARAM_CUBEMAP );
diff --git a/scene/resources/environment.h b/scene/resources/environment.h
index a9e2f422b9..d672a898d5 100644
--- a/scene/resources/environment.h
+++ b/scene/resources/environment.h
@@ -44,14 +44,14 @@ public:
BG_COLOR=VS::ENV_BG_COLOR,
BG_TEXTURE=VS::ENV_BG_TEXTURE,
BG_CUBEMAP=VS::ENV_BG_CUBEMAP,
- BG_TEXTURE_RGBE=VS::ENV_BG_TEXTURE_RGBE,
- BG_CUBEMAP_RGBE=VS::ENV_BG_CUBEMAP_RGBE,
+ BG_CANVAS=VS::ENV_BG_CANVAS,
BG_MAX=VS::ENV_BG_MAX
};
enum BGParam {
- BG_PARAM_COLOR=VS::ENV_BG_PARAM_COLOR,
+ BG_PARAM_CANVAS_MAX_LAYER=VS::ENV_BG_PARAM_CANVAS_MAX_LAYER,
+ BG_PARAM_COLOR=VS::ENV_BG_PARAM_COLOR,
BG_PARAM_TEXTURE=VS::ENV_BG_PARAM_TEXTURE,
BG_PARAM_CUBEMAP=VS::ENV_BG_PARAM_CUBEMAP,
BG_PARAM_ENERGY=VS::ENV_BG_PARAM_ENERGY,