1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-20 12:33:14 +00:00

Canvas transparent background changes on dark & gold themes

It's also in Global.gd instead of Canvas.gd
This commit is contained in:
OverloadedOrama 2019-12-21 04:56:48 +02:00
parent d08841da62
commit c6ded721d1
11 changed files with 48 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

View file

@ -0,0 +1,13 @@
[remap]
importer="image"
type="Image"
path="res://.import/Transparent Background Dark.png-3390cbd0582c34c8d5e9ea776775a7f5.image"
[deps]
source_file="res://Assets/Graphics/Transparent Background Dark.png"
dest_files=[ "res://.import/Transparent Background Dark.png-3390cbd0582c34c8d5e9ea776775a7f5.image" ]
[params]

View file

Before

Width:  |  Height:  |  Size: 84 B

After

Width:  |  Height:  |  Size: 84 B

View file

@ -0,0 +1,13 @@
[remap]
importer="image"
type="Image"
path="res://.import/Transparent Background Godot.png-d1a39497ccb71eaedecb0ccf98e2bf02.image"
[deps]
source_file="res://Assets/Graphics/Transparent Background Godot.png"
dest_files=[ "res://.import/Transparent Background Godot.png-d1a39497ccb71eaedecb0ccf98e2bf02.image" ]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

View file

@ -0,0 +1,13 @@
[remap]
importer="image"
type="Image"
path="res://.import/Transparent Background Gold.png-df3e9b1fb8719f4a7356d4379d2066e3.image"
[deps]
source_file="res://Assets/Graphics/Transparent Background Gold.png"
dest_files=[ "res://.import/Transparent Background Gold.png-df3e9b1fb8719f4a7356d4379d2066e3.image" ]
[params]

View file

@ -1,13 +0,0 @@
[remap]
importer="image"
type="Image"
path="res://.import/Transparent Background.png-62a2c5eb3e805ff7dbb890edc2b8d883.image"
[deps]
source_file="res://Assets/Graphics/Transparent Background.png"
dest_files=[ "res://.import/Transparent Background.png-62a2c5eb3e805ff7dbb890edc2b8d883.image" ]
[params]

View file

@ -226,7 +226,6 @@ text = "[64×64]"
align = 2
[node name="UI" type="HBoxContainer" parent="MenuAndUI"]
editor/display_folded = true
margin_top = 28.0
margin_right = 1152.0
margin_bottom = 648.0
@ -802,7 +801,6 @@ mouse_default_cursor_shape = 2
text = "Vertical"
[node name="CanvasAndTimeline" type="VBoxContainer" parent="MenuAndUI/UI"]
editor/display_folded = true
margin_left = 224.0
margin_right = 928.0
margin_bottom = 620.0

View file

@ -3,7 +3,6 @@ class_name Canvas
var layers := []
var current_layer_index := 0
var trans_background : ImageTexture
var location := Vector2.ZERO
var size := Vector2(64, 64)
var frame := 0 setget frame_changed
@ -27,9 +26,6 @@ var line_2d : Line2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
Global.can_draw = false
#Background
trans_background = ImageTexture.new()
trans_background.create_from_image(preload("res://Assets/Graphics/Transparent Background.png"), 0)
#The sprite itself
if layers.empty():
@ -381,7 +377,7 @@ func get_layer_container(layer_index : int) -> LayerContainer:
return null
func _draw() -> void:
draw_texture_rect(trans_background, Rect2(location, size), true) #Draw transparent background
draw_texture_rect(Global.transparent_background, Rect2(location, size), true) #Draw transparent background
#Onion Skinning
#Past
if Global.onion_skinning_past_rate > 0:

View file

@ -17,6 +17,7 @@ var canvases := []
var hidden_canvases := []
var left_cursor_tool_texture : ImageTexture
var right_cursor_tool_texture : ImageTexture
var transparent_background : ImageTexture
# warning-ignore:unused_class_variable
var selected_pixels := []
var image_clipboard : Image
@ -205,6 +206,8 @@ func _ready() -> void:
config_cache.load("user://cache.ini")
undo_redo = UndoRedo.new()
transparent_background = ImageTexture.new()
transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0)
image_clipboard = Image.new()
var root = get_tree().get_root()

View file

@ -32,24 +32,28 @@ func change_theme(ID : int) -> void:
var ruler_style
if ID == 0: #Dark Theme
Global.theme_type = "Dark"
VisualServer.set_default_clear_color(Color(0.301961, 0.301961, 0.301961))
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Dark.png"), 0)
VisualServer.set_default_clear_color(Color(0.247059, 0.25098, 0.247059))
main_theme = preload("res://Themes & Styles/Dark Theme/Dark Theme.tres")
top_menu_style = preload("res://Themes & Styles/Dark Theme/DarkTopMenuStyle.tres")
ruler_style = preload("res://Themes & Styles/Dark Theme/DarkRulerStyle.tres")
elif ID == 1: #Gray Theme
Global.theme_type = "Dark"
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0)
VisualServer.set_default_clear_color(Color(0.301961, 0.301961, 0.301961))
main_theme = preload("res://Themes & Styles/Gray Theme/Gray Theme.tres")
top_menu_style = preload("res://Themes & Styles/Gray Theme/GrayTopMenuStyle.tres")
ruler_style = preload("res://Themes & Styles/Dark Theme/DarkRulerStyle.tres")
elif ID == 2: #Godot's Theme
Global.theme_type = "Dark"
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Godot.png"), 0)
VisualServer.set_default_clear_color(Color(0.301961, 0.301961, 0.301961))
main_theme = preload("res://Themes & Styles/Godot\'s Theme/Godot\'s Theme.tres")
top_menu_style = preload("res://Themes & Styles/Godot\'s Theme/TopMenuStyle.tres")
ruler_style = preload("res://Themes & Styles/Godot\'s Theme/RulerStyle.tres")
elif ID == 3: #Gold Theme
Global.theme_type = "Light"
Global.transparent_background.create_from_image(preload("res://Assets/Graphics/Transparent Background Gold.png"), 0)
VisualServer.set_default_clear_color(Color(0.694118, 0.619608, 0.458824))
main_theme = preload("res://Themes & Styles/Gold Theme/Gold Theme.tres")
top_menu_style = preload("res://Themes & Styles/Gold Theme/GoldTopMenuStyle.tres")