Доработка. Копка масштаба карты

This commit is contained in:
sasha80
2023-09-29 09:03:29 +03:00
parent fc3a5297f8
commit a50da0cfd2
3 changed files with 43 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c1maea6yhd3k7"
path="res://.godot/imported/кнопка-масштаб.png-506c26462e59a71e6707c554c495504e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/кнопка-масштаб.png"
dest_files=["res://.godot/imported/кнопка-масштаб.png-506c26462e59a71e6707c554c495504e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@@ -175,10 +175,12 @@ func _input(event) -> void:
shift_pressed = event.pressed
## Переключает режим окна программы полный - обычный экран
func toggle_full_screen(id: int) -> void:
var mode = DisplayServer.window_get_mode(id)
mode = DisplayServer.WINDOW_MODE_WINDOWED \
if mode == DisplayServer.WINDOW_MODE_FULLSCREEN \
else DisplayServer.WINDOW_MODE_FULLSCREEN
DisplayServer.window_set_mode(mode, id)
## Изменяет масштаб
func _on_btn_scale_pressed() -> void:
var i_scale = $btn_scale.get_meta('i_scale')
var prefix = $btn_scale.get_meta('prefix')
var scales = $btn_scale.get_meta('scales')
i_scale += 1
i_scale %= scales.size()
$btn_scale.set_meta('i_scale', i_scale)
$btn_scale/lbl.text = '%s %.0f км' % [prefix, scales[i_scale]]