Spherical forums

Sphere Development => Sphere Support => Spriteset Support => Topic started by: mezzoEmrys on September 06, 2013, 12:57:11 am

Title: Multi-Piece and Masking on Spriteset?
Post by: mezzoEmrys on September 06, 2013, 12:57:11 am
As part of my current project I am implementing a character customization system which allows players to pick their skin and hair color, and possibly hair style. So far I have been glad to find the SetPersonMask option, but as I have been planning out the customization system I have encountered a problem.

Would it be possible for me to create a single spriteset, with no mask, from multiple spritesets that are masked? If so, how would I do that, and what kind of things would I need to set up?
Title: Re: Multi-Piece and Masking on Spriteset?
Post by: Flying Jester on September 06, 2013, 01:45:07 am
If I understand correctly, you could using something like this (needs to be adapted for exactly what you are doing).

Code: (javascript) [Select]

var ss = LoadSpriteset("some_spriteset.rss");
var newss = CreateSpriteset(ss.images[0].width, ss.images[0].height, num_images, ss.directions.length, num_frames): //num_frames and num_images will depend on the spritesets to be combined.
for(var i = 0; i<newss.images.length; i++){
  newss.images[i] = ss.images[i] //also take from the other spritesets
}


The wiki has definitions for these functions (http://wiki.spheredev.org/API:Functions#Spritesets).
Title: Re: Multi-Piece and Masking on Spriteset?
Post by: N E O on September 06, 2013, 04:19:26 pm
FBNil once had a demo of just such functionality (I think it was called "Spriteset Factory" or something similar). Now if we only had it in the Downloads Repo...

Edit: OH MY MOUSTACHE, FBN'S SITE IS SHOCKINGLY STILL UP (http://members.chello.nl/n.castillox/chibitutorials/). It keeps going down and up too randomly. I was close, it's called SpriteFactory (http://members.chello.nl/n.castillox/chibitutorials/data/TechDemo_SpriteFactory.zip).
Title: Re: Multi-Piece and Masking on Spriteset?
Post by: mezzoEmrys on September 06, 2013, 05:39:11 pm
By Merlin's Beard, I can't believe we can still get at that stuff! To the repo with it!
Title: Re: Multi-Piece and Masking on Spriteset?
Post by: DaVince on September 07, 2013, 04:34:18 am
Fantastic. Downloaded these and putting them on the drive (under the tech demos, tutorials, libraries and unfinished games directories).