You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Add static methods for creating Image and ImageTexture
This commit is contained in:
@@ -2381,9 +2381,7 @@ void TextServerAdvanced::font_set_texture_image(const RID &p_font_rid, const Vec
|
||||
img->generate_mipmaps();
|
||||
}
|
||||
|
||||
tex.texture = Ref<ImageTexture>();
|
||||
tex.texture.instantiate();
|
||||
tex.texture->create_from_image(img);
|
||||
tex.texture = ImageTexture::create_from_image(img);
|
||||
tex.dirty = false;
|
||||
}
|
||||
|
||||
@@ -2688,8 +2686,7 @@ RID TextServerAdvanced::font_get_glyph_texture_rid(const RID &p_font_rid, const
|
||||
img->generate_mipmaps();
|
||||
}
|
||||
if (tex.texture.is_null()) {
|
||||
tex.texture.instantiate();
|
||||
tex.texture->create_from_image(img);
|
||||
tex.texture = ImageTexture::create_from_image(img);
|
||||
} else {
|
||||
tex.texture->update(img);
|
||||
}
|
||||
@@ -2728,8 +2725,7 @@ Size2 TextServerAdvanced::font_get_glyph_texture_size(const RID &p_font_rid, con
|
||||
img->generate_mipmaps();
|
||||
}
|
||||
if (tex.texture.is_null()) {
|
||||
tex.texture.instantiate();
|
||||
tex.texture->create_from_image(img);
|
||||
tex.texture = ImageTexture::create_from_image(img);
|
||||
} else {
|
||||
tex.texture->update(img);
|
||||
}
|
||||
@@ -3060,8 +3056,7 @@ void TextServerAdvanced::font_draw_glyph(const RID &p_font_rid, const RID &p_can
|
||||
img->generate_mipmaps();
|
||||
}
|
||||
if (tex.texture.is_null()) {
|
||||
tex.texture.instantiate();
|
||||
tex.texture->create_from_image(img);
|
||||
tex.texture = ImageTexture::create_from_image(img);
|
||||
} else {
|
||||
tex.texture->update(img);
|
||||
}
|
||||
@@ -3139,8 +3134,7 @@ void TextServerAdvanced::font_draw_glyph_outline(const RID &p_font_rid, const RI
|
||||
img->generate_mipmaps();
|
||||
}
|
||||
if (tex.texture.is_null()) {
|
||||
tex.texture.instantiate();
|
||||
tex.texture->create_from_image(img);
|
||||
tex.texture = ImageTexture::create_from_image(img);
|
||||
} else {
|
||||
tex.texture->update(img);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user