AGK for Pascal
ContentsIndexHome
PreviousUpNext
TAgkSprite.Create Constructor (TAgkObject, String)

Creates a sprite with an image from a file to use when rendering.

Syntax
Pascal
constructor Create(const Owner: TAgkObject; const ImageFilename: String); overload;
Parameters 
Description 
const Owner: TAgkObject 
the owner of the new sprite (eg. a TAgkScene object). 
const ImageFilename: String 
the name of the image file to use for the sprite. 

By default image sprites are created with transparency set to tmAlphaTransparency, a depth of 10, are sized using the given image as a guide, and positioned at 0,0 using their top left corner. 

If you use the same image for multiple sprites, then you should create a TAgkImage object and pass that object to another TAgkSprite.Create constructor instead. This significantly reduces memory my not loading the same image multiple times.

Copyright (c) 2012. All rights reserved.