C# 클래스 TexLib.TextureFont

파일 보기 프로젝트 열기: LukaHorvat/Kento

공개 프로퍼티들

프로퍼티 타입 설명
AdvanceWidth double
CharacterBoundingBoxHeight double
CharacterBoundingBoxWidth double

공개 메소드들

메소드 설명
ComputeWidth ( string text ) : double

Computes the expected width of text string given. The height is always 1.0. Model space coordinates.

TextureFont ( int textureId ) : System.Diagnostics

Create a TextureFont object. The sent-in textureId should refer to a texture bitmap containing a 16x16 grid of fixed-width characters, representing the ASCII table. A 32 bit texture is assumed, aswell as all GL state necessary to turn on texturing. The dimension of the texture bitmap may be anything from 128x128 to 512x256 or any other order-by-two-squared-dimensions.

WriteString ( string text ) : void

Draw an ASCII string around coordinate (0,0,0) in the XY-plane of the model space coordinate system. The height of the text is 1.0. The width may be computed by calling ComputeWidth(string). This call modifies the currently bound 2D-texture, but no other GL state.

WriteStringAt ( string text, double heightPercent, double xPercent, double yPercent, double degreesCounterClockwise ) : void

This is a convenience function to write a text string using a simple coordinate system defined to be 0..100 in x and 0..100 in y. For example, writing the text at 50,50 means it will be centered onscreen. The height is given in percent of the height of the viewport. No GL state except the currently bound texture is modified. This method is not as flexible nor as fast as the WriteString() method, but it is easier to use.

비공개 메소드들

메소드 설명
ComputeAspectRatio ( ) : double
WriteCharacter ( char ch, double xpos ) : void

메소드 상세

ComputeWidth() 공개 메소드

Computes the expected width of text string given. The height is always 1.0. Model space coordinates.
public ComputeWidth ( string text ) : double
text string
리턴 double

TextureFont() 공개 메소드

Create a TextureFont object. The sent-in textureId should refer to a texture bitmap containing a 16x16 grid of fixed-width characters, representing the ASCII table. A 32 bit texture is assumed, aswell as all GL state necessary to turn on texturing. The dimension of the texture bitmap may be anything from 128x128 to 512x256 or any other order-by-two-squared-dimensions.
public TextureFont ( int textureId ) : System.Diagnostics
textureId int
리턴 System.Diagnostics

WriteString() 공개 메소드

Draw an ASCII string around coordinate (0,0,0) in the XY-plane of the model space coordinate system. The height of the text is 1.0. The width may be computed by calling ComputeWidth(string). This call modifies the currently bound 2D-texture, but no other GL state.
public WriteString ( string text ) : void
text string
리턴 void

WriteStringAt() 공개 메소드

This is a convenience function to write a text string using a simple coordinate system defined to be 0..100 in x and 0..100 in y. For example, writing the text at 50,50 means it will be centered onscreen. The height is given in percent of the height of the viewport. No GL state except the currently bound texture is modified. This method is not as flexible nor as fast as the WriteString() method, but it is easier to use.
public WriteStringAt ( string text, double heightPercent, double xPercent, double yPercent, double degreesCounterClockwise ) : void
text string
heightPercent double
xPercent double
yPercent double
degreesCounterClockwise double
리턴 void

프로퍼티 상세

AdvanceWidth 공개적으로 프로퍼티

Determines the distance from character center to adjacent character center, horizontally, in one written text string. Model space coordinates.
public double AdvanceWidth
리턴 double

CharacterBoundingBoxHeight 공개적으로 프로퍼티

Determines the height of the cut-out to do for each character when rendering. This is necessary to avoid artefacts stemming from filtering (zooming/rotating). Make sure your font contains some "white space" around each character so they won't be clipped due to this!
public double CharacterBoundingBoxHeight
리턴 double

CharacterBoundingBoxWidth 공개적으로 프로퍼티

Determines the width of the cut-out to do for each character when rendering. This is necessary to avoid artefacts stemming from filtering (zooming/rotating). Make sure your font contains some "white space" around each character so they won't be clipped due to this!
public double CharacterBoundingBoxWidth
리턴 double