Indigo

Indigo

  • Blog
  • Guides
  • Docs
  • APIs
  • Tools
  • GitHub

›Presentation

Indigo

  • Indigo's Development Status

Getting started

  • Setup & Configuration
  • Hello, Indigo!
  • Examples
  • Mill & SBT Game Templates

Organising your game

  • Boot & Start Up
  • Game Entry Points
  • Scenes & Scene Management
  • SubSystems

The game loop

  • Events
  • Frame context
  • Outcome Type

Presentation

  • Animation
  • Audio
  • Boundaries
  • Cameras
  • Clones & Mutants
  • Depth
  • Layers
  • Lighting
  • Materials
  • Primitives & Building Blocks
  • SceneUpdateFragment
  • Shapes
  • Text & Fonts

UI Components

  • Overview
  • Buttons
  • Hit Area
  • Input Field
  • Radio Button

Shaders

  • Shaders Overview
  • Shader Constants, Variables, and Outputs
  • Blending
  • Premultiplied Alpha

Working with Time

  • Signals & Signal Functions
  • Time Varying Values

Platform & Publishing

  • Assets & Asset Loading
  • Cross Platform Publishing
  • File Format Importers
  • User Input Handling
  • Loading & Saving Data
  • Logging
  • Networking

Other information

  • Alternatives to Indigo
  • Glossary
  • Key Concepts
  • Model, ViewModel, & View
  • Anti-Patterns
  • Motivation & Constraints
  • Performance
  • Prior Art
  • Rendering Technology

Shapes

Shapes allow you to draw simple graphics without needing images.

There are four Shape types that come shipped with Indigo at the time of writing, although we may add more in the future:

  1. Shape.Box - Any rectangle
  2. Shape.Circle - A circle centered around a point
  3. Shape.Line - A straight line made of two points
  4. Shape.Polygon - An arbitrary shape with up to 16 vertices.

They all share similar properties:

  • They can all (aside from Line) have a Fill that is solid color or a linear or radial gradient.
  • They can all have a Stroke applied to them with color and thickness.
  • They can all be transformed in the usual ways
  • They can all receive simple lighting effects (no normal mapping)

One limitation that shape strokes have, is that they are all solid and all use rounded corners. This is because of the way they are calculated. If there is interest we may look at adding more stroke effects like dashed lines or alternate capping types.

Below are examples of each to help get you started.

Box

import indigo.*

Shape.Box(
  Rectangle(Point(100, 100), Size(50, 50)),
  Fill.Color(RGBA.White),
  Stroke(4, RGBA.Blue)
)

Circle

Shape.Circle(
  center = Point(30, 30),
  radius = 20,
  fill = Fill.RadialGradient(
    Point(20),
    RGBA.Magenta,
    Point.zero,
    RGBA.Cyan
  ),
  stroke = Stroke(3, RGBA.White)
)

Line

Shape.Line(Point(30, 80), Point(100, 20), Stroke(6, RGBA.Cyan))

Polygon

Shape.Polygon(
  Fill.LinearGradient(Point(0), RGBA.Magenta, Point(45), RGBA.Cyan),
  Stroke(4, RGBA.Black)
)(
  Point(10, 10),
  Point(20, 70),
  Point(90, 90),
  Point(70, 20)
)
← SceneUpdateFragmentText & Fonts →
  • Box
  • Circle
  • Line
  • Polygon
Indigo
Getting Started
Setup & Configuration Guide"Hello, Indigo!" TutorialLinks to examplesProject templates
Community
DiscordGitHub DiscussonsTwitter
Sponsor us!
GitHub SponsorsPatreon