utilities_gamedev/data_manager/previews/TexturePreview.gd

13 lines
213 B
GDScript3
Raw Permalink Normal View History

2022-07-16 18:07:21 +02:00
tool
extends TextureRect
func set_texture(tex: Texture)-> void:
texture = tex
if tex is PackerImageResource:
var t : ImageTexture = ImageTexture.new()
t.create_from_image(tex.data, 0)
texture = t