Browse Source

Merge pull request #1282 from skyace65/CSharp_GUIskinning

Add C# to GUI Skinning page
Max Hilbrunner 7 years ago
parent
commit
0efaf81d1d
1 changed files with 17 additions and 2 deletions
  1. 17 2
      tutorials/gui/gui_skinning.rst

+ 17 - 2
tutorials/gui/gui_skinning.rst

@@ -67,7 +67,8 @@ Every option is associated to:
 
 
 An example usage:
 An example usage:
 
 
-::
+.. tabs::
+ .. code-tab:: gdscript GDScript
 
 
     var t = Theme.new()
     var t = Theme.new()
     t.set_color("font_color", "Label", Color(1.0, 1.0, 1.0))
     t.set_color("font_color", "Label", Color(1.0, 1.0, 1.0))
@@ -75,6 +76,14 @@ An example usage:
     var l = Label.new()
     var l = Label.new()
     l.set_theme(t)
     l.set_theme(t)
 
 
+ .. code-tab:: csharp
+
+    var t = new Theme();
+    t.SetColor("fontColor", "Label", new Color(1.0f, 1.0f, 1.0f));
+    
+    var l = new Label();
+    l.SetTheme(t);
+
 In the example above, a new theme is created. The "font_color" option
 In the example above, a new theme is created. The "font_color" option
 is changed and then applied to a label. As a result, the label (and all
 is changed and then applied to a label. As a result, the label (and all
 children and grand children labels) will use that color.
 children and grand children labels) will use that color.
@@ -83,11 +92,17 @@ It is possible to override those options without using the theme
 directly and only for a specific control by using the override API in
 directly and only for a specific control by using the override API in
 :ref:`Control.add_color_override() <class_Control_add_color_override>`:
 :ref:`Control.add_color_override() <class_Control_add_color_override>`:
 
 
-::
+.. tabs::
+ .. code-tab:: gdscript GDScript
 
 
     var l = Label.new()
     var l = Label.new()
     l.add_color_override("font_color", Color(1.0, 1.0, 1.0))
     l.add_color_override("font_color", Color(1.0, 1.0, 1.0))
 
 
+ .. code-tab:: csharp
+
+    var l = new Label();
+    l.AddColorOverride("fontColor", new Color(1.0f, 1.0f, 1.0f));
+
 In the inline help of Godot (in the script tab) you can check which theme options
 In the inline help of Godot (in the script tab) you can check which theme options
 are overrideable, or check the :ref:`Control <class_Control>` class reference.
 are overrideable, or check the :ref:`Control <class_Control>` class reference.