Godot引擎学习实况-持续更新
2020-04-08 19:06:20 29 举报
AI智能生成
Godot游戏引擎学习
作者其他创作
大纲/内容
操 作
移动
按shift垂直水平移动
选中节点居中
F
Ctrl+D复制节点
给sprite创建CollisionShape
创建精灵兄弟节点
图块集
制作tileset
Node2D
Sprite
StaticBody2D
CollisionShape2D
Scene
Convert To
TileSet
将制作的tileset拖入TileMap节点
代 码
get_tree().quit()
is_action_pressed
例if Input.is_action_pressed("ui_right"):
velocity.x +=1
velocity.x +=1
is_action_just_pressed
export var
export (int) var speed
clamp(某个值,最小值,最大值)
position.x = clamp(position.x,0,screensize.x)
_physics_process():
func _physics_process(delta):
queue_free()
UI设计
节点
Control
Label
印文本到屏幕。您将在属性检查器中 Label 部分找到它的所有属性。在 Text 属性中写入文本,如果希望它遵守文本框的大小,请选中 Autowrap。如果关闭 Autowrap,则无法缩放节点。您可以使用 Align 和 Valign 分别水平和垂直对齐文本。
TextureRect
Stretch Mode
Scale On Expand (compat)
Scale
Tile
Keep
Keep Centered
Keep Aspect
Keep Aspect Centered
Keep Aspect Covered
Modulate
TextureProgress
Under 和 Over 纹理将显示进度条的值的 Progress 夹在中间。
NinePatchRect
将纹理分割成3行和3列。缩放纹理时,中心和侧面会平铺,但不会缩放角落。为UI构建面板、对话框和可伸缩的背景非常有用。
TextureButton
container
MarginContainer,在UI的部件周围添加边距
CenterContainer,将其子项放在其边界框中
VboxContainer 和 HboxContainer,用于在行或列中排列UI元素
GridContainer,以栅格状模式排列 Controls 节点
CenterContainer,将其子项放在其边界框中
VboxContainer 和 HboxContainer,用于在行或列中排列UI元素
GridContainer,以栅格状模式排列 Controls 节点
字 体
Custom Fonts
勾选Font
新建DynamicFont
点击DynamicFont
下载字体
在res//中新建Font文件夹,放入字体
打开Font下面的Font Data,拖入字体
节 点
音频
audio
WAV
音效
https://www.leshylabs.com/apps/sfMaker/
Ogg
BGM
www.tosound.com
VisibilityNotifier2D
TileMap
ColorRect
游戏
UI
英 语 学 习
input
velocity
vector
Vector2
clamp
asset
stretch
aspect
rendering
grid
Grid Snap
snap
anchor
margin
ratio
Size Flags
项目设置
Display
window
stretch
Mode
2d
Aspect
ignore
keep
Rendering
Quality
2d
Use Pixel Snap
求求你们,点个赞吧QAQ
右上角点赞!
疑问点
子节点与父节点的锚
页边距
收藏
收藏
0 条评论
下一页