public SpriteSheetAnimation(SpriteSheet spriteSheet, uint fromID, uint toID, float animationLength)
 {
     this.spriteSheet = spriteSheet;
     this.FromID = fromID;
     this.ToID = toID;
     this.AnimationLength = animationLength;
 }
예제 #2
0
 /// <summary>
 /// Create a new font that can be printed in OpenGL
 /// </summary>
 /// <param name="texture">texture containing a equally spaced grid of characters</param>
 /// <param name="charactersPerLine">number of characters per grid row</param>
 /// <param name="firstAsciiCode">ascii code of upper left most character in the grid</param>
 /// <param name="characterBoundingBoxWidth">bounding box width of each character cell, allows to zoom in/out of each character</param>
 /// <param name="characterBoundingBoxHeight">bounding box height of each character cell, allows to zoom in/out of each character</param>
 /// <param name="characterSpacing">how much to move to the right after drawing a single character</param>
 public TextureFont(Texture texture, uint charactersPerLine = 16, byte firstAsciiCode = 0
     , float characterBoundingBoxWidth = 1.0f, float characterBoundingBoxHeight = 1.0f, float characterSpacing = 1.0f)
 {
     this.texFont = new SpriteSheet(texture, charactersPerLine, characterBoundingBoxWidth, characterBoundingBoxHeight);
     // Creating 256 Display Lists
     this.baseList = (uint)GL.GenLists(256);
     //foreach of the 256 possible characters create a a quad
     //with texture coordinates and store it in a display list
     var rect = new Box2D(0, 0, 1, 1);
     for (uint asciiCode = 0; asciiCode < 256; ++asciiCode)
     {
         GL.NewList((this.baseList + asciiCode), ListMode.Compile);
         texFont.Draw(asciiCode - firstAsciiCode, rect);
         GL.Translate(characterSpacing, 0, 0);	// Move To The next character
         GL.EndList();
     }
 }
예제 #3
0
 public Visual()
 {
     //this.spriteSheet = new SpriteSheet(TextureLoader.FromBitmap(Resourcen.skin36), 4, 0.98f, 0.97f);
     this.spriteSheet = new SpriteSheet(TextureLoader.FromBitmap(Resourcen.borgar), 4, 0.95f, 0.95f);
 }