mirror of
https://github.com/Relintai/GraphicsEditor.git
synced 2024-11-19 16:27:22 +01:00
Added layer preview
This commit is contained in:
parent
bd733fce12
commit
a4228b4d29
@ -2,17 +2,15 @@ tool
|
||||
extends Control
|
||||
onready var layers = get_node("../../../../")
|
||||
onready var canvas = layers.canvas
|
||||
var image_storage = Image.new()
|
||||
#TODO: Get image preview working!
|
||||
var image_preview setget set_image_preview
|
||||
var image_storage = Image.new() setget set_image_storage
|
||||
var layer_visible = true setget set_layer_visible
|
||||
|
||||
func _ready():
|
||||
var canvas_size = canvas.image.get_size()
|
||||
image_storage.create(canvas_size.x, canvas_size.y, true, Image.FORMAT_RGBA8)
|
||||
|
||||
func set_image_preview(image_data):
|
||||
image_preview = image_data
|
||||
func set_image_storage(image_data):
|
||||
image_storage = image_data
|
||||
var texture = ImageTexture.new()
|
||||
texture.create_from_image(image_data)
|
||||
texture.set_flags(0)
|
||||
|
Loading…
Reference in New Issue
Block a user