Godot Nature of Code  1.2.0
Nature of Code implemented in Godot Engine
Public Member Functions | Public Attributes | Properties | List of all members
Physics.SimpleBox Class Reference

Simple physics box. More...

Inherits RigidBody2D.

Inherited by Examples.Chapter5.C5Exercise7.CarBase.

Public Member Functions

 SimpleBox ()
 Create a simple box. More...
 

Public Attributes

float OutlineWidth = 2
 Outline width More...
 
Color OutlineColor = Colors.LightBlue
 Outline color More...
 
Color BaseColor = Colors.White
 Base color More...
 

Properties

Vector2 BodySize [get, set]
 Mesh size More...
 

Detailed Description

Simple physics box.

Definition at line 8 of file SimpleBox.cs.

Constructor & Destructor Documentation

◆ SimpleBox()

Physics.SimpleBox.SimpleBox ( )
inline

Create a simple box.

Definition at line 35 of file SimpleBox.cs.

36  {
37  rectangleShape2D = new RectangleShape2D() { Extents = new Vector2(10, 10) };
38  collisionShape2D = new CollisionShape2D() { Shape = rectangleShape2D };
39  }

Member Data Documentation

◆ BaseColor

Color Physics.SimpleBox.BaseColor = Colors.White

Base color

Definition at line 17 of file SimpleBox.cs.

◆ OutlineColor

Color Physics.SimpleBox.OutlineColor = Colors.LightBlue

Outline color

Definition at line 14 of file SimpleBox.cs.

◆ OutlineWidth

float Physics.SimpleBox.OutlineWidth = 2

Outline width

Definition at line 11 of file SimpleBox.cs.

Property Documentation

◆ BodySize

Vector2 Physics.SimpleBox.BodySize
getset

Mesh size

Definition at line 20 of file SimpleBox.cs.

21  {
22  get => rectangleShape2D.Extents * 2;
23  set
24  {
25  rectangleShape2D.Extents = value / 2;
26  }
27  }

The documentation for this class was generated from the following file: