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
파일 보기 프로젝트 열기: fmotagarcia/sparrow-sharp

보호된 프로퍼티들

프로퍼티 타입 설명
_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