Skip to main content


Topic: Multi-Piece and Masking on Spriteset? (Read 3350 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
Multi-Piece and Masking on Spriteset?
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?
  • Last Edit: September 06, 2013, 01:09:39 am by mezzoEmrys

Re: Multi-Piece and Masking on Spriteset?
Reply #1
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.

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: Multi-Piece and Masking on Spriteset?
Reply #2
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. It keeps going down and up too randomly. I was close, it's called SpriteFactory.
  • Last Edit: September 06, 2013, 04:22:49 pm by N E O

Re: Multi-Piece and Masking on Spriteset?
Reply #3
By Merlin's Beard, I can't believe we can still get at that stuff! To the repo with it!

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Multi-Piece and Masking on Spriteset?
Reply #4
Fantastic. Downloaded these and putting them on the drive (under the tech demos, tutorials, libraries and unfinished games directories).