Add static methods for creating Image and ImageTexture

This commit is contained in:
kobewi 2022-05-04 01:49:20 +02:00
parent ca18a02e00
commit d2900429e8
42 changed files with 117 additions and 243 deletions

View file

@ -33,11 +33,7 @@
#include "editor/editor_scale.h"
void BitMapEditor::setup(const Ref<BitMap> &p_bitmap) {
Ref<ImageTexture> texture;
texture.instantiate();
texture->create_from_image(p_bitmap->convert_to_image());
texture_rect->set_texture(texture);
texture_rect->set_texture(ImageTexture::create_from_image(p_bitmap->convert_to_image()));
size_label->set_text(vformat(String::utf8("%s×%s"), p_bitmap->get_size().width, p_bitmap->get_size().height));
}