generated from tecMTST/modelo-godot-3.6
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from tecMTST/7-barra-de-progresso
- Loading branch information
Showing
8 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions
35
projeto/elementos/imagem/barra_de_progresso/fundo.png.import
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/fundo.png-0a1a86aa75498b31d47624a51fc38715.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://elementos/imagem/barra_de_progresso/fundo.png" | ||
dest_files=[ "res://.import/fundo.png-0a1a86aa75498b31d47624a51fc38715.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=false | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
process/normal_map_invert_y=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions
35
projeto/elementos/imagem/barra_de_progresso/moldura.png.import
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/moldura.png-aecc44eb07ae69d6b96457c2b86fe33c.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://elementos/imagem/barra_de_progresso/moldura.png" | ||
dest_files=[ "res://.import/moldura.png-aecc44eb07ae69d6b96457c2b86fe33c.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=false | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
process/normal_map_invert_y=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions
35
projeto/elementos/imagem/barra_de_progresso/progresso.png.import
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/progresso.png-12352f0df24c8d27f5d033d057966854.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://elementos/imagem/barra_de_progresso/progresso.png" | ||
dest_files=[ "res://.import/progresso.png-12352f0df24c8d27f5d033d057966854.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=false | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
process/normal_map_invert_y=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
22 changes: 22 additions & 0 deletions
22
projeto/recursos/jogos/enchente/barra_de_progresso/BarraDeProgresso.gd
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
extends Node2D | ||
|
||
|
||
onready var icone = $Icone | ||
onready var progresso = $ProgressoDeTextura | ||
|
||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready(): | ||
icone.position.y = _calcular_posicao() | ||
|
||
|
||
func definir_valor(valor: float): | ||
progresso.value = valor | ||
icone.position.y = _calcular_posicao() | ||
|
||
|
||
func _calcular_posicao(): | ||
var altura = progresso.rect_size.y * progresso.rect_scale.y | ||
var inicio = progresso.rect_position.y + altura | ||
var posicao = altura * progresso.value / progresso.max_value | ||
return inicio - posicao |
26 changes: 26 additions & 0 deletions
26
projeto/recursos/jogos/enchente/barra_de_progresso/BarraDeProgresso.tscn
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[gd_scene load_steps=6 format=2] | ||
|
||
[ext_resource path="res://elementos/imagem/icon.png" type="Texture" id=1] | ||
[ext_resource path="res://recursos/jogos/enchente/barra_de_progresso/BarraDeProgresso.gd" type="Script" id=2] | ||
[ext_resource path="res://elementos/imagem/barra_de_progresso/progresso.png" type="Texture" id=3] | ||
[ext_resource path="res://elementos/imagem/barra_de_progresso/moldura.png" type="Texture" id=4] | ||
[ext_resource path="res://elementos/imagem/barra_de_progresso/fundo.png" type="Texture" id=5] | ||
|
||
[node name="BarraDeProgresso" type="Node2D"] | ||
script = ExtResource( 2 ) | ||
|
||
[node name="ProgressoDeTextura" type="TextureProgress" parent="."] | ||
margin_left = 300.0 | ||
margin_top = 70.0 | ||
margin_right = 340.0 | ||
margin_bottom = 170.0 | ||
rect_scale = Vector2( 1, 5 ) | ||
texture_under = ExtResource( 5 ) | ||
texture_over = ExtResource( 4 ) | ||
texture_progress = ExtResource( 3 ) | ||
fill_mode = 3 | ||
|
||
[node name="Icone" type="Sprite" parent="."] | ||
position = Vector2( 310, 513 ) | ||
scale = Vector2( 0.5, 0.5 ) | ||
texture = ExtResource( 1 ) |