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.

PointLight2D

繼承: Light2D < Node2D < CanvasItem < Node < Object

位置性 2D 光源。

說明

在 2D 環境中投射光線。此燈的形狀由(通常為灰度)紋理定義。

教學

屬性

float

height

0.0

Vector2

offset

Vector2(0, 0)

Texture2D

texture

float

texture_scale

1.0


屬性說明

float height = 0.0 🔗

  • void set_height(value: float)

  • float get_height()

燈光的高度。與 2D 法線貼圖一起使用。單位為圖元,例如:如果高度為 100,那麼它能夠照亮 100 圖元遠且與該平面成 45° 角的對象。


Vector2 offset = Vector2(0, 0) 🔗

  • void set_texture_offset(value: Vector2)

  • Vector2 get_texture_offset()

燈光的 texture 的偏移量。


Texture2D texture 🔗

用於該燈光外觀的 Texture2D


float texture_scale = 1.0 🔗

  • void set_texture_scale(value: float)

  • float get_texture_scale()

texture 的縮放係數。