Move shaders to default theme and add shader_override related methods to Control class
This commit is contained in:
parent
dc7755ffcd
commit
1f3d6824c8
10 changed files with 282 additions and 59 deletions
|
|
@ -80,6 +80,13 @@ static Ref<Texture> make_icon(T p_src) {
|
|||
return texture;
|
||||
}
|
||||
|
||||
static Ref<Shader> make_shader(const char*vertex_code,const char*fragment_code,const char*lighting_code) {
|
||||
Ref<Shader> shader = (memnew( Shader(Shader::MODE_CANVAS_ITEM) ));
|
||||
shader->set_code(vertex_code, fragment_code, lighting_code);
|
||||
|
||||
return shader;
|
||||
}
|
||||
|
||||
static Ref<Font> make_font(int p_height,int p_ascent, int p_valign, int p_charcount, const int *p_chars,const Ref<Texture> &p_texture) {
|
||||
|
||||
|
||||
|
|
@ -768,7 +775,9 @@ void make_default_theme() {
|
|||
t->set_constant("hseparator","ColorPicker", 4);
|
||||
|
||||
t->set_icon("screen_picker","ColorPicker", make_icon( icon_color_pick_png ) );
|
||||
|
||||
|
||||
t->set_shader("uv_editor", "ColorPicker", make_shader("", uv_editor_shader_code, ""));
|
||||
t->set_shader("w_editor", "ColorPicker", make_shader("", w_editor_shader_code, ""));
|
||||
|
||||
// TooltipPanel
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue