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

How i changue the mine sprite?
http://px.worms2d.info/forum/viewtopic.php?f=15&t=1984
Page 1 of 1

Author:  Lucho [ Wed Apr 02, 2014 11:45 pm ]
Post subject:  How i changue the mine sprite?

I Need to know how to changue the sprite for mine, pls help

Author:  Lucho [ Thu Apr 03, 2014 3:07 pm ]
Post subject:  Re: How i changue the mine sprite?

This thing doesn't work why?

CSprite* Slime_aiming; // 1. rename as "YOUR_WEAP_aiming"

void Slime_spb::InitGraphic() // name of your sript in LibEditor
{ CFile* f; //
f = GetAttachment("slime.png"); // 3. (replace with your attached png of aiming sprite)
skipper_aiming = LoadSprite(f, 3, 3); // 4. (replace with variable from 1.)
} //
//
override void CTurnGame::Message(CObject* sender,EMType Type,int MSize,CMessageData* MData) {
super; //
if (Type == M_FRAME) { //
if (gframe == 1) { //
local weapName; local sprite;

CWormAnimParams* Params = new CWormAnimParams;
weapName = "Slime"; // 7. weap name: EXACT weap name.
sprite = Slime_aiming->Index; // 8. (replace with variable from 1.)
Params->hand_radius = -13.0;
Params->animate = true;
Params->hand_rotation = -0.0; // 10. rotate worm`s hand, if u need: -1.0...1.0;
Params->hand_radial_rotation = 0.0;
Params->weap_radial_rotation = 0.0;
Params->weap_rotation = 0.5;
Params->weap_radius = -11.5;
Params->hand_type = 1; // 1 = lower hand. 2 = normal hand. 3 - upper hand.
Params->hand_scale = 1.1;
Params->dont_rotate_with_angle = true;
Params->ang_if_static = 0.0;
Params->hand_ang_if_static = 0.4;

local WA = new WormSprite(weapName, sprite, Params);
}
}
}

And The sprite
Image

Author:  Curtis [ Mon May 05, 2014 2:23 am ]
Post subject:  Re: How i changue the mine sprite?

Hello again Lucho.....

I made this lib a long time ago and it should help you change your mine sprites....The lib sets all mine sprites to the blue and red targets and can only detonate with longbow arrows.....it's actually pretty sweet....It's also got MapEd support so you can rig the level beforehand with targets.

Author:  PyroMan [ Thu May 22, 2014 9:13 pm ]
Post subject:  Re: How i changue the mine sprite?

Lucho wrote:
I Need to know how to changue the sprite for mine, pls help

here is couple mistakes i found after reading your message (very fast genearl looked, but..)
so..
1. f = GetAttachment("slime.png");
- but name of attached file is "duse.png", isn`t?
2. skipper_aiming = LoadSprite(f, 3, 3);
written wrong.
should be:
- skipper_aiming = LoadSprite(f, 3, 0);
3. Make sure that your png is "saved as" in photoshop, with full range of colors. I mean not "published for web" with limited colors. In second case it will not work.

good luck.

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