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) 🔗

该矩形的宽度和高度。