doc
parent
ecf19a98a4
commit
b73936bf32
|
@ -62,7 +62,7 @@ Audio音频素材 ( *.mp3)
|
|||
每一个大格子为:64像素 x 64像素
|
||||
```
|
||||
|
||||
# 4. 游戏对象
|
||||
# 4. 游戏对象(节点)
|
||||
|
||||
- 游戏对象 Node,就是场景中包含的内容,godot所有操作都是基于节点Node
|
||||
|
||||
|
@ -85,7 +85,9 @@ Audio音频素材 ( *.mp3)
|
|||
在层级管理器中,可以修改名字、删除对象等操作
|
||||
```
|
||||
|
||||
# 4. godot的坐标系
|
||||
# 5. 坐标系
|
||||
|
||||
![Image text](../demo05_scene_node/image/坐标系-godot-1.png)
|
||||
|
||||
- 选择移动工具,移动一个对象
|
||||
|
||||
|
@ -106,7 +108,7 @@ x轴向右为正
|
|||
|
||||
- 相对坐标系,相对于父节点的坐标,godot的坐标都是相对坐标
|
||||
|
||||
# 4. godot的快捷键和界面基础操作
|
||||
# 6. 对象的基础操作
|
||||
|
||||
- Q,选择
|
||||
- W,移动,改变 Position
|
||||
|
@ -123,6 +125,7 @@ Move Mode 对象的移动:
|
|||
|
||||
```
|
||||
Rotate Mode 对象的旋转
|
||||
沿轴心点旋转
|
||||
```
|
||||
|
||||
- S,缩放,改变 Scale
|
||||
|
@ -139,11 +142,31 @@ Scale Mode 对象的缩放
|
|||
- Ctrl + 鼠标拖曳,以pivot为中心旋转当前对象
|
||||
- Alt + 拖曳边框缩放点,保持选中目标中心位置不变进行缩放
|
||||
|
||||
### pivot,轴心点
|
||||
|
||||
- 轴心点可以理解为把物体抽象成一个点,物体的位置就是指其轴心点的位置,就是该物体坐标系的原点
|
||||
|
||||
### anchor,锚点
|
||||
|
||||
- 锚点描述的是一个对象的Margin,相对于锚点的坐标
|
||||
- 是一个点,锚点描述的是一个对象的Margin,相对于锚点的坐标
|
||||
- 锚点的left,top,right,bottom是相对于父节点的值
|
||||
- 主要是用于描述节点的位置
|
||||
- 当对一个节点的子节点进行设置锚点时,子节点的锚点范围只能够是父节点的控件区域内。
|
||||
- 注意任何布局也都是相对于父窗口矩形的
|
||||
- **主要用于描述子节点相对于父节点的位置**
|
||||
|
||||
### pivot,轴心点
|
||||
|
||||
- 中心点是一个物体的中心,当我们对物体进行操作的时候,都是以中心点为中心进行对物体的操作
|
||||
- 轴心点可以理解为把物体抽象成一个点,物体的位置就是指其轴心点的位置,就是该物体坐标系的原点
|
||||
- **主要用于旋转**
|
||||
|
||||
# 7. 对象操作的工具,多节点选择,轴心点,平滑,尺子
|
||||
|
||||
- 多节点选择工具,show a list
|
||||
- 轴心点工具
|
||||
- 平滑工具
|
||||
- 尺子工具
|
||||
|
||||
# 8. 智能对齐Snap和锁定节点
|
||||
|
||||
- 智能对齐,Smart Snap
|
||||
- 网格对齐,Grid Snap
|
||||
- 锁定节点,使其不能移动
|
||||
- 子节点不可选中
|
|
@ -1,30 +1,30 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo13_camera/switch_camera.gd" type="Script" id=1]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=2]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=1]
|
||||
[ext_resource path="res://script/demo13_camera/switch_camera.gd" type="Script" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="icon" type="Sprite" parent="."]
|
||||
modulate = Color( 0.964706, 0.0313726, 0.0313726, 1 )
|
||||
position = Vector2( -470.777, 240.836 )
|
||||
texture = ExtResource( 2 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="icon2" type="Sprite" parent="."]
|
||||
modulate = Color( 0.882353, 0.796078, 0.0901961, 1 )
|
||||
position = Vector2( 713.424, 294.807 )
|
||||
texture = ExtResource( 2 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="icon3" type="Sprite" parent="."]
|
||||
modulate = Color( 0.0588235, 0.152941, 0.584314, 1 )
|
||||
position = Vector2( -469.983, 848.017 )
|
||||
texture = ExtResource( 2 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="icon4" type="Sprite" parent="."]
|
||||
modulate = Color( 0.0705882, 0.92549, 0.666667, 1 )
|
||||
position = Vector2( 733.267, 888.495 )
|
||||
texture = ExtResource( 2 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Camera2D1" type="Camera2D" parent="."]
|
||||
position = Vector2( -514.899, 305.125 )
|
|
@ -3,7 +3,7 @@
|
|||
[ext_resource path="res://script/demo13_camera/player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
[node name="Node2D2" type="Node2D"]
|
||||
position = Vector2( -82.76, 10.6787 )
|
||||
|
||||
[node name="icon" type="Sprite" parent="."]
|
|
@ -1,13 +1,13 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://script/demo13_camera/player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=2]
|
||||
[ext_resource path="res://icon.png" type="Texture" id=1]
|
||||
[ext_resource path="res://script/demo13_camera/player.gd" type="Script" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="icon" type="Sprite" parent="."]
|
||||
position = Vector2( 73.0152, 64.7613 )
|
||||
texture = ExtResource( 2 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
margin_left = 1.0
|
||||
|
@ -34,5 +34,5 @@ render_target_update_mode = 3
|
|||
|
||||
[node name="Sprite" type="Sprite" parent="Control/ViewportContainer/Viewport"]
|
||||
position = Vector2( 100, 100 )
|
||||
texture = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
||||
texture = ExtResource( 1 )
|
||||
script = ExtResource( 2 )
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo13_camera/move_camera.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scene/demo13_camera/2.move_camera.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scene/demo13_camera/mini_viewport.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
@ -10,5 +10,6 @@
|
|||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Control" parent="CanvasLayer" instance=ExtResource( 2 )]
|
||||
modulate = Color( 0.894118, 0.792157, 0.792157, 1 )
|
||||
margin_right = 0.0
|
||||
margin_bottom = 0.0
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://scene/demo13_camera/move_camera.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scene/demo13_camera/2.move_camera.tscn" type="PackedScene" id=1]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
anchor_right = 1.0
|
||||
|
|
Loading…
Reference in New Issue