Skip to content

Commit 9de9aef

Browse files
committed
Initial commit
0 parents  commit 9de9aef

9 files changed

Lines changed: 167 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.godot/

export_presets.cfg

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
[preset.0]
3+
4+
name="Export Extension (PCK)"
5+
platform="Windows Desktop"
6+
runnable=false
7+
custom_features=""
8+
export_filter="all_resources"
9+
include_filter="*.json"
10+
exclude_filter=""
11+
export_path=""
12+
script_export_mode=2
13+
script_encryption_key=""
14+
15+
[preset.0.options]
16+
17+
custom_template/debug=""
18+
custom_template/release=""
19+
binary_format/64_bits=true
20+
binary_format/embed_pck=false
21+
texture_format/bptc=false
22+
texture_format/s3tc=true
23+
texture_format/etc=false
24+
texture_format/etc2=false
25+
texture_format/no_bptc_fallbacks=true
26+
codesign/enable=false
27+
codesign/identity=""
28+
codesign/password=""
29+
codesign/timestamp=true
30+
codesign/timestamp_server_url=""
31+
codesign/digest_algorithm=1
32+
codesign/description=""
33+
codesign/custom_options=PackedStringArray( )
34+
application/icon=""
35+
application/file_version=""
36+
application/product_version=""
37+
application/company_name=""
38+
application/product_name=""
39+
application/file_description=""
40+
application/copyright=""
41+
application/trademarks=""

icon.png

573 Bytes
Loading

icon.png.import

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="CompressedTexture2D"
5+
uid="uid://x4j43mu2o808"
6+
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
7+
metadata={
8+
"vram_texture": false
9+
}
10+
11+
[deps]
12+
13+
source_file="res://icon.png"
14+
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
15+
16+
[params]
17+
18+
compress/mode=0
19+
compress/high_quality=false
20+
compress/lossy_quality=0.7
21+
compress/hdr_compression=1
22+
compress/normal_map=0
23+
compress/channel_pack=0
24+
mipmaps/generate=false
25+
mipmaps/limit=-1
26+
roughness/mode=0
27+
roughness/src_normal=""
28+
process/fix_alpha_border=true
29+
process/premult_alpha=false
30+
process/normal_map_invert_y=false
31+
process/hdr_as_srgb=false
32+
process/hdr_clamp_exposure=false
33+
process/size_limit=0
34+
detect_3d/compress_to=1

project.godot

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
; Engine configuration file.
2+
; It's best edited using the editor UI and not directly,
3+
; since the parameters that go here are not all obvious.
4+
;
5+
; Format:
6+
; [section] ; section goes between []
7+
; param=value ; assign values to parameters
8+
9+
config_version=5
10+
11+
[application]
12+
13+
config/name="QuickZoom"
14+
config/description="Quick Zoom"
15+
config/tags=PackedStringArray("pixelorama_extension")
16+
run/main_scene="res://src/Extensions/QuickZoom/Main.tscn"
17+
config/features=PackedStringArray("4.4", "GL Compatibility")
18+
config/icon="res://icon.png"
19+
20+
[rendering]
21+
22+
renderer/rendering_method="gl_compatibility"
23+
renderer/rendering_method.mobile="gl_compatibility"

src/Extensions/QuickZoom/Main.gd

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
extends Node
2+
3+
@onready var extension_api: Node ## A variable for easy reference to the Api
4+
5+
var zoom_slider
6+
7+
## This script acts as a setup for the extension
8+
func _enter_tree() -> void:
9+
# NOTE: Use get_node_or_null("/root/ExtensionsApi") to access api.
10+
# NOTE: See https://www.oramainteractive.com/Pixelorama-Docs/extension_system/extension_api for
11+
# detailed documentation.
12+
extension_api = get_node_or_null("/root/ExtensionsApi")
13+
# |==== Your code goes here ====|
14+
zoom_slider = extension_api.general.get_global().camera.zoom_slider
15+
# |=============================|
16+
17+
func _input(event: InputEvent) -> void:
18+
if !zoom_slider:
19+
return
20+
if event is InputEventKey:
21+
match event.keycode:
22+
KEY_0:
23+
extension_api.general.get_global().camera.fit_to_frame(
24+
extension_api.project.current_project.size
25+
)
26+
KEY_1:
27+
zoom_slider.value = 100
28+
KEY_2:
29+
zoom_slider.value = 200
30+
KEY_3:
31+
zoom_slider.value = 300
32+
KEY_4:
33+
zoom_slider.value = 400
34+
KEY_5:
35+
zoom_slider.value = 500
36+
KEY_6:
37+
zoom_slider.value = 600
38+
KEY_7:
39+
zoom_slider.value = 700
40+
KEY_8:
41+
zoom_slider.value = 800
42+
KEY_9:
43+
zoom_slider.value = 900
44+
45+
46+
47+
## Gets called when the extension is being disabled or uninstalled (while enabled).
48+
func _exit_tree() -> void:
49+
# Remember to remove things that you added using this extension
50+
# Disconnect any signals and queue_free() any nodes that got added.
51+
pass ## Replace with your code
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://ojmbfj5hsynv

src/Extensions/QuickZoom/Main.tscn

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[gd_scene load_steps=2 format=3 uid="uid://cdualkgsa3k1f"]
2+
3+
[ext_resource type="Script" uid="uid://ojmbfj5hsynv" path="res://src/Extensions/QuickZoom/Main.gd" id="1"]
4+
5+
[node name="Main" type="Node"]
6+
script = ExtResource("1")
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"author": "Variable",
3+
"description": "Quick Zoom",
4+
"display_name": "Quick Zoom",
5+
"license": "MIT",
6+
"name": "QuickZoom",
7+
"nodes": ["Main.tscn"],
8+
"supported_api_versions": [6],
9+
"version": "0.1"
10+
}

0 commit comments

Comments
 (0)