Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Primitives2D

An asset by pkish
The page banner background of a mountain and forest
Primitives2D hero image

Quick Information

0 ratings
Primitives2D icon image
pkish
Primitives2D

A plugin for the Godot game engine (version 3.x) for rendering primitive 2d shapes.

Supported Engine Version
4.0
Version String
0.0.2
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Primitives2D

A plugin for the Godot game engine (version 4.x) for rendering primitive 2d shapes.

README Primitives2D

While the CanvasItem class supports a number of methods for rendering primitive shapes, the engine only offers the Line2D and Polygon2D nodes for adding primitive shapes to a scene. This plugin introduces the following node types in a similar fashion:

The nodes simply use the builtin CanvasItem methods for drawing primitive shapes: draw_rect, draw_circle and draw_arc.

Installation

  1. Create an addons directory inside your project directory.
  2. Get the plugin from the AssetLib or from GitHub
    • From the AssetLib: Open the AssetLib from the Godot editor and search for "Primitives2D". Click download to install the plugin.
    • From GitHub: Run git clone https://github.com/peter-kish/primitives2d.git and copy the contents of the addons directory to your projects addons directory.
  3. Enable the plugin in Project Settings > Plugins.

Usage

Add a Rectangle2D, Circle2D or Arc2D node to your scene and set the node properties described below.

Rectangle2D

Draws a 2D rectangle.

Properties

  • color: Color - The color of the rectangle.
  • size: Vector2 - The size of the rectangle.
  • filled: bool - If false, the rectangle will be drawn as a stroke with the color and line_width specified.
  • line_width: float - Width of the stroke (in case filled is true).
  • centered: bool - If true, the rectangle will be drawn centered.

Circle2D

Draws a 2D circle.

Properties

  • color: Color - The color of the circle.
  • radius: float - The radius of the circle.
  • filled: bool - If false, the circle will be drawn as a stroke with the color and line_width specified.
  • line_width: float - Width of the stroke (in case filled is true).
  • antialiased: bool - If true, the lines will attempt to perform antialiasing using OpenGL line smoothing.
  • detail: int - The number of line segments.

Arc2D

Draws a unfilled 2D arc.

Properties

  • color: Color - The color of the arc.
  • radius: float - The radius of the arc.
  • filled: bool - If false, the arc will be drawn as a stroke with the color and line_width specified.
  • line_width: float - Width of the stroke (in case filled is true).
  • antialiased: bool - If true, the lines will attempt to perform antialiasing using OpenGL line smoothing.
  • detail: int - The number of line segments.

A plugin for the Godot game engine (version 3.x) for rendering primitive 2d shapes.

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Primitives2D icon image
pkish
Primitives2D

A plugin for the Godot game engine (version 3.x) for rendering primitive 2d shapes.

Supported Engine Version
4.0
Version String
0.0.2
License Version
MIT
Support Level
community
Modified Date
1 year ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers