Results 1 to 3 of 3

Thread: sprite constructor

  1. #1

    Default sprite constructor

    in the example spriteRTS are new objects created with tho following code

    Missile::Missile(World *world, GameObject *_owner)
    : GameObject(world)
    	spriteMissile = new CL_Sprite("SpaceShootMissile", world->resources);
    	spriteExplosion = new CL_Sprite("Explosion", world->resources);
    	sound = new CL_SoundBuffer("MissileHit", world->resources);
    	collisionMissile = new CL_CollisionOutline("Gfx/spaceshoot_missile.png");
    	sprite = spriteMissile;
    	hidden = false;
    	exploding = false;
    	owner = _owner;
    My question is now, how the new sprites are created. Do all sprites with the same resource path have a pointer to the same databits, or do all instances of the Sprite have own image memory?

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006


    The sprite image data is shared between all sprite objects constructed from the same resource manager with the same resource id.

  3. #3


    ok, thank you for your answer

Similar Threads

  1. Creation of CollisionOutline by using a Resource/Sprite
    By Nipsky in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 09-22-2007, 10:08 PM
  2. Sprite patch for 0.8
    By Trigve in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 07-19-2007, 12:41 AM
  3. Custom resource combined with sprite
    By tompawarrior in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 07-17-2007, 05:30 PM
  4. Green border around rotated sprite on ATI cards - Solved!
    By pTymN in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 11-06-2006, 08:44 PM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts