Skip to content

Commit

Permalink
Merge pull request #14 from tecMTST/7-barra-de-progresso
Browse files Browse the repository at this point in the history
  • Loading branch information
rodigu authored May 26, 2024
2 parents f18f42e + f321b7a commit c9de91d
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 0 deletions.
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 projeto/elementos/imagem/barra_de_progresso/fundo.png.import
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 projeto/elementos/imagem/barra_de_progresso/moldura.png.import
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 projeto/elementos/imagem/barra_de_progresso/progresso.png.import
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
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
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 )

0 comments on commit c9de91d

Please sign in to comment.