broken_seals_2ds/game/addons/module_manager/previews/TexturePreview.gd
2022-01-30 23:20:50 +01:00

13 lines
213 B
GDScript

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