Finished the basics of the npc renderer. I have included the base art assets for generating a female npc and polished off all of the code. Base goal achived.
|
@ -36,6 +36,9 @@ namespace CustomNPCFramework
|
|||
///
|
||||
/// Load in the assets and go go go.
|
||||
/// -Collect a bunch of assets together to test this thing.
|
||||
///
|
||||
/// Fix modular npc breathing.
|
||||
/// Find way to make sideways shirts render correctly.
|
||||
/// </summary>
|
||||
|
||||
|
||||
|
@ -69,7 +72,7 @@ namespace CustomNPCFramework
|
|||
|
||||
public void initializeAssetPool()
|
||||
{
|
||||
string path = Path.Combine(ModHelper.DirectoryPath, "Content", "Graphics", "NPCS", "Characters", "RainMan");
|
||||
string path = Path.Combine(ModHelper.DirectoryPath, "Content", "Graphics", "NPCS");
|
||||
assetPool.getAssetManager("testNPC").addPathCreateDirectory(new KeyValuePair<string, string>("characters", path));
|
||||
}
|
||||
|
||||
|
@ -117,7 +120,7 @@ namespace CustomNPCFramework
|
|||
|
||||
public void initializeExamples()
|
||||
{
|
||||
|
||||
return;
|
||||
string dirPath = Path.Combine(ModHelper.DirectoryPath, "Content", "Templates");
|
||||
var aManager=assetPool.getAssetManager("testNPC");
|
||||
aManager.addPathCreateDirectory(new KeyValuePair<string, string>("templates", dirPath));
|
||||
|
|
|
@ -280,7 +280,7 @@ namespace CustomNPCFramework.Framework.Graphics
|
|||
bodySheet = bodyList.ElementAt(bodyIndex);
|
||||
eyesSheet = eyesList.ElementAt(eyesIndex);
|
||||
hairSheet = hairList.ElementAt(hairIndex);
|
||||
shirtSheet = eyesList.ElementAt(shirtIndex);
|
||||
shirtSheet = shirtList.ElementAt(shirtIndex);
|
||||
pantsSheet = pantsList.ElementAt(pantsIndex);
|
||||
shoesSheet = shoesList.ElementAt(shoesIndex);
|
||||
|
||||
|
|
|
@ -179,17 +179,19 @@ namespace CustomNPCFramework.Framework.ModularNPCS.CharacterAnimationBases
|
|||
/// <param name="layerDepth"></param>
|
||||
public override void draw(SpriteBatch b, ExtendedNPC npc, Vector2 position, Rectangle sourceRectangle, Color color, float alpha, Vector2 origin, float scale, SpriteEffects effects, float layerDepth)
|
||||
{
|
||||
Class1.ModMonitor.Log(sourceRectangle.ToString());
|
||||
Vector2 generalOffset = new Vector2(0, 1*Game1.tileSize);
|
||||
this.body.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth);
|
||||
this.hair.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth);
|
||||
this.eyes.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth);
|
||||
this.shirt.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth);
|
||||
this.pants.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth);
|
||||
this.shoes.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth);
|
||||
//Class1.ModMonitor.Log(sourceRectangle.ToString());
|
||||
Vector2 generalOffset = new Vector2(0, 1*Game1.tileSize); //Puts the sprite at the correct positioning.
|
||||
float smallOffset = 0.001f;
|
||||
float tinyOffset = 0.0001f;
|
||||
this.body.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth + smallOffset);
|
||||
this.eyes.draw(b, npc, position - generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth + smallOffset+(tinyOffset *1));
|
||||
this.hair.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth + smallOffset+(tinyOffset *2));
|
||||
this.shirt.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth + smallOffset+(tinyOffset*3));
|
||||
this.pants.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth + smallOffset+(tinyOffset*4));
|
||||
this.shoes.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth + smallOffset+(tinyOffset*5));
|
||||
foreach(var accessory in this.accessories)
|
||||
{
|
||||
accessory.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth);
|
||||
accessory.draw(b, npc, position-generalOffset, sourceRectangle, color, alpha, origin, scale, effects, layerDepth +0.0006f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
After Width: | Height: | Size: 330 B |
After Width: | Height: | Size: 302 B |
After Width: | Height: | Size: 569 B |
After Width: | Height: | Size: 540 B |
After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 520 B |
After Width: | Height: | Size: 305 B |
After Width: | Height: | Size: 330 B |
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"gender": 1,
|
||||
"seasons": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
],
|
||||
"type": 0,
|
||||
"assetName": "VanillaFemaleBodyBase",
|
||||
"standingAssetPaths": {
|
||||
"leftString": "FBodyBaseLeft",
|
||||
"rightString": "FBodyBaseRight",
|
||||
"upString": "FBodyBaseUp",
|
||||
"downString": "FBodyBaseDown"
|
||||
},
|
||||
"swimmingAssetPaths": {
|
||||
"leftString": "FBodyBaseLeft",
|
||||
"rightString": "FBodyBaseRight",
|
||||
"upString": "FBodyBaseUp",
|
||||
"downString": "FBodyBaseDown"
|
||||
},
|
||||
"movingAssetPaths": {
|
||||
"leftString": "FBodyBaseLeft",
|
||||
"rightString": "FBodyBaseRight",
|
||||
"upString": "FBodyBaseUp",
|
||||
"downString": "FBodyBaseDown"
|
||||
},
|
||||
"sittingAssetPaths": {
|
||||
"leftString": "FBodyBaseLeft",
|
||||
"rightString": "FBodyBaseRight",
|
||||
"upString": "FBodyBaseUp",
|
||||
"downString": "FBodyBaseDown"
|
||||
},
|
||||
"assetSize": "16, 32",
|
||||
"randomizeUponLoad": false
|
||||
}
|
After Width: | Height: | Size: 293 B |
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"gender": 1,
|
||||
"seasons": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
],
|
||||
"type": 4,
|
||||
"assetName": "VanillaGreyPants",
|
||||
"standingAssetPaths": {
|
||||
"leftString": "LeftFacing",
|
||||
"rightString": "RightFacing",
|
||||
"upString": "UpFacing",
|
||||
"downString": "DownFacing"
|
||||
},
|
||||
"swimmingAssetPaths": {
|
||||
"leftString": "LeftFacing",
|
||||
"rightString": "RightFacing",
|
||||
"upString": "UpFacing",
|
||||
"downString": "DownFacing"
|
||||
},
|
||||
"movingAssetPaths": {
|
||||
"leftString": "LeftFacing",
|
||||
"rightString": "RightFacing",
|
||||
"upString": "UpFacing",
|
||||
"downString": "DownFacing"
|
||||
},
|
||||
"sittingAssetPaths": {
|
||||
"leftString": "LeftFacing",
|
||||
"rightString": "RightFacing",
|
||||
"upString": "UpFacing",
|
||||
"downString": "DownFacing"
|
||||
},
|
||||
"assetSize": "16, 32",
|
||||
"randomizeUponLoad": false
|
||||
}
|
After Width: | Height: | Size: 269 B |
After Width: | Height: | Size: 264 B |
After Width: | Height: | Size: 289 B |
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"gender": 1,
|
||||
"seasons": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
],
|
||||
"type": 1,
|
||||
"assetName": "VanillaBrownEyes",
|
||||
"standingAssetPaths": {
|
||||
"leftString": "EyesLeft",
|
||||
"rightString": "EyesRight",
|
||||
"upString": "EyesUp",
|
||||
"downString": "EyesDown"
|
||||
},
|
||||
"swimmingAssetPaths": {
|
||||
"leftString": "EyesLeft",
|
||||
"rightString": "EyesRight",
|
||||
"upString": "EyesUp",
|
||||
"downString": "EyesDown"
|
||||
},
|
||||
"movingAssetPaths": {
|
||||
"leftString": "EyesLeft",
|
||||
"rightString": "EyesRight",
|
||||
"upString": "EyesUp",
|
||||
"downString": "EyesDown"
|
||||
},
|
||||
"sittingAssetPaths": {
|
||||
"leftString": "EyesLeft",
|
||||
"rightString": "EyesRight",
|
||||
"upString": "EyesUp",
|
||||
"downString": "EyesDown"
|
||||
},
|
||||
"assetSize": "16, 32",
|
||||
"randomizeUponLoad": false
|
||||
}
|
After Width: | Height: | Size: 273 B |
After Width: | Height: | Size: 268 B |
After Width: | Height: | Size: 271 B |
After Width: | Height: | Size: 224 B |
After Width: | Height: | Size: 314 B |
After Width: | Height: | Size: 312 B |
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"gender": 1,
|
||||
"seasons": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
],
|
||||
"type": 2,
|
||||
"assetName": "VanillaPigTails",
|
||||
"standingAssetPaths": {
|
||||
"leftString": "LeftHairStyle",
|
||||
"rightString": "RightHairStyle",
|
||||
"upString": "UpHairStyle",
|
||||
"downString": "DownHairStyle"
|
||||
},
|
||||
"swimmingAssetPaths": {
|
||||
"leftString": "LeftHairStyle",
|
||||
"rightString": "RightHairStyle",
|
||||
"upString": "UpHairStyle",
|
||||
"downString": "DownHairStyle"
|
||||
},
|
||||
"movingAssetPaths": {
|
||||
"leftString": "LeftHairStyle",
|
||||
"rightString": "RightHairStyle",
|
||||
"upString": "UpHairStyle",
|
||||
"downString": "DownHairStyle"
|
||||
},
|
||||
"sittingAssetPaths": {
|
||||
"leftString": "LeftHairStyle",
|
||||
"rightString": "RightHairStyle",
|
||||
"upString": "UpHairStyle",
|
||||
"downString": "DownHairStyle"
|
||||
},
|
||||
"assetSize": "16, 32",
|
||||
"randomizeUponLoad": false
|
||||
}
|
After Width: | Height: | Size: 318 B |
After Width: | Height: | Size: 282 B |
|
@ -0,0 +1,2 @@
|
|||
Hairstyles seem to allow for a maximum of three pixels from the adverage top of the hairstyle to the starting of a hairstyle.
|
||||
This allows for things like volume and depth of view for ponytales that rise above the typical height of a head.
|
After Width: | Height: | Size: 326 B |
After Width: | Height: | Size: 305 B |
After Width: | Height: | Size: 299 B |
After Width: | Height: | Size: 306 B |
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"gender": 1,
|
||||
"seasons": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
],
|
||||
"type": 3,
|
||||
"assetName": "VanillaPinkShirt",
|
||||
"standingAssetPaths": {
|
||||
"leftString": "LeftFacing",
|
||||
"rightString": "RightFacing",
|
||||
"upString": "UpFacing",
|
||||
"downString": "DownFacing"
|
||||
},
|
||||
"swimmingAssetPaths": {
|
||||
"leftString": "LeftFacing",
|
||||
"rightString": "RightFacing",
|
||||
"upString": "UpFacing",
|
||||
"downString": "DownFacing"
|
||||
},
|
||||
"movingAssetPaths": {
|
||||
"leftString": "LeftFacing",
|
||||
"rightString": "RightFacing",
|
||||
"upString": "UpFacing",
|
||||
"downString": "DownFacing"
|
||||
},
|
||||
"sittingAssetPaths": {
|
||||
"leftString": "LeftFacing",
|
||||
"rightString": "RightFacing",
|
||||
"upString": "UpFacing",
|
||||
"downString": "DownFacing"
|
||||
},
|
||||
"assetSize": "16, 32",
|
||||
"randomizeUponLoad": false
|
||||
}
|
After Width: | Height: | Size: 341 B |
After Width: | Height: | Size: 297 B |
After Width: | Height: | Size: 395 B |
After Width: | Height: | Size: 273 B |
After Width: | Height: | Size: 388 B |
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 390 B |
After Width: | Height: | Size: 288 B |
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"gender": 1,
|
||||
"seasons": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
],
|
||||
"type": 5,
|
||||
"assetName": "VanillaBrownShoes",
|
||||
"standingAssetPaths": {
|
||||
"leftString": "LeftStanding",
|
||||
"rightString": "RightStanding",
|
||||
"upString": "UpStanding",
|
||||
"downString": "DownStanding"
|
||||
},
|
||||
"swimmingAssetPaths": {
|
||||
"leftString": "LeftStanding",
|
||||
"rightString": "RightStanding",
|
||||
"upString": "UpStanding",
|
||||
"downString": "DownStanding"
|
||||
},
|
||||
"movingAssetPaths": {
|
||||
"leftString": "LeftMoving",
|
||||
"rightString": "RightMoving",
|
||||
"upString": "UpMoving",
|
||||
"downString": "DownMoving"
|
||||
},
|
||||
"sittingAssetPaths": {
|
||||
"leftString": "LeftStanding",
|
||||
"rightString": "RightStanding",
|
||||
"upString": "UpStanding",
|
||||
"downString": "DownStanding"
|
||||
},
|
||||
"assetSize": "16, 32",
|
||||
"randomizeUponLoad": false
|
||||
}
|