Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

RectangleShape2D

繼承: Shape2D < Resource < RefCounted < Object

2D 矩形,旨在用於物理學。

說明

2D 矩形,旨在用於物理學。通常用於為 CollisionShape2D 提供形狀。

性能:RectangleShape2D 可以快速偵測碰撞。比 CapsuleShape2D 快,但比 CircleShape2D 慢。

教學

屬性

Vector2

size

Vector2(20, 20)


屬性說明

Vector2 size = Vector2(20, 20) 🔗

該矩形的寬度和高度。