mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 15:00:09 +01:00
Handle multiple resolutions in most demos
This makes demos render correctly on hiDPI displays, while also demonstrating how to handle multiple resolutions. The 3D in 2D demo now uses "3D No-Effects" for the 3D viewport, which is faster to render. Thanks to this, 4× MSAA is now enabled for a better result. The background loading demo now uses mipmaps for better-looking images. The material testers demo now samples mouse input in a resolution-independent manner when panning. Default clear colors were also changed in some projects for visual consistency with the project's theme.
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/character.png-7a996d3b758d22c506b76a7c15391284.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
|
||||
@@ -24,3 +24,7 @@ position = Vector2( 228.464, 132.594 )
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
texture = ExtResource( 3 )
|
||||
offset = Vector2( 0, -26 )
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
offset = Vector2( 400, 300 )
|
||||
current = true
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/map.png-9eea34967fae34f4388f4a32a16da936.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
|
||||
@@ -31,12 +31,12 @@ func move_along_path(distance):
|
||||
var last_point = $Character.position
|
||||
while path.size():
|
||||
var distance_between_points = last_point.distance_to(path[0])
|
||||
|
||||
|
||||
# the position to move to falls between two points
|
||||
if distance <= distance_between_points:
|
||||
$Character.position = last_point.linear_interpolate(path[0], distance / distance_between_points)
|
||||
return
|
||||
|
||||
|
||||
# the position is past the end of the segment
|
||||
distance -= distance_between_points
|
||||
last_point = path[0]
|
||||
|
||||
@@ -22,6 +22,8 @@ config/icon="res://icon.png"
|
||||
[display]
|
||||
|
||||
window/size/width=800
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="expand"
|
||||
stretch/aspect="keep"
|
||||
stretch/mode="2d"
|
||||
|
||||
@@ -36,3 +38,7 @@ click={
|
||||
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_clear_color=Color( 0.160784, 0.172549, 0.278431, 1 )
|
||||
|
||||
Reference in New Issue
Block a user