C# 클래스 Axiom.Samples.MousePicking.SelectionRectangle

상속: ManualObject
파일 보기 프로젝트 열기: WolfgangSt/axiom 1 사용 예제들

공개 메소드들

메소드 설명
SelectionRectangle ( string name ) : System

There are two ways to create your own mesh within Axiom. The first way is to subclass the SimpleRenderable object and provide it with the vertex and index buffers directly. This is the most direct way to create one, but it's also the most cryptic. The Generating A Mesh code snippet shows an example of this. To make things easier, Axiom provides a much nicer interface called ManualObject, which allows you to use some simple functions to define a mesh instead of writing raw data to the buffer objects. Instead of dropping the position, color, and so on into a buffer, you simply call the "position" and "colour" functions. In this tutorial we need to create a white rectangle to display when we are dragging the mouse to select objects. There really isn't a class in Axiom we could use to display a 2D rectangle. We will have to come up with a way of doing it on our own. We could use an Overlay and resize it to display the selection rectangle, but the problem with doing it this way is that the image you use for the selection rectangle could get stretched out of shape and look awkward. Instead, we will generate a very simple 2D mesh to act as our selection rectangle.

SetCorners ( Axiom.Math topLeft, Axiom.Math bottomRight ) : void

SetCorners ( float left, float top, float right, float bottom ) : void

Sets the corners of the SelectionRectangle. Every parameter should be in the range [0, 1] representing a percentage of the screen the SelectionRectangle should take up.

메소드 상세

SelectionRectangle() 공개 메소드

There are two ways to create your own mesh within Axiom. The first way is to subclass the SimpleRenderable object and provide it with the vertex and index buffers directly. This is the most direct way to create one, but it's also the most cryptic. The Generating A Mesh code snippet shows an example of this. To make things easier, Axiom provides a much nicer interface called ManualObject, which allows you to use some simple functions to define a mesh instead of writing raw data to the buffer objects. Instead of dropping the position, color, and so on into a buffer, you simply call the "position" and "colour" functions. In this tutorial we need to create a white rectangle to display when we are dragging the mouse to select objects. There really isn't a class in Axiom we could use to display a 2D rectangle. We will have to come up with a way of doing it on our own. We could use an Overlay and resize it to display the selection rectangle, but the problem with doing it this way is that the image you use for the selection rectangle could get stretched out of shape and look awkward. Instead, we will generate a very simple 2D mesh to act as our selection rectangle.
public SelectionRectangle ( string name ) : System
name string
리턴 System

SetCorners() 공개 메소드

public SetCorners ( Axiom.Math topLeft, Axiom.Math bottomRight ) : void
topLeft Axiom.Math
bottomRight Axiom.Math
리턴 void

SetCorners() 공개 메소드

Sets the corners of the SelectionRectangle. Every parameter should be in the range [0, 1] representing a percentage of the screen the SelectionRectangle should take up.
public SetCorners ( float left, float top, float right, float bottom ) : void
left float
top float
right float
bottom float
리턴 void