rigz.singlesurface: Functions Types Modinfo Source  

Single Surface mod

Most of the credit For this goes To indiepath from Blitzmax forums. I changed a few things And made it work with the DX9 Mod by Dstastny Its questionable how much faster this makes things, but it might make improvements on slower cards, and it doesn't seem to slow down faster ones so... This depends on DStastny's DX9 mod. If you don't have that and don't want to use it then rem out where marked below.

Functions Summary

DrawSprite Draw a tAnimImage to the screen.
LoadSprite Load an image and store it as a tAnimImage.

Types Summary

TAnimImage Type for creating single surface animations.

Functions

Function DrawSprite(sprite:TAnimImage, x:Float, y:Float, frame:Int = 0)
DescriptionDraw a tAnimImage to the screen.
Information

Very similar to BRL's DrawImage except of course it draws a tAnimImage.

Parametres:

  • sprite: The tAnimImage that you want to draw
  • x: The horizontal location that you want to draw to.
  • y: The vertical location that you want to draw to.
  • frame: The frame of the animation that you want to draw. The frame index starts from 0.

Function LoadSprite:TAnimImage(url:Object, width:Float = 0, height:Float = 0, frames:Int = 1, FindRadius:Int = False)
DescriptionLoad an image and store it as a tAnimImage.
Information

Very similar to BRL's loadanimimage except of course it returns a tAnimImage.

Parametres:

  • url: The path or stream to your image.
  • width: The width of each frame of animation.
  • height: The height of each frame of animation.
  • frames: The number of frames of the aniamtion. If you're loading a single frame image then you can omit this

Types

Type TAnimImage
DescriptionType for creating single surface animations.
InformationThis type replaces the usual drawimage with one that lets you draw animations using a single surface. Its questionable how much faster this makes things, but it might make improvements on slower cards, and it doesn't seem to slow down faster ones so. You can use the helper functions LoadSprite and DrawSprite to create and draw your images.

Module Information

AuthorTim Fisher (Indiepath) Modified by Peter Rigby
PurposeSingle surface image drawing when using animated images
Versionv1