Project X Forums
http://px.worms2d.info/forum/

[SOLVED] SetSpriteOverride doesn't work
http://px.worms2d.info/forum/viewtopic.php?f=16&t=356
Page 1 of 1

Author:  StepS [ Tue Sep 27, 2011 1:13 pm ]
Post subject:  [SOLVED] SetSpriteOverride doesn't work

Me, Undefined and Zed have examined the new EAX function called "SetSpriteOverride" and concluded that it doesn't work. I think that InitGraphic is the right place to put it, but however there is no sprite in game (blank), and no error is given too. Any solutions or tips?

EDIT: my fault. Nevermind :oops:

Author:  Entuser [ Tue Sep 27, 2011 3:41 pm ]
Post subject:  Re: SetSpriteOverride doesn't work

Post code, i've tested that function before uploading the update, it worked..

Author:  Undefined [ Tue Sep 27, 2011 5:00 pm ]
Post subject:  Re: SetSpriteOverride doesn't work

Code:
CSprite* sprite;

void nameofyourscript::InitGraphic()
{
        CFile *f;
   f = GetAttachment("zomgpnglol.png");
   sprite = LoadSprite(f, 0, 1); // 0, 1 OR 1, 0 ? :<
        SetSpriteOverride(1, sprite);
}


Author:  Entuser [ Tue Sep 27, 2011 5:29 pm ]
Post subject:  Re: SetSpriteOverride doesn't work

Are you sure that "nameofyourscript" is actual name of the script and zomgpnglol.png is valid PNG?

Author:  StepS [ Tue Sep 27, 2011 5:48 pm ]
Post subject:  Re: SetSpriteOverride doesn't work

Entuser wrote:
Are you sure that "nameofyourscript" is actual name of the script and zomgpnglol.png is valid PNG?

yes, of course, the script itself is fine here (the above is just the template).
I have used it on the canister's sprite with 125 frames, if you need.

EDIT: I'm sorry, it's actually working. I was looking at the wrong sprite.
Please close the thread :oops:

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/