Last active
February 7, 2017 21:02
-
-
Save thimenesup/615112c4ae6c3d9ed471ee643e8a4b7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node | |
func _ready(): | |
var img = ImageTexture.new() | |
img.load("res://image.png") | |
var img_data = img.get_data() | |
var raw_data = img_data.get_data() | |
save(raw_data) | |
func save(content): | |
var file = File.new() | |
file.open("res://image_file.dat", file.WRITE) | |
file.store_buffer(content) | |
file.close() | |
#V2 | |
extends Node | |
func _ready(): | |
var img_tex = ImageTexture.new() | |
img_tex.load("res://image.png") | |
var img = img_tex.get_data().compressed() | |
var raw_data = img.get_data() | |
save(raw_data) | |
func save(content): | |
var file = File.new() | |
file.open("res://image_file.dat", file.WRITE) | |
file.store_buffer(content) | |
file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment