mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 15:54:44 -04:00
Merge pull request #118 from Gaarco/master
Add preference options for the Image: default width, default height, default fill color and their translation strings
This commit is contained in:
commit
8b4c42a576
16 changed files with 284 additions and 28 deletions
|
@ -5,6 +5,7 @@ var layers := []
|
|||
var current_layer_index := 0
|
||||
var location := Vector2.ZERO
|
||||
var size := Vector2(64, 64)
|
||||
var fill_color := Color(0, 0, 0, 0)
|
||||
var frame := 0 setget frame_changed
|
||||
var frame_button : VBoxContainer
|
||||
var frame_texture_rect : TextureRect
|
||||
|
@ -32,7 +33,17 @@ func _ready() -> void:
|
|||
# The sprite itself
|
||||
if layers.empty():
|
||||
var sprite := Image.new()
|
||||
if Global.is_default_image:
|
||||
if Global.config_cache.has_section_key("preferences", "default_width"):
|
||||
size.x = Global.config_cache.get_value("preferences", "default_width")
|
||||
if Global.config_cache.has_section_key("preferences", "default_height"):
|
||||
size.y = Global.config_cache.get_value("preferences", "default_height")
|
||||
if Global.config_cache.has_section_key("preferences", "default_fill_color"):
|
||||
fill_color = Global.config_cache.get_value("preferences", "default_fill_color")
|
||||
Global.is_default_image = !Global.is_default_image
|
||||
|
||||
sprite.create(size.x, size.y, false, Image.FORMAT_RGBA8)
|
||||
sprite.fill(fill_color)
|
||||
sprite.lock()
|
||||
|
||||
var tex := ImageTexture.new()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue