summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-09-17 10:01:33 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-09-17 10:01:33 -0300
commit023dcd50f90071c1aff07d890904597704be781d (patch)
treeb592b9bdc357d5ac14c868631991fc8487a583f7
parent2f79107b9a9feeee39e51b91eaec5477cd388a92 (diff)
parent95383469d318e15e9c28a3507194584a3f79276b (diff)
Merge pull request #593 from marynate/PR-gizmo-opacity
Add editor setting: Manipulator Gizmo Opacity
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index a097d7c211..78df6ffa0c 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -2849,11 +2849,13 @@ void SpatialEditor::_init_indicators() {
//move gizmo
+ float gizmo_alph = EditorSettings::get_singleton()->get("3d_editor/manipulator_gizmo_opacity");
+
gizmo_hl = Ref<FixedMaterial>( memnew( FixedMaterial ) );
gizmo_hl->set_flag(Material::FLAG_UNSHADED, true);
gizmo_hl->set_flag(Material::FLAG_ONTOP, true);
gizmo_hl->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
- gizmo_hl->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.4));
+ gizmo_hl->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,gizmo_alph+0.2f));
for(int i=0;i<3;i++) {
@@ -2867,7 +2869,7 @@ void SpatialEditor::_init_indicators() {
mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true);
Color col;
col[i]=1.0;
- col.a=0.2;
+ col.a= gizmo_alph;
mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,col);
gizmo_color[i]=mat;
@@ -3556,6 +3558,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
EDITOR_DEF("3d_editor/manipulator_gizmo_size",80);
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT,"3d_editor/manipulator_gizmo_size",PROPERTY_HINT_RANGE,"16,1024,1"));
+ EDITOR_DEF("3d_editor/manipulator_gizmo_opacity",0.2);
over_gizmo_handle=-1;
}