C# Класс Sparrow.Display.Quad

An Quad represents a rectangle with a uniform color or a color gradient.

You can set one color per vertex. The colors will smoothly fade into each other over the area of the quad. To display a simple linear color gradient, assign one color to vertices 0 and 1 and another color to vertices 2 and 3.

The indices of the vertices are arranged like this:

0 - 1

| / |

2 - 3

**Colors**

Colors in Sparrow are defined as unsigned integers, that's exactly 8 bit per color. The easiest way to define a color is by writing it as a hexadecimal number. A color has the following structure:

0xRRGGBB

That means that you can create the base colors like this:

0xFF0000 -> red

0x00FF00 -> green

0x0000FF -> blue

Наследование: DisplayObject
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
_color uint
_vertexData Sparrow.Utils.VertexData

Открытые методы

Метод Описание
BoundsInSpace ( DisplayObject targetSpace ) : Rectangle
Quad ( float width = 32, float height = 32, uint color = 0xffffff, bool premultipliedAlpha = false ) : Sparrow.Core

Initializes a quad with a certain size and color. The 'premultipliedAlpha' parameter indicates how the colors of the object are stored.

Render ( RenderSupport support ) : void

Защищенные методы

Метод Описание
Init ( float width = 32, float height = 32, uint color = 0xffffff, bool premultipliedAlpha = false ) : void
VertexDataDidChange ( ) : void

Приватные методы

Метод Описание
CopyVertexDataTo ( VertexData targetData, int atIndex, bool copyColor ) : void

Описание методов

BoundsInSpace() публичный Метод

public BoundsInSpace ( DisplayObject targetSpace ) : Rectangle
targetSpace DisplayObject
Результат Sparrow.Geom.Rectangle

Init() защищенный Метод

protected Init ( float width = 32, float height = 32, uint color = 0xffffff, bool premultipliedAlpha = false ) : void
width float
height float
color uint
premultipliedAlpha bool
Результат void

Quad() публичный Метод

Initializes a quad with a certain size and color. The 'premultipliedAlpha' parameter indicates how the colors of the object are stored.
public Quad ( float width = 32, float height = 32, uint color = 0xffffff, bool premultipliedAlpha = false ) : Sparrow.Core
width float
height float
color uint
premultipliedAlpha bool
Результат Sparrow.Core

Render() публичный Метод

public Render ( RenderSupport support ) : void
support Sparrow.Core.RenderSupport
Результат void

VertexDataDidChange() защищенный Метод

protected VertexDataDidChange ( ) : void
Результат void

Описание свойств

_color защищенное свойство

protected uint _color
Результат uint

_vertexData защищенное свойство

protected VertexData,Sparrow.Utils _vertexData
Результат Sparrow.Utils.VertexData