You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add static methods for creating Image and ImageTexture
This commit is contained in:
@@ -165,14 +165,9 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
|
||||
|
||||
// Overlay and thumbnail need the same format for `blend_rect` to work.
|
||||
thumbnail->convert(Image::FORMAT_RGBA8);
|
||||
|
||||
thumbnail->blend_rect(overlay, overlay->get_used_rect(), overlay_pos);
|
||||
preview_images[i].button->set_icon(ImageTexture::create_from_image(thumbnail));
|
||||
|
||||
Ref<ImageTexture> tex;
|
||||
tex.instantiate();
|
||||
tex->create_from_image(thumbnail);
|
||||
|
||||
preview_images[i].button->set_icon(tex);
|
||||
// Make it clearer that clicking it will open an external link
|
||||
preview_images[i].button->set_default_cursor_shape(Control::CURSOR_POINTING_HAND);
|
||||
} else {
|
||||
@@ -790,9 +785,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PackedB
|
||||
} break;
|
||||
}
|
||||
|
||||
Ref<ImageTexture> tex;
|
||||
tex.instantiate();
|
||||
tex->create_from_image(image);
|
||||
Ref<ImageTexture> tex = ImageTexture::create_from_image(image);
|
||||
|
||||
obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, tex);
|
||||
image_set = true;
|
||||
|
||||
Reference in New Issue
Block a user